Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / bindings / core / v8 / ScriptState.cpp
index eed60a1..09d8cd3 100644 (file)
@@ -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);