OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 ScriptState_h | 5 #ifndef ScriptState_h |
6 #define ScriptState_h | 6 #define ScriptState_h |
7 | 7 |
8 #include "bindings/core/v8/ScopedPersistent.h" | 8 #include "bindings/core/v8/ScopedPersistent.h" |
9 #include "bindings/core/v8/V8PerContextData.h" | 9 #include "bindings/core/v8/V8PerContextData.h" |
10 #include "core/CoreExport.h" | 10 #include "core/CoreExport.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 public: | 106 public: |
107 virtual ~Observer() { } | 107 virtual ~Observer() { } |
108 virtual void willDisposeScriptState(ScriptState*) = 0; | 108 virtual void willDisposeScriptState(ScriptState*) = 0; |
109 }; | 109 }; |
110 void addObserver(Observer*); | 110 void addObserver(Observer*); |
111 void removeObserver(Observer*); | 111 void removeObserver(Observer*); |
112 | 112 |
113 bool evalEnabled() const; | 113 bool evalEnabled() const; |
114 void setEvalEnabled(bool); | 114 void setEvalEnabled(bool); |
115 ScriptValue getFromGlobalObject(const char* name); | 115 ScriptValue getFromGlobalObject(const char* name); |
| 116 ScriptValue getFromExtrasExports(const char* name); |
116 | 117 |
117 protected: | 118 protected: |
118 ScriptState(v8::Local<v8::Context>, PassRefPtr<DOMWrapperWorld>); | 119 ScriptState(v8::Local<v8::Context>, PassRefPtr<DOMWrapperWorld>); |
119 | 120 |
120 private: | 121 private: |
121 v8::Isolate* m_isolate; | 122 v8::Isolate* m_isolate; |
122 // This persistent handle is weak. | 123 // This persistent handle is weak. |
123 ScopedPersistent<v8::Context> m_context; | 124 ScopedPersistent<v8::Context> m_context; |
124 | 125 |
125 // This RefPtr doesn't cause a cycle because all persistent handles that DOM
WrapperWorld holds are weak. | 126 // This RefPtr doesn't cause a cycle because all persistent handles that DOM
WrapperWorld holds are weak. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 } | 160 } |
160 | 161 |
161 private: | 162 private: |
162 RefPtr<ScriptState> m_scriptState; | 163 RefPtr<ScriptState> m_scriptState; |
163 ScopedPersistent<v8::Context> m_context; | 164 ScopedPersistent<v8::Context> m_context; |
164 }; | 165 }; |
165 | 166 |
166 } | 167 } |
167 | 168 |
168 #endif // ScriptState_h | 169 #endif // ScriptState_h |
OLD | NEW |