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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 public: | 102 public: |
103 virtual ~Observer() { } | 103 virtual ~Observer() { } |
104 virtual void willDisposeScriptState(ScriptState*) = 0; | 104 virtual void willDisposeScriptState(ScriptState*) = 0; |
105 }; | 105 }; |
106 void addObserver(Observer*); | 106 void addObserver(Observer*); |
107 void removeObserver(Observer*); | 107 void removeObserver(Observer*); |
108 | 108 |
109 bool evalEnabled() const; | 109 bool evalEnabled() const; |
110 void setEvalEnabled(bool); | 110 void setEvalEnabled(bool); |
111 ScriptValue getFromGlobalObject(const char* name); | 111 ScriptValue getFromGlobalObject(const char* name); |
| 112 ScriptValue getFromExtrasExports(const char* name); |
112 | 113 |
113 protected: | 114 protected: |
114 ScriptState(v8::Local<v8::Context>, PassRefPtr<DOMWrapperWorld>); | 115 ScriptState(v8::Local<v8::Context>, PassRefPtr<DOMWrapperWorld>); |
115 | 116 |
116 private: | 117 private: |
117 v8::Isolate* m_isolate; | 118 v8::Isolate* m_isolate; |
118 // This persistent handle is weak. | 119 // This persistent handle is weak. |
119 ScopedPersistent<v8::Context> m_context; | 120 ScopedPersistent<v8::Context> m_context; |
120 | 121 |
121 // This RefPtr doesn't cause a cycle because all persistent handles that DOM
WrapperWorld holds are weak. | 122 // This RefPtr doesn't cause a cycle because all persistent handles that DOM
WrapperWorld holds are weak. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 } | 155 } |
155 | 156 |
156 private: | 157 private: |
157 RefPtr<ScriptState> m_scriptState; | 158 RefPtr<ScriptState> m_scriptState; |
158 ScopedPersistent<v8::Context> m_context; | 159 ScopedPersistent<v8::Context> m_context; |
159 }; | 160 }; |
160 | 161 |
161 } | 162 } |
162 | 163 |
163 #endif // ScriptState_h | 164 #endif // ScriptState_h |
OLD | NEW |