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

Unified Diff: gin/context_holder.h

Issue 62333018: Implement Asynchronous Module Definition API for Mojo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moar testing Created 7 years, 1 month 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
Index: gin/context_holder.h
diff --git a/gin/context_holder.h b/gin/context_holder.h
new file mode 100644
index 0000000000000000000000000000000000000000..c9068d1810fcef4348346b59ddb5500e592387de
--- /dev/null
+++ b/gin/context_holder.h
@@ -0,0 +1,36 @@
+// Copyright 2013 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 GIN_CONTEXT_HOLDER_H_
+#define GIN_CONTEXT_HOLDER_H_
+
+#include <list>
+#include "base/basictypes.h"
+#include "v8/include/v8.h"
+
+namespace gin {
+
+class ContextHolder {
+ public:
+ explicit ContextHolder(v8::Isolate* isolate);
+ ~ContextHolder();
+
+ v8::Isolate* isolate() const { return isolate_; }
+
+ v8::Handle<v8::Context> context() const {
+ return v8::Local<v8::Context>::New(isolate_, context_);
+ }
+
+ void SetContext(v8::Handle<v8::Context> context);
+
+ private:
+ v8::Isolate* isolate_;
+ v8::Persistent<v8::Context> context_;
+
+ DISALLOW_COPY_AND_ASSIGN(ContextHolder);
+};
+
+} // namespace gin
+
+#endif // GIN_CONTEXT_HOLDER_H_
« no previous file with comments | « gin/arguments.cc ('k') | gin/context_holder.cc » ('j') | gin/modules/module_registry.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698