WindowProxy* RemoteFrame::windowProxy(DOMWrapperWorld& world) { WindowProxy* windowProxy = m_windowProxyManager->windowProxy(world); ASSERT(windowProxy); windowProxy->initializeIfNeeded(); return windowProxy; }
WindowProxy* ScriptController::windowProxy(DOMWrapperWorld& world) { WindowProxy* windowProxy = m_windowProxyManager->windowProxy(world); if (!windowProxy->isContextInitialized() && windowProxy->initializeIfNeeded() && world.isMainWorld()) frame()->loader().dispatchDidClearWindowObjectInMainWorld(); // FIXME: There are some situations where we can return an uninitialized // context. This is broken. return windowProxy; }
WindowProxy* ScriptController::windowProxy(DOMWrapperWorld& world) { WindowProxy* windowProxy = nullptr; if (world.isMainWorld()) { windowProxy = m_windowProxy.get(); } else { IsolatedWorldMap::iterator iter = m_isolatedWorlds.find(world.worldId()); if (iter != m_isolatedWorlds.end()) { windowProxy = iter->value.get(); } else { OwnPtrWillBeRawPtr<WindowProxy> isolatedWorldWindowProxy = WindowProxy::create(m_frame, world, m_isolate); windowProxy = isolatedWorldWindowProxy.get(); m_isolatedWorlds.set(world.worldId(), isolatedWorldWindowProxy.release()); } } if (!windowProxy->isContextInitialized() && windowProxy->initializeIfNeeded() && world.isMainWorld()) m_frame->loader().dispatchDidClearWindowObjectInMainWorld(); return windowProxy; }