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

Unified Diff: runtime/vm/parser.cc

Issue 141803019: Enter and Exit scope when calling into the native library tag handler (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 | « runtime/vm/bootstrap.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 32333)
+++ runtime/vm/parser.cc (working copy)
@@ -4855,7 +4855,20 @@
}
+class DartApiScope : public StackResource {
+ public:
+ explicit DartApiScope(Isolate* isolate) : StackResource(isolate) {
+ Dart_EnterScope();
+ }
+ ~DartApiScope() {
+ Dart_ExitScope();
+ }
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DartApiScope);
+};
+
+
RawObject* Parser::CallLibraryTagHandler(Dart_LibraryTag tag,
intptr_t token_pos,
const String& url) {
@@ -4872,6 +4885,7 @@
// Block class finalization attempts when calling into the library
// tag handler.
isolate()->BlockClassFinalization();
+ DartApiScope api_scope(isolate());
hausner 2014/02/05 22:22:56 If this is the only place you anticipate calls to
siva 2014/02/05 23:10:55 The reason I made it a class is because we have so
Dart_Handle result = handler(tag,
Api::NewHandle(isolate(), library_.raw()),
Api::NewHandle(isolate(), url.raw()));
« no previous file with comments | « runtime/vm/bootstrap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698