| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 // These methods can return nullptr if the context associated with the | 81 // These methods can return nullptr if the context associated with the |
| 82 // ScriptState has already been detached. | 82 // ScriptState has already been detached. |
| 83 static ScriptState* forMainWorld(LocalFrame*); | 83 static ScriptState* forMainWorld(LocalFrame*); |
| 84 static ScriptState* forWorld(LocalFrame*, DOMWrapperWorld&); | 84 static ScriptState* forWorld(LocalFrame*, DOMWrapperWorld&); |
| 85 | 85 |
| 86 v8::Isolate* isolate() const { return m_isolate; } | 86 v8::Isolate* isolate() const { return m_isolate; } |
| 87 DOMWrapperWorld& world() const { return *m_world; } | 87 DOMWrapperWorld& world() const { return *m_world; } |
| 88 LocalDOMWindow* domWindow() const; | 88 LocalDOMWindow* domWindow() const; |
| 89 virtual ExecutionContext* getExecutionContext() const; | 89 virtual ExecutionContext* getExecutionContext() const; |
| 90 virtual void setExecutionContext(ExecutionContext*); | 90 virtual void setExecutionContext(ExecutionContext*); |
| 91 int contextIdInDebugger(); | |
| 92 | 91 |
| 93 // This can return an empty handle if the v8::Context is gone. | 92 // This can return an empty handle if the v8::Context is gone. |
| 94 v8::Local<v8::Context> context() const { return m_context.newLocal(m_isolate
); } | 93 v8::Local<v8::Context> context() const { return m_context.newLocal(m_isolate
); } |
| 95 bool contextIsValid() const { return !m_context.isEmpty() && m_perContextDat
a; } | 94 bool contextIsValid() const { return !m_context.isEmpty() && m_perContextDat
a; } |
| 96 void detachGlobalObject(); | 95 void detachGlobalObject(); |
| 97 void clearContext() { return m_context.clear(); } | 96 void clearContext() { return m_context.clear(); } |
| 98 #if ENABLE(ASSERT) | 97 #if ENABLE(ASSERT) |
| 99 bool isGlobalObjectDetached() const { return m_globalObjectDetached; } | 98 bool isGlobalObjectDetached() const { return m_globalObjectDetached; } |
| 100 #endif | 99 #endif |
| 101 | 100 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 } | 147 } |
| 149 | 148 |
| 150 private: | 149 private: |
| 151 RefPtr<ScriptState> m_scriptState; | 150 RefPtr<ScriptState> m_scriptState; |
| 152 ScopedPersistent<v8::Context> m_context; | 151 ScopedPersistent<v8::Context> m_context; |
| 153 }; | 152 }; |
| 154 | 153 |
| 155 } // namespace blink | 154 } // namespace blink |
| 156 | 155 |
| 157 #endif // ScriptState_h | 156 #endif // ScriptState_h |
| OLD | NEW |