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

Unified Diff: runtime/bin/loader.cc

Issue 2041113003: Activate the service isolate for all precompiled tests. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/loader.h ('k') | runtime/bin/main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/loader.cc
diff --git a/runtime/bin/loader.cc b/runtime/bin/loader.cc
index 35a09357fdfec0bed534daf554b46b3c47f154b7..f43cf30056225291aa737c67d9a5b46e6d4d8145 100644
--- a/runtime/bin/loader.cc
+++ b/runtime/bin/loader.cc
@@ -37,11 +37,13 @@ Loader::Loader(IsolateData* isolate_data)
Loader::~Loader() {
- monitor_->Enter();
ASSERT(port_ != ILLEGAL_PORT);
+ // Enter the monitor while we close the Dart port. After the Dart port is
+ // closed, no more results can be queued.
+ monitor_->Enter();
Dart_CloseNativePort(port_);
- RemoveLoader(port_);
monitor_->Exit();
+ RemoveLoader(port_);
port_ = ILLEGAL_PORT;
isolate_data_->set_loader(NULL);
isolate_data_ = NULL;
@@ -318,6 +320,23 @@ static bool IsWindowsHost() {
}
+void Loader::InitForSnapshot(const char* snapshot_uri) {
+ IsolateData* isolate_data =
+ reinterpret_cast<IsolateData*>(Dart_CurrentIsolateData());
+ ASSERT(isolate_data != NULL);
+ ASSERT(!isolate_data->HasLoader());
+ // Setup a loader. The constructor does a bunch of leg work.
+ Loader* loader = new Loader(isolate_data);
+ // Send the init message.
+ loader->Init(isolate_data->package_root,
+ isolate_data->packages_file,
+ DartUtils::original_working_directory,
+ snapshot_uri);
+ // Destroy the loader. The destructor does a bunch of leg work.
+ delete loader;
+}
+
+
Dart_Handle Loader::LibraryTagHandler(Dart_LibraryTag tag,
Dart_Handle library,
Dart_Handle url) {
« no previous file with comments | « runtime/bin/loader.h ('k') | runtime/bin/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698