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() ...@@ -87,13 +87,6 @@ DOMWrapperWorld* mainThreadNormalWorld()
return cachedNormalWorld; 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) bool DOMWrapperWorld::contextHasCorrectPrototype(v8::Handle<v8::Context> context)
{ {
ASSERT(isMainThread()); ASSERT(isMainThread());
......
...@@ -124,15 +124,10 @@ private: ...@@ -124,15 +124,10 @@ private:
OwnPtr<DOMDataStore> m_domDataStore; OwnPtr<DOMDataStore> m_domDataStore;
friend DOMWrapperWorld* mainThreadNormalWorld(); friend DOMWrapperWorld* mainThreadNormalWorld();
friend DOMWrapperWorld* existingWindowShellWorkaroundWorld();
}; };
DOMWrapperWorld* mainThreadNormalWorld(); DOMWrapperWorld* mainThreadNormalWorld();
// FIXME: this is a workaround for a problem in ScriptController
// Do not use this anywhere else!!
DOMWrapperWorld* existingWindowShellWorkaroundWorld();
} // namespace WebCore } // namespace WebCore
#endif // DOMWrapperWorld_h #endif // DOMWrapperWorld_h
...@@ -231,10 +231,6 @@ V8WindowShell* ScriptController::existingWindowShell(DOMWrapperWorld* world) ...@@ -231,10 +231,6 @@ V8WindowShell* ScriptController::existingWindowShell(DOMWrapperWorld* world)
if (world->isMainWorld()) if (world->isMainWorld())
return m_windowShell->isContextInitialized() ? m_windowShell.get() : 0; 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()); IsolatedWorldMap::iterator iter = m_isolatedWorlds.find(world->worldId());
if (iter == m_isolatedWorlds.end()) if (iter == m_isolatedWorlds.end())
return 0; return 0;
...@@ -258,14 +254,8 @@ V8WindowShell* ScriptController::windowShell(DOMWrapperWorld* world) ...@@ -258,14 +254,8 @@ V8WindowShell* ScriptController::windowShell(DOMWrapperWorld* world)
m_isolatedWorlds.set(world->worldId(), isolatedWorldShell.release()); m_isolatedWorlds.set(world->worldId(), isolatedWorldShell.release());
} }
} }
if (!shell->isContextInitialized() && shell->initializeIfNeeded()) { if (!shell->isContextInitialized() && shell->initializeIfNeeded())
if (world->isMainWorld()) { m_frame->loader().dispatchDidClearWindowObjectInWorld(world);
// FIXME: Remove this if clause. See comment with existingWindowShellWorkaroundWorld().
m_frame->loader().dispatchDidClearWindowObjectInWorld(existingWindowShellWorkaroundWorld());
} else {
m_frame->loader().dispatchDidClearWindowObjectInWorld(world);
}
}
return shell; return shell;
} }
......
...@@ -1439,8 +1439,13 @@ void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds() ...@@ -1439,8 +1439,13 @@ void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds()
Vector<RefPtr<DOMWrapperWorld> > worlds; Vector<RefPtr<DOMWrapperWorld> > worlds;
DOMWrapperWorld::getAllWorlds(worlds); DOMWrapperWorld::getAllWorlds(worlds);
for (size_t i = 0; i < worlds.size(); ++i) for (size_t i = 0; i < worlds.size(); ++i) {
dispatchDidClearWindowObjectInWorld(worlds[i].get()); 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) void FrameLoader::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld* world)
...@@ -1449,11 +1454,6 @@ void FrameLoader::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld* world) ...@@ -1449,11 +1454,6 @@ void FrameLoader::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld* world)
return; return;
m_client->dispatchDidClearWindowObjectInWorld(world); 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 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