OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef MOJO_DART_DART_SNAPSHOTTER_SCOPE_H_ | |
6 #define MOJO_DART_DART_SNAPSHOTTER_SCOPE_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "base/logging.h" | |
10 #include "dart/runtime/include/dart_api.h" | |
11 | |
12 class DartIsolateScope { | |
13 public: | |
14 explicit DartIsolateScope(Dart_Isolate isolate) { | |
15 CHECK(!Dart_CurrentIsolate()); | |
16 Dart_EnterIsolate(isolate); | |
17 } | |
18 ~DartIsolateScope() { Dart_ExitIsolate(); } | |
Cutch
2015/08/10 20:45:02
Use //tonic/dart_api_scope.h and //tonic/dart_isol
zra
2015/08/10 22:59:22
Done.
| |
19 | |
20 private: | |
21 DISALLOW_COPY_AND_ASSIGN(DartIsolateScope); | |
22 }; | |
23 | |
24 class DartApiScope { | |
25 public: | |
26 DartApiScope() { Dart_EnterScope(); } | |
27 ~DartApiScope() { Dart_ExitScope(); } | |
28 | |
29 private: | |
30 DISALLOW_COPY_AND_ASSIGN(DartApiScope); | |
31 }; | |
32 | |
33 #endif // MOJO_DART_DART_SNAPSHOTTER_SCOPE_H_ | |
OLD | NEW |