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

Unified Diff: include/v8.h

Issue 435003: Patch for allowing several V8 instances in process:... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years 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 | « AUTHORS ('k') | samples/shell.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
===================================================================
--- include/v8.h (revision 3427)
+++ include/v8.h (working copy)
@@ -132,6 +132,7 @@
class Arguments;
class Object;
class Top;
+class V8Context;
}
@@ -2761,14 +2762,12 @@
/**
* Returns whether v8::Locker is being used by this V8 instance.
*/
- static bool IsActive() { return active_; }
+ static bool IsActive();
private:
bool has_lock_;
bool top_level_;
- static bool active_;
-
// Disallow copying and assigning.
Locker(const Locker&);
void operator=(const Locker&);
@@ -3207,6 +3206,58 @@
/**
+ * Encapsulates V8 instance
+ */
+class V8EXPORT V8ContextProvider {
+ public:
+ V8ContextProvider();
+ ~V8ContextProvider();
+
+ operator internal::V8Context*() const {
+ return v8context_;
+ }
+ private:
+ V8ContextProvider(const V8ContextProvider&);
+ void operator=(const V8ContextProvider&);
+ void* operator new(size_t size);
+ void operator delete(void*, size_t);
+
+ internal::V8Context* const v8context_;
+ friend class V8ContextBinder;
+};
+
+/**
+ * Manages binding of V8 instance (from V8ContextProvider) to current thread
+ *
+ * V8ContextProvider context_provider;
+ * ...
+ * V8ContextBinder context_binder(context_provider);
+ */
+class V8EXPORT V8ContextBinder {
+ public:
+ V8ContextBinder(internal::V8Context*, bool bind_default = false);
+ ~V8ContextBinder();
+ private:
+ V8ContextBinder(const V8ContextBinder&);
+ void operator=(const V8ContextBinder&);
+ void* operator new(size_t size);
+ void operator delete(void*, size_t);
+
+ internal::V8Context* const v8context_;
+ bool bound_default_;
+};
+
+/**
+ * Allocated statically, implies intent of V8 host to have several instances
+ * of V8 in process
+ */
+class V8EXPORT AllowSeveralV8InstancesInProcess {
+ public:
+ AllowSeveralV8InstancesInProcess();
+ ~AllowSeveralV8InstancesInProcess();
+};
+
+/**
* \example shell.cc
* A simple shell that takes a list of expressions on the
* command-line and executes them.
« no previous file with comments | « AUTHORS ('k') | samples/shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698