Chromium Code Reviews| 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() |