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

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

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/ScriptState.h ('k') | Source/bindings/core/v8/ScriptValue.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/ScriptState.cpp
diff --git a/Source/bindings/core/v8/ScriptState.cpp b/Source/bindings/core/v8/ScriptState.cpp
index eed60a1f30136fd577931f5a5fea95c516a2e2a1..09d8cd3185dc35e76d9697f973b6a842d0051afc 100644
--- a/Source/bindings/core/v8/ScriptState.cpp
+++ b/Source/bindings/core/v8/ScriptState.cpp
@@ -32,6 +32,7 @@ ScriptState::ScriptState(v8::Handle<v8::Context> context, PassRefPtr<DOMWrapperW
, m_context(m_isolate, context)
, m_world(world)
, m_perContextData(V8PerContextData::create(context))
+ , m_globalObjectDetached(false)
{
ASSERT(m_world);
m_context.setWeak(this, &weakCallback);
@@ -44,6 +45,13 @@ ScriptState::~ScriptState()
ASSERT(m_context.isEmpty());
}
+void ScriptState::detachGlobalObject()
+{
+ ASSERT(!m_context.isEmpty());
+ context()->DetachGlobal();
+ m_globalObjectDetached = true;
+}
+
bool ScriptState::evalEnabled() const
{
v8::HandleScope handleScope(m_isolate);
« no previous file with comments | « Source/bindings/core/v8/ScriptState.h ('k') | Source/bindings/core/v8/ScriptValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698