OLD | NEW |
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 class RunMicrotasksObserver; | 16 class RunMicrotasksObserver; |
| 17 class V8IsolateMemoryDumpProvider; |
17 | 18 |
18 // To embed Gin, first initialize gin using IsolateHolder::Initialize and then | 19 // To embed Gin, first initialize gin using IsolateHolder::Initialize and then |
19 // create an instance of IsolateHolder to hold the v8::Isolate in which you | 20 // create an instance of IsolateHolder to hold the v8::Isolate in which you |
20 // will execute JavaScript. You might wish to subclass IsolateHolder if you | 21 // will execute JavaScript. You might wish to subclass IsolateHolder if you |
21 // want to tie more state to the lifetime of the isolate. | 22 // want to tie more state to the lifetime of the isolate. |
22 class GIN_EXPORT IsolateHolder { | 23 class GIN_EXPORT IsolateHolder { |
23 public: | 24 public: |
24 // Controls whether or not V8 should only accept strict mode scripts. | 25 // Controls whether or not V8 should only accept strict mode scripts. |
25 enum ScriptMode { | 26 enum ScriptMode { |
26 kNonStrictMode, | 27 kNonStrictMode, |
(...skipping 22 matching lines...) Expand all Loading... |
49 void AddRunMicrotasksObserver(); | 50 void AddRunMicrotasksObserver(); |
50 | 51 |
51 // This method should also only be called once, and on the MessageLoop's | 52 // This method should also only be called once, and on the MessageLoop's |
52 // thread. | 53 // thread. |
53 void RemoveRunMicrotasksObserver(); | 54 void RemoveRunMicrotasksObserver(); |
54 | 55 |
55 private: | 56 private: |
56 v8::Isolate* isolate_; | 57 v8::Isolate* isolate_; |
57 scoped_ptr<PerIsolateData> isolate_data_; | 58 scoped_ptr<PerIsolateData> isolate_data_; |
58 scoped_ptr<RunMicrotasksObserver> task_observer_; | 59 scoped_ptr<RunMicrotasksObserver> task_observer_; |
| 60 scoped_ptr<V8IsolateMemoryDumpProvider> isolate_memory_dump_provider_; |
59 | 61 |
60 DISALLOW_COPY_AND_ASSIGN(IsolateHolder); | 62 DISALLOW_COPY_AND_ASSIGN(IsolateHolder); |
61 }; | 63 }; |
62 | 64 |
63 } // namespace gin | 65 } // namespace gin |
64 | 66 |
65 #endif // GIN_PUBLIC_ISOLATE_HOLDER_H_ | 67 #endif // GIN_PUBLIC_ISOLATE_HOLDER_H_ |
OLD | NEW |