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

Unified Diff: sky/tools/packager/scope.h

Issue 1178213003: Introduce sky_packager (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 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 | « sky/tools/packager/main.cc ('k') | sky/tools/packager/switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/tools/packager/scope.h
diff --git a/sky/tools/packager/scope.h b/sky/tools/packager/scope.h
new file mode 100644
index 0000000000000000000000000000000000000000..b039d24dcc51868505c698a989c51d667f20a9a4
--- /dev/null
+++ b/sky/tools/packager/scope.h
@@ -0,0 +1,33 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SKY_TOOLS_PACKAGER_SCOPE_H_
+#define SKY_TOOLS_PACKAGER_SCOPE_H_
+
+#include "base/basictypes.h"
+#include "base/logging.h"
+#include "dart/runtime/include/dart_api.h"
+
+class DartIsolateScope {
+ public:
+ explicit DartIsolateScope(Dart_Isolate isolate) {
+ CHECK(!Dart_CurrentIsolate());
+ Dart_EnterIsolate(isolate);
+ }
+ ~DartIsolateScope() { Dart_ExitIsolate(); }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DartIsolateScope);
+};
+
+class DartApiScope {
+ public:
+ DartApiScope() { Dart_EnterScope(); }
+ ~DartApiScope() { Dart_ExitScope(); }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DartApiScope);
+};
+
+#endif // SKY_TOOLS_PACKAGER_SCOPE_H_
« no previous file with comments | « sky/tools/packager/main.cc ('k') | sky/tools/packager/switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698