Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(378)

Side by Side Diff: mojo/dart/embedder/dart_controller.cc

Issue 950063002: Add patch file support to Dart embedder (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/callback.h" 5 #include "base/callback.h"
6 #include "base/files/file_util.h" 6 #include "base/files/file_util.h"
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/sys_info.h" 9 #include "base/sys_info.h"
10 #include "crypto/random.h" 10 #include "crypto/random.h"
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 218
219 // Set up package root. 219 // Set up package root.
220 result = Dart_NewStringFromUTF8( 220 result = Dart_NewStringFromUTF8(
221 reinterpret_cast<const uint8_t*>(package_root.c_str()), 221 reinterpret_cast<const uint8_t*>(package_root.c_str()),
222 package_root.length()); 222 package_root.length());
223 DART_CHECK_VALID(result); 223 DART_CHECK_VALID(result);
224 224
225 const int kNumArgs = 1; 225 const int kNumArgs = 1;
226 Dart_Handle dart_args[kNumArgs]; 226 Dart_Handle dart_args[kNumArgs];
227 dart_args[0] = result; 227 dart_args[0] = result;
228 return Dart_Invoke(builtin_lib, 228 result = Dart_Invoke(builtin_lib,
229 Dart_NewStringFromCString("_setPackageRoot"), 229 Dart_NewStringFromCString("_setPackageRoot"),
230 kNumArgs, 230 kNumArgs,
231 dart_args); 231 dart_args);
232 232 DART_CHECK_VALID(result);
233 return result; 233 return result;
234 } 234 }
235 235
236 static Dart_Isolate CreateServiceIsolateHelper(const char* script_uri, 236 static Dart_Isolate CreateServiceIsolateHelper(const char* script_uri,
237 char** error) { 237 char** error) {
238 // TODO(johnmccutchan): Add support the service isolate. 238 // TODO(johnmccutchan): Add support the service isolate.
239 // No callbacks for service isolate. 239 // No callbacks for service isolate.
240 IsolateCallbacks callbacks; 240 IsolateCallbacks callbacks;
241 IsolateData* isolate_data = 241 IsolateData* isolate_data =
242 new IsolateData(NULL, false, callbacks, "", "", ""); 242 new IsolateData(NULL, false, callbacks, "", "", "");
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 693
694 Dart_ExitScope(); 694 Dart_ExitScope();
695 Dart_ShutdownIsolate(); 695 Dart_ShutdownIsolate();
696 Dart_Cleanup(); 696 Dart_Cleanup();
697 root_isolate_ = nullptr; 697 root_isolate_ = nullptr;
698 initialized_ = false; 698 initialized_ = false;
699 } 699 }
700 700
701 } // namespace apps 701 } // namespace apps
702 } // namespace mojo 702 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698