diff options
Diffstat (limited to 'chromium/gin/public/isolate_holder.h')
-rw-r--r-- | chromium/gin/public/isolate_holder.h | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/chromium/gin/public/isolate_holder.h b/chromium/gin/public/isolate_holder.h index d68e4d5a58b..ee696f6550b 100644 --- a/chromium/gin/public/isolate_holder.h +++ b/chromium/gin/public/isolate_holder.h @@ -8,10 +8,7 @@ #include "base/basictypes.h" #include "base/memory/scoped_ptr.h" #include "gin/gin_export.h" - -namespace v8 { -class Isolate; -} +#include "v8/include/v8.h" namespace gin { @@ -19,25 +16,31 @@ class PerIsolateData; // To embed Gin, first create an instance of IsolateHolder to hold the // v8::Isolate in which you will execute JavaScript. You might wish to subclass -// IsolateHolder if you want to tie more state to the lifetime of the +// IsolateHolder if you want to tie more state to the lifetime of the isolate. // // You can use gin in two modes: either gin manages V8, or the gin-embedder -// manages gin. If gin manages V8, use the IsolateHolder constructor without -// parameters, otherwise, the gin-embedder needs to create v8::Isolates and -// pass them to IsolateHolder. +// manages gin. If gin manages V8, use the IsolateHolder constructor that does +// not take an v8::Isolate parameter, otherwise, the gin-embedder needs to +// create v8::Isolates and pass them to IsolateHolder. // // It is not possible to mix the two. class GIN_EXPORT IsolateHolder { public: - IsolateHolder(); - explicit IsolateHolder(v8::Isolate* isolate); + // Controls whether or not V8 should only accept strict mode scripts. + enum ScriptMode { + kNonStrictMode, + kStrictMode + }; + + explicit IsolateHolder(ScriptMode mode); + IsolateHolder(v8::Isolate* isolate, v8::ArrayBuffer::Allocator* allocator); ~IsolateHolder(); v8::Isolate* isolate() { return isolate_; } private: - void Init(); + void Init(v8::ArrayBuffer::Allocator* allocator); bool isolate_owner_; v8::Isolate* isolate_; |