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

Unified Diff: Source/bindings/v8/DOMWrapperWorld.cpp

Issue 14334002: Delete WorldContextHandle in favor of DOMWrapperWorld (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 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/v8/DOMWrapperWorld.h ('k') | Source/bindings/v8/ScriptEventListener.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/DOMWrapperWorld.cpp
diff --git a/Source/bindings/v8/DOMWrapperWorld.cpp b/Source/bindings/v8/DOMWrapperWorld.cpp
index a5e8cec381d44aafa73bf1ce567022e9a4723e0d..91209564108b37bceff198c13ad958d092e3c49c 100644
--- a/Source/bindings/v8/DOMWrapperWorld.cpp
+++ b/Source/bindings/v8/DOMWrapperWorld.cpp
@@ -65,14 +65,16 @@ DOMWrapperWorld::DOMWrapperWorld(int worldId, int extensionGroup)
m_domDataStore = adoptPtr(new DOMDataStore(IsolatedWorld));
}
-DOMWrapperWorld* DOMWrapperWorld::current(ScriptExecutionContext* scriptExecutionContext)
+DOMWrapperWorld* DOMWrapperWorld::current()
{
- if (scriptExecutionContext->isWorkerContext())
+ ASSERT(v8::Context::InContext());
+ v8::Handle<v8::Context> context = v8::Context::GetCurrent();
+ if (!V8DOMWrapper::isWrapperOfType(toInnerGlobalObject(context), &V8DOMWindow::info))
abarth-chromium 2013/04/18 05:41:51 toInnerGlobalObject can be slow, but I don't think
return 0;
ASSERT(isMainThread());
- ASSERT(v8::Context::InContext());
- DOMWrapperWorld* world = isolatedWorld(v8::Context::GetCurrent());
- return world ? world : mainThreadNormalWorld();
+ if (DOMWrapperWorld* world = isolatedWorld(context))
+ return world;
+ return mainThreadNormalWorld();
}
DOMWrapperWorld* mainThreadNormalWorld()
« no previous file with comments | « Source/bindings/v8/DOMWrapperWorld.h ('k') | Source/bindings/v8/ScriptEventListener.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698