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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 public: | 90 public: |
91 virtual ~Observer() { } | 91 virtual ~Observer() { } |
92 virtual void willDisposeScriptState(ScriptState*) = 0; | 92 virtual void willDisposeScriptState(ScriptState*) = 0; |
93 }; | 93 }; |
94 void addObserver(Observer*); | 94 void addObserver(Observer*); |
95 void removeObserver(Observer*); | 95 void removeObserver(Observer*); |
96 | 96 |
97 bool evalEnabled() const; | 97 bool evalEnabled() const; |
98 void setEvalEnabled(bool); | 98 void setEvalEnabled(bool); |
99 ScriptValue getFromGlobalObject(const char* name); | 99 ScriptValue getFromGlobalObject(const char* name); |
| 100 ScriptValue getFromExtrasExports(const char* name); |
100 | 101 |
101 protected: | 102 protected: |
102 ScriptState(v8::Local<v8::Context>, PassRefPtr<DOMWrapperWorld>); | 103 ScriptState(v8::Local<v8::Context>, PassRefPtr<DOMWrapperWorld>); |
103 | 104 |
104 private: | 105 private: |
105 v8::Isolate* m_isolate; | 106 v8::Isolate* m_isolate; |
106 // This persistent handle is weak. | 107 // This persistent handle is weak. |
107 ScopedPersistent<v8::Context> m_context; | 108 ScopedPersistent<v8::Context> m_context; |
108 | 109 |
109 // This RefPtr doesn't cause a cycle because all persistent handles that DOM
WrapperWorld holds are weak. | 110 // 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... |
142 } | 143 } |
143 | 144 |
144 private: | 145 private: |
145 RefPtr<ScriptState> m_scriptState; | 146 RefPtr<ScriptState> m_scriptState; |
146 ScopedPersistent<v8::Context> m_context; | 147 ScopedPersistent<v8::Context> m_context; |
147 }; | 148 }; |
148 | 149 |
149 } | 150 } |
150 | 151 |
151 #endif // ScriptState_h | 152 #endif // ScriptState_h |
OLD | NEW |