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

Unified Diff: runtime/vm/dart_api_impl.h

Issue 1377733007: Error quickly if the embedder tries to load after Dart_Precompile. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.h
diff --git a/runtime/vm/dart_api_impl.h b/runtime/vm/dart_api_impl.h
index 742f80c4424c4dc5818a9a7e0a8f8e2274a01422..2f635d3097092a3cb4be4f681c8be1b27461759c 100644
--- a/runtime/vm/dart_api_impl.h
+++ b/runtime/vm/dart_api_impl.h
@@ -316,6 +316,12 @@ class IsolateSaver {
return reinterpret_cast<Dart_Handle>(Api::AcquiredError(isolate)); \
} \
+#define CHECK_COMPILATION_ALLOWED(isolate) \
+ if (!isolate->compilation_allowed()) { \
+ return Api::NewError("%s: Cannot load after Dart_Precompile", \
+ CURRENT_FUNC); \
+ } \
+
#define ASSERT_CALLBACK_STATE(isolate) \
ASSERT(isolate->no_callback_scope_depth() == 0)
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698