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

Side by Side Diff: gin/public/isolate_holder.h

Issue 568523002: Remove deprecated IsolateHolder constructor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « gin/isolate_holder.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef GIN_PUBLIC_ISOLATE_HOLDER_H_ 5 #ifndef GIN_PUBLIC_ISOLATE_HOLDER_H_
6 #define GIN_PUBLIC_ISOLATE_HOLDER_H_ 6 #define GIN_PUBLIC_ISOLATE_HOLDER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "gin/gin_export.h" 10 #include "gin/gin_export.h"
11 #include "v8/include/v8.h" 11 #include "v8/include/v8.h"
12 12
13 namespace gin { 13 namespace gin {
14 14
15 class PerIsolateData; 15 class PerIsolateData;
16 16
17 // To embed Gin, first create an instance of IsolateHolder to hold the 17 // To embed Gin, first initialize gin using IsolateHolder::Initialize and then
18 // v8::Isolate in which you will execute JavaScript. You might wish to subclass 18 // create an instance of IsolateHolder to hold the v8::Isolate in which you
19 // IsolateHolder if you want to tie more state to the lifetime of the isolate. 19 // will execute JavaScript. You might wish to subclass IsolateHolder if you
20 // 20 // want to tie more state to the lifetime of the isolate.
21 // You can use gin in two modes: either gin manages V8, or the gin-embedder
22 // manages gin. If gin manages V8, use the IsolateHolder constructor that does
23 // not take an v8::Isolate parameter, otherwise, the gin-embedder needs to
24 // create v8::Isolates and pass them to IsolateHolder.
25 //
26 // It is not possible to mix the two.
27 class GIN_EXPORT IsolateHolder { 21 class GIN_EXPORT IsolateHolder {
28 public: 22 public:
29 // Controls whether or not V8 should only accept strict mode scripts. 23 // Controls whether or not V8 should only accept strict mode scripts.
30 enum ScriptMode { 24 enum ScriptMode {
31 kNonStrictMode, 25 kNonStrictMode,
32 kStrictMode 26 kStrictMode
33 }; 27 };
34 28
35 IsolateHolder(); 29 IsolateHolder();
36 // Deprecated.
37 IsolateHolder(v8::Isolate* isolate, v8::ArrayBuffer::Allocator* allocator);
38
39 ~IsolateHolder(); 30 ~IsolateHolder();
40 31
41 // Should be invoked once before creating IsolateHolder instances to 32 // Should be invoked once before creating IsolateHolder instances to
42 // initialize V8 and Gin. 33 // initialize V8 and Gin.
43 static void Initialize(ScriptMode mode, 34 static void Initialize(ScriptMode mode,
44 v8::ArrayBuffer::Allocator* allocator); 35 v8::ArrayBuffer::Allocator* allocator);
45 36
46 v8::Isolate* isolate() { return isolate_; } 37 v8::Isolate* isolate() { return isolate_; }
47 38
48 private: 39 private:
49 void Init(v8::ArrayBuffer::Allocator* allocator);
50
51 bool isolate_owner_;
52 v8::Isolate* isolate_; 40 v8::Isolate* isolate_;
53 scoped_ptr<PerIsolateData> isolate_data_; 41 scoped_ptr<PerIsolateData> isolate_data_;
54 42
55 DISALLOW_COPY_AND_ASSIGN(IsolateHolder); 43 DISALLOW_COPY_AND_ASSIGN(IsolateHolder);
56 }; 44 };
57 45
58 } // namespace gin 46 } // namespace gin
59 47
60 #endif // GIN_PUBLIC_ISOLATE_HOLDER_H_ 48 #endif // GIN_PUBLIC_ISOLATE_HOLDER_H_
OLDNEW
« no previous file with comments | « gin/isolate_holder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698