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

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

Issue 1088683003: Adding v8_isolate_memory_dump_provider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase for using locker. Created 5 years, 8 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
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 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 // thread. 60 // thread.
60 void RemoveRunMicrotasksObserver(); 61 void RemoveRunMicrotasksObserver();
61 62
62 // This method returns if v8::Locker is needed to access isolate. 63 // This method returns if v8::Locker is needed to access isolate.
63 AccessMode access_mode() const { return access_mode_; } 64 AccessMode access_mode() const { return access_mode_; }
64 65
65 private: 66 private:
66 v8::Isolate* isolate_; 67 v8::Isolate* isolate_;
67 scoped_ptr<PerIsolateData> isolate_data_; 68 scoped_ptr<PerIsolateData> isolate_data_;
68 scoped_ptr<RunMicrotasksObserver> task_observer_; 69 scoped_ptr<RunMicrotasksObserver> task_observer_;
70 scoped_ptr<V8IsolateMemoryDumpProvider> isolate_memory_dump_provider_;
69 AccessMode access_mode_; 71 AccessMode access_mode_;
70 72
71 DISALLOW_COPY_AND_ASSIGN(IsolateHolder); 73 DISALLOW_COPY_AND_ASSIGN(IsolateHolder);
72 }; 74 };
73 75
74 } // namespace gin 76 } // namespace gin
75 77
76 #endif // GIN_PUBLIC_ISOLATE_HOLDER_H_ 78 #endif // GIN_PUBLIC_ISOLATE_HOLDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698