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

Unified Diff: runtime/vm/service_isolate.cc

Issue 2982783002: Without a service isolate callback, don't spawn a thread (Closed)
Patch Set: Created 3 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service_isolate.cc
diff --git a/runtime/vm/service_isolate.cc b/runtime/vm/service_isolate.cc
index 6ceeddfcd7bac1b462f6acb944d7fdb28e95cd94..1826f16fbe82444d652a94eb75df1cdc6f68abd0 100644
--- a/runtime/vm/service_isolate.cc
+++ b/runtime/vm/service_isolate.cc
@@ -327,12 +327,7 @@ class RunServiceTask : public ThreadPool::Task {
Dart_IsolateCreateCallback create_callback =
ServiceIsolate::create_callback();
- // TODO(johnmccutchan): Support starting up service isolate without embedder
- // provided isolate creation callback.
- if (create_callback == NULL) {
- ServiceIsolate::FinishedInitializing();
- return;
- }
+ ASSERT(create_callback != NULL);
Dart_IsolateFlags api_flags;
Isolate::FlagsInitialize(&api_flags);
@@ -460,6 +455,10 @@ void ServiceIsolate::Run() {
// Grab the isolate create callback here to avoid race conditions with tests
// that change this after Dart_Initialize returns.
create_callback_ = Isolate::CreateCallback();
+ if (create_callback_ == NULL) {
+ ServiceIsolate::FinishedInitializing();
+ return;
+ }
Dart::thread_pool()->Run(new RunServiceTask());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698