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

Unified Diff: runtime/vm/dart_api_impl.h

Issue 180243022: Fix fromEnvironment when called from isolates. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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/lib/string.cc ('k') | runtime/vm/parser.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 2f10f43388dff386593b35a404bc81d2ee234e2b..3a5cf64db628b42fb5b7d3f75fc6275a92deacc8 100644
--- a/runtime/vm/dart_api_impl.h
+++ b/runtime/vm/dart_api_impl.h
@@ -109,6 +109,20 @@ const char* CanonicalFunction(const char* func);
class Api : AllStatic {
public:
+ // Create on the stack to provide a new throw-safe api scope.
+ class Scope : public StackResource {
+ public:
+ explicit Scope(Isolate* isolate) : StackResource(isolate) {
+ Dart_EnterScope();
+ }
+ ~Scope() {
+ Dart_ExitScope();
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(Scope);
+ };
+
// Creates a new local handle.
static Dart_Handle NewHandle(Isolate* isolate, RawObject* raw);
« no previous file with comments | « runtime/lib/string.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698