Commit f4a8da6f authored by jochen@chromium.org's avatar jochen@chromium.org

Remove existingWindowShellWorkaroundWorld

This was used to notify the inspector only of events originating from
the FrameLoader. Instead, do this explicitly

BUG=none
R=dcarney@chromium.org

Review URL: https://codereview.chromium.org/137983002

git-svn-id: svn://svn.chromium.org/blink/trunk@165056 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 4e857b83
......@@ -87,13 +87,6 @@ DOMWrapperWorld* mainThreadNormalWorld()
return cachedNormalWorld;
}
// FIXME: Remove this function. There is currently an issue with the inspector related to the call to dispatchDidClearWindowObjectInWorld in ScriptController::windowShell.
DOMWrapperWorld* existingWindowShellWorkaroundWorld()
{
DEFINE_STATIC_REF(DOMWrapperWorld, world, (adoptRef(new DOMWrapperWorld(MainWorldId - 1, DOMWrapperWorld::mainWorldExtensionGroup - 1))));
return world;
}
bool DOMWrapperWorld::contextHasCorrectPrototype(v8::Handle<v8::Context> context)
{
ASSERT(isMainThread());
......
......@@ -124,15 +124,10 @@ private:
OwnPtr<DOMDataStore> m_domDataStore;
friend DOMWrapperWorld* mainThreadNormalWorld();
friend DOMWrapperWorld* existingWindowShellWorkaroundWorld();
};
DOMWrapperWorld* mainThreadNormalWorld();
// FIXME: this is a workaround for a problem in ScriptController
// Do not use this anywhere else!!
DOMWrapperWorld* existingWindowShellWorkaroundWorld();
} // namespace WebCore
#endif // DOMWrapperWorld_h
......@@ -231,10 +231,6 @@ V8WindowShell* ScriptController::existingWindowShell(DOMWrapperWorld* world)
if (world->isMainWorld())
return m_windowShell->isContextInitialized() ? m_windowShell.get() : 0;
// FIXME: Remove this block. See comment with existingWindowShellWorkaroundWorld().
if (world == existingWindowShellWorkaroundWorld())
return m_windowShell.get();
IsolatedWorldMap::iterator iter = m_isolatedWorlds.find(world->worldId());
if (iter == m_isolatedWorlds.end())
return 0;
......@@ -258,14 +254,8 @@ V8WindowShell* ScriptController::windowShell(DOMWrapperWorld* world)
m_isolatedWorlds.set(world->worldId(), isolatedWorldShell.release());
}
}
if (!shell->isContextInitialized() && shell->initializeIfNeeded()) {
if (world->isMainWorld()) {
// FIXME: Remove this if clause. See comment with existingWindowShellWorkaroundWorld().
m_frame->loader().dispatchDidClearWindowObjectInWorld(existingWindowShellWorkaroundWorld());
} else {
m_frame->loader().dispatchDidClearWindowObjectInWorld(world);
}
}
if (!shell->isContextInitialized() && shell->initializeIfNeeded())
m_frame->loader().dispatchDidClearWindowObjectInWorld(world);
return shell;
}
......
......@@ -1439,8 +1439,13 @@ void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds()
Vector<RefPtr<DOMWrapperWorld> > worlds;
DOMWrapperWorld::getAllWorlds(worlds);
for (size_t i = 0; i < worlds.size(); ++i)
dispatchDidClearWindowObjectInWorld(worlds[i].get());
for (size_t i = 0; i < worlds.size(); ++i) {
if (Page* page = m_frame->page())
page->inspectorController().didClearWindowObjectInWorld(m_frame, worlds[i].get());
m_client->dispatchDidClearWindowObjectInWorld(worlds[i].get());
InspectorInstrumentation::didClearWindowObjectInWorld(m_frame, worlds[i].get());
}
}
void FrameLoader::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld* world)
......@@ -1449,11 +1454,6 @@ void FrameLoader::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld* world)
return;
m_client->dispatchDidClearWindowObjectInWorld(world);
if (Page* page = m_frame->page())
page->inspectorController().didClearWindowObjectInWorld(m_frame, world);
InspectorInstrumentation::didClearWindowObjectInWorld(m_frame, world);
}
SandboxFlags FrameLoader::effectiveSandboxFlags() const
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment