Chromium Code Reviews| 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())); |