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

Unified Diff: tonic/dart_message_handler.h

Issue 1688793002: Fix shutdown race when running Dart on the message loop (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/dart/content_handler_main.cc ('k') | tonic/dart_message_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tonic/dart_message_handler.h
diff --git a/tonic/dart_message_handler.h b/tonic/dart_message_handler.h
index 5cb2f9aad94c2be758c8a09a46ba659794a5b16f..a6ab3d3122070bc6a9775411665d5ba852ddf463 100644
--- a/tonic/dart_message_handler.h
+++ b/tonic/dart_message_handler.h
@@ -20,6 +20,27 @@ class DartMessageHandler {
// Messages for the current isolate will be scheduled on |runner|.
void Initialize(const scoped_refptr<base::SingleThreadTaskRunner>& runner);
+ // Request the message loop to quit when isolate exits? Default is true.
+ void set_quit_message_loop_when_isolate_exits(
+ bool quit_message_loop_when_isolate_exits) {
+ quit_message_loop_when_isolate_exits_ =
+ quit_message_loop_when_isolate_exits;
+ }
+
+ bool quit_message_loop_when_isolate_exits() const {
+ return quit_message_loop_when_isolate_exits_;
+ }
+
+ // Did the isolate exit?
+ bool isolate_exited() const {
+ return isolate_exited_;
+ }
+
+ // Did the isolate have an uncaught exception error?
+ bool isolate_had_uncaught_exception_error() const {
+ return isolate_had_uncaught_exception_error_;
+ }
+
protected:
// Called from an unknown thread for each message.
void OnMessage(DartState* dart_state);
@@ -39,6 +60,9 @@ class DartMessageHandler {
}
bool handled_first_message_;
+ bool quit_message_loop_when_isolate_exits_;
+ bool isolate_exited_;
+ bool isolate_had_uncaught_exception_error_;
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
private:
« no previous file with comments | « services/dart/content_handler_main.cc ('k') | tonic/dart_message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698