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