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

Unified Diff: runtime/bin/process.h

Issue 2463923002: Don't use IsolateData for the exit hook as multiple embedders share the dart/bin while using differ… (Closed)
Patch Set: check secondary Created 4 years, 1 month 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/main.cc ('k') | runtime/bin/process.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/process.h
diff --git a/runtime/bin/process.h b/runtime/bin/process.h
index 2886e71d7c84f5308b4742de80037eacf04c2eee..4ef892908d802492ec0393f22b2fcabda1286b83 100644
--- a/runtime/bin/process.h
+++ b/runtime/bin/process.h
@@ -126,6 +126,16 @@ class Process {
global_exit_code_ = exit_code;
}
+ typedef void (*ExitHook)(int64_t exit_code);
+ static void SetExitHook(ExitHook hook) {
+ exit_hook_ = hook;
+ }
+ static void RunExitHook(int64_t exit_code) {
+ if (exit_hook_ != NULL) {
+ exit_hook_(exit_code);
+ }
+ }
+
static intptr_t CurrentProcessId();
static intptr_t SetSignalHandler(intptr_t signal);
@@ -139,6 +149,7 @@ class Process {
private:
static int global_exit_code_;
static Mutex* global_exit_code_mutex_;
+ static ExitHook exit_hook_;
DISALLOW_ALLOCATION();
DISALLOW_IMPLICIT_CONSTRUCTORS(Process);
« no previous file with comments | « runtime/bin/main.cc ('k') | runtime/bin/process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698