Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Unified Diff: Source/bindings/core/v8/ScriptState.h

Issue 538933002: ScriptState::contextIsEmpty shouldn't return true for a context whose global object is detached (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/core/v8/ScriptDebugServer.cpp ('k') | Source/bindings/core/v8/ScriptState.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/ScriptState.h
diff --git a/Source/bindings/core/v8/ScriptState.h b/Source/bindings/core/v8/ScriptState.h
index e83746ae64b09bc98dc77a718e9179bc9221d0b3..1dd9d56dceebb29594f67b904ef6181584ce5cd3 100644
--- a/Source/bindings/core/v8/ScriptState.h
+++ b/Source/bindings/core/v8/ScriptState.h
@@ -74,7 +74,8 @@ public:
// This can return an empty handle if the v8::Context is gone.
v8::Handle<v8::Context> context() const { return m_context.newLocal(m_isolate); }
- bool contextIsEmpty() const { return m_context.isEmpty(); }
+ bool contextIsValue() const { return m_context.isEmpty() || m_globalObjectDetached; }
+ void detachGlobalObject();
void clearContext() { return m_context.clear(); }
V8PerContextData* perContextData() const { return m_perContextData.get(); }
@@ -100,6 +101,8 @@ private:
// So you must explicitly clear the OwnPtr by calling disposePerContextData()
// once you no longer need V8PerContextData. Otherwise, the v8::Context will leak.
OwnPtr<V8PerContextData> m_perContextData;
+
+ bool m_globalObjectDetached;
};
class ScriptStateForTesting : public ScriptState {
« no previous file with comments | « Source/bindings/core/v8/ScriptDebugServer.cpp ('k') | Source/bindings/core/v8/ScriptState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698