CTTE: DOMWrapperWorlds should be passed around by reference
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Oct 2013 17:03:09 +0000 (17:03 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Oct 2013 17:03:09 +0000 (17:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=122206

Reviewed by Andreas Kling.

../WebCore:

* bindings/js/DOMWrapperWorld.cpp:
(WebCore::DOMWrapperWorld::DOMWrapperWorld):
(WebCore::DOMWrapperWorld::~DOMWrapperWorld):
(WebCore::DOMWrapperWorld::clearWrappers):
(WebCore::normalWorld):
(WebCore::mainThreadNormalWorld):
* bindings/js/DOMWrapperWorld.h:
(WebCore::debuggerWorld):
(WebCore::pluginWorld):
(WebCore::currentWorld):
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::JSCSSStyleDeclaration::getPropertyCSSValue):
* bindings/js/JSCSSValueCustom.cpp:
(WebCore::JSCSSValueOwner::finalize):
* bindings/js/JSDOMBinding.h:
(WebCore::wrapperOwner):
(WebCore::wrapperContext):
(WebCore::getInlineCachedWrapper):
(WebCore::setInlineCachedWrapper):
(WebCore::clearInlineCachedWrapper):
(WebCore::getCachedWrapper):
(WebCore::cacheWrapper):
(WebCore::uncacheWrapper):
(WebCore::jsStringWithCache):
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::JSDOMGlobalObject):
(WebCore::toJSDOMGlobalObject):
* bindings/js/JSDOMGlobalObject.h:
(WebCore::JSDOMGlobalObject::world):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::JSDOMWindowBase):
(WebCore::toJSDOMWindow):
* bindings/js/JSDOMWindowBase.h:
* bindings/js/JSDOMWindowShell.cpp:
(WebCore::JSDOMWindowShell::JSDOMWindowShell):
(WebCore::JSDOMWindowShell::setWindow):
(WebCore::toJSDOMWindowShell):
* bindings/js/JSDOMWindowShell.h:
(WebCore::JSDOMWindowShell::create):
(WebCore::JSDOMWindowShell::world):
* bindings/js/JSErrorHandler.cpp:
(WebCore::JSErrorHandler::JSErrorHandler):
* bindings/js/JSErrorHandler.h:
(WebCore::JSErrorHandler::create):
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::JSEventListener):
(WebCore::JSEventListener::handleEvent):
* bindings/js/JSEventListener.h:
(WebCore::JSEventListener::create):
(WebCore::JSEventListener::isolatedWorld):
* bindings/js/JSInjectedScriptHostCustom.cpp:
(WebCore::getJSListenerFunctions):
* bindings/js/JSLazyEventListener.cpp:
(WebCore::JSLazyEventListener::JSLazyEventListener):
* bindings/js/JSLazyEventListener.h:
* bindings/js/JSMutationCallback.cpp:
(WebCore::JSMutationCallback::JSMutationCallback):
(WebCore::JSMutationCallback::call):
* bindings/js/JSNodeCustom.cpp:
(WebCore::JSNodeOwner::finalize):
* bindings/js/JSPluginElementFunctions.h:
(WebCore::pluginElementCustomGetOwnPropertySlot):
* bindings/js/JSWorkerGlobalScopeBase.cpp:
(WebCore::JSWorkerGlobalScopeBase::JSWorkerGlobalScopeBase):
* bindings/js/ScheduledAction.cpp:
(WebCore::ScheduledAction::create):
(WebCore::ScheduledAction::ScheduledAction):
(WebCore::ScheduledAction::execute):
* bindings/js/ScheduledAction.h:
(WebCore::ScheduledAction::ScheduledAction):
* bindings/js/ScriptCachedFrameData.cpp:
(WebCore::ScriptCachedFrameData::restore):
* bindings/js/ScriptCachedFrameData.h:
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::~ScriptController):
(WebCore::ScriptController::destroyWindowShell):
(WebCore::ScriptController::createWindowShell):
(WebCore::ScriptController::evaluateInWorld):
(WebCore::ScriptController::getAllWorlds):
(WebCore::ScriptController::initScript):
(WebCore::ScriptController::executeScriptInWorld):
(WebCore::ScriptController::shouldBypassMainWorldContentSecurityPolicy):
* bindings/js/ScriptController.h:
(WebCore::ScriptController::windowShell):
(WebCore::ScriptController::existingWindowShell):
(WebCore::ScriptController::globalObject):
* bindings/js/ScriptDebugServer.cpp:
(WebCore::ScriptDebugServer::isContentScript):
* bindings/js/ScriptState.cpp:
(WebCore::execStateFromNode):
(WebCore::execStateFromPage):
* bindings/js/ScriptState.h:
* bindings/js/SerializedScriptValue.cpp:
(WebCore::SerializedScriptValue::transferArrayBuffers):
* bindings/js/WebCoreJSClientData.h:
(WebCore::WebCoreJSClientData::WebCoreJSClientData):
(WebCore::WebCoreJSClientData::normalWorld):
(WebCore::WebCoreJSClientData::getAllWorlds):
(WebCore::WebCoreJSClientData::rememberWorld):
(WebCore::WebCoreJSClientData::forgetWorld):
* bindings/js/WebCoreTypedArrayController.cpp:
(WebCore::WebCoreTypedArrayController::JSArrayBufferOwner::finalize):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateImplementation):
* dom/Document.cpp:
(WebCore::Document::ensurePlugInsInjectedScript):
* dom/Document.h:
* dom/DocumentStyleSheetCollection.cpp:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::ensureIsolatedWorld):
(WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
(WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
* html/HTMLMediaElement.h:
* html/HTMLPlugInImageElement.cpp:
(WebCore::plugInImageElementIsolatedWorld):
(WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
* inspector/InspectorAgent.cpp:
(WebCore::InspectorAgent::didClearWindowObjectInWorld):
* inspector/InspectorAgent.h:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::didClearWindowObjectInWorld):
* inspector/InspectorController.h:
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForEventListener):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didClearWindowObjectInWorldImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didClearWindowObjectInWorld):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::didClearWindowObjectInWorld):
* inspector/InspectorPageAgent.h:
* loader/EmptyClients.h:
(WebCore::EmptyFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::dispatchDidClearWindowObjectsInAllWorlds):
(WebCore::FrameLoader::dispatchDidClearWindowObjectInWorld):
(WebCore::FrameLoader::dispatchGlobalObjectAvailableInAllWorlds):
* loader/FrameLoader.h:
* loader/FrameLoaderClient.h:
(WebCore::FrameLoaderClient::dispatchGlobalObjectAvailable):
* page/CaptionUserPreferencesMediaAF.cpp:
* page/DOMWindowExtension.cpp:
(WebCore::DOMWindowExtension::DOMWindowExtension):
* page/DOMWindowExtension.h:
(WebCore::DOMWindowExtension::create):
(WebCore::DOMWindowExtension::world):
* page/Frame.cpp:
(WebCore::Frame::injectUserScripts):
(WebCore::Frame::injectUserScriptsForWorld):
* page/Frame.h:
* page/PageGroup.cpp:
(WebCore::PageGroup::addUserScriptToWorld):
(WebCore::PageGroup::addUserStyleSheetToWorld):
(WebCore::PageGroup::removeUserScriptFromWorld):
(WebCore::PageGroup::removeUserStyleSheetFromWorld):
(WebCore::PageGroup::removeUserScriptsFromWorld):
(WebCore::PageGroup::removeUserStyleSheetsFromWorld):
* page/PageGroup.h:

../WebKit/efl:

* WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
(DumpRenderTreeSupportEfl::evaluateScriptInIsolatedWorld):
* WebCoreSupport/FrameLoaderClientEfl.cpp:
(WebCore::FrameLoaderClientEfl::dispatchDidClearWindowObjectInWorld):
* WebCoreSupport/FrameLoaderClientEfl.h:

../WebKit/gtk:

* WebCoreSupport/FrameLoaderClientGtk.cpp:
(WebKit::FrameLoaderClient::dispatchDidClearWindowObjectInWorld):
* WebCoreSupport/FrameLoaderClientGtk.h:

../WebKit/mac:

* Plugins/Hosted/NetscapePluginInstanceProxy.mm:
(WebKit::NetscapePluginInstanceProxy::getWindowNPObject):
(WebKit::NetscapePluginInstanceProxy::getPluginElementNPObject):
(WebKit::NetscapePluginInstanceProxy::evaluate):
* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
* WebView/WebFrame.mm:
(-[WebFrame _stringByEvaluatingJavaScriptFromString:withGlobalObject:inScriptWorld:]):
(-[WebFrame _globalContextForScriptWorld:]):
(-[WebFrame jsWrapperForNode:inScriptWorld:]):
* WebView/WebScriptWorld.mm:
(+[WebScriptWorld standardWorld]):
(+[WebScriptWorld findOrCreateWorld:]):
* WebView/WebScriptWorldInternal.h:
* WebView/WebView.mm:
(-[WebView _injectOutlookQuirksScript]):
(+[WebView _addUserScriptToGroup:world:source:url:whitelist:blacklist:injectionTime:injectedFrames:]):
(+[WebView _addUserStyleSheetToGroup:world:source:url:whitelist:blacklist:injectedFrames:]):
(+[WebView _removeUserScriptFromGroup:world:url:]):
(+[WebView _removeUserStyleSheetFromGroup:world:url:]):
(+[WebView _removeUserScriptsFromGroup:world:]):
(+[WebView _removeUserStyleSheetsFromGroup:world:]):

../WebKit/win:

* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
* WebCoreSupport/WebFrameLoaderClient.h:
* WebScriptWorld.cpp:
(WebScriptWorld::standardWorld):
(WebScriptWorld::findOrCreateWorld):
* WebScriptWorld.h:
(WebScriptWorld::world):

../WebKit/wince:

* WebCoreSupport/FrameLoaderClientWinCE.cpp:
(WebKit::FrameLoaderClientWinCE::dispatchDidClearWindowObjectInWorld):
* WebCoreSupport/FrameLoaderClientWinCE.h:

../WebKit2:

* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
(WebKit::InjectedBundlePageLoaderClient::didClearWindowObjectForFrame):
(WebKit::InjectedBundlePageLoaderClient::globalObjectIsAvailableForFrame):
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
* WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
(WebKit::InjectedBundleScriptWorld::getOrCreate):
(WebKit::InjectedBundleScriptWorld::normalWorld):
(WebKit::InjectedBundleScriptWorld::coreWorld):
* WebProcess/InjectedBundle/InjectedBundleScriptWorld.h:
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::windowScriptNPObject):
(WebKit::PluginView::pluginElementNPObject):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
(WebKit::WebFrameLoaderClient::dispatchGlobalObjectAvailable):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156769 268f45cc-cd09-0410-ab3c-d52691b4dbfc

94 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/bindings/js/DOMWrapperWorld.cpp
Source/WebCore/bindings/js/DOMWrapperWorld.h
Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
Source/WebCore/bindings/js/JSCSSValueCustom.cpp
Source/WebCore/bindings/js/JSDOMBinding.h
Source/WebCore/bindings/js/JSDOMGlobalObject.cpp
Source/WebCore/bindings/js/JSDOMGlobalObject.h
Source/WebCore/bindings/js/JSDOMWindowBase.cpp
Source/WebCore/bindings/js/JSDOMWindowBase.h
Source/WebCore/bindings/js/JSDOMWindowShell.cpp
Source/WebCore/bindings/js/JSDOMWindowShell.h
Source/WebCore/bindings/js/JSErrorHandler.cpp
Source/WebCore/bindings/js/JSErrorHandler.h
Source/WebCore/bindings/js/JSEventListener.cpp
Source/WebCore/bindings/js/JSEventListener.h
Source/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
Source/WebCore/bindings/js/JSLazyEventListener.cpp
Source/WebCore/bindings/js/JSLazyEventListener.h
Source/WebCore/bindings/js/JSMutationCallback.cpp
Source/WebCore/bindings/js/JSNodeCustom.cpp
Source/WebCore/bindings/js/JSPluginElementFunctions.h
Source/WebCore/bindings/js/JSWorkerGlobalScopeBase.cpp
Source/WebCore/bindings/js/ScheduledAction.cpp
Source/WebCore/bindings/js/ScheduledAction.h
Source/WebCore/bindings/js/ScriptCachedFrameData.cpp
Source/WebCore/bindings/js/ScriptCachedFrameData.h
Source/WebCore/bindings/js/ScriptController.cpp
Source/WebCore/bindings/js/ScriptController.h
Source/WebCore/bindings/js/ScriptDebugServer.cpp
Source/WebCore/bindings/js/ScriptState.cpp
Source/WebCore/bindings/js/ScriptState.h
Source/WebCore/bindings/js/SerializedScriptValue.cpp
Source/WebCore/bindings/js/WebCoreJSClientData.h
Source/WebCore/bindings/js/WebCoreTypedArrayController.cpp
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/dom/DocumentStyleSheetCollection.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/html/HTMLPlugInImageElement.cpp
Source/WebCore/inspector/InspectorAgent.cpp
Source/WebCore/inspector/InspectorAgent.h
Source/WebCore/inspector/InspectorController.cpp
Source/WebCore/inspector/InspectorController.h
Source/WebCore/inspector/InspectorDOMAgent.cpp
Source/WebCore/inspector/InspectorInstrumentation.cpp
Source/WebCore/inspector/InspectorInstrumentation.h
Source/WebCore/inspector/InspectorPageAgent.cpp
Source/WebCore/inspector/InspectorPageAgent.h
Source/WebCore/loader/EmptyClients.h
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/FrameLoader.h
Source/WebCore/loader/FrameLoaderClient.h
Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp
Source/WebCore/page/DOMWindowExtension.cpp
Source/WebCore/page/DOMWindowExtension.h
Source/WebCore/page/Frame.cpp
Source/WebCore/page/Frame.h
Source/WebCore/page/PageGroup.cpp
Source/WebCore/page/PageGroup.h
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp
Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
Source/WebKit/mac/WebView/WebFrame.mm
Source/WebKit/mac/WebView/WebScriptWorld.mm
Source/WebKit/mac/WebView/WebScriptWorldInternal.h
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
Source/WebKit/win/WebScriptWorld.cpp
Source/WebKit/win/WebScriptWorld.h
Source/WebKit/wince/ChangeLog
Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp
Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleScriptWorld.h
Source/WebKit2/WebProcess/Plugins/PluginView.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h

index 4038a55..334d8f7 100644 (file)
@@ -1,3 +1,170 @@
+2013-10-01  Sam Weinig  <sam@webkit.org>
+
+        CTTE: DOMWrapperWorlds should be passed around by reference
+        https://bugs.webkit.org/show_bug.cgi?id=122206
+
+        Reviewed by Andreas Kling.
+
+        * bindings/js/DOMWrapperWorld.cpp:
+        (WebCore::DOMWrapperWorld::DOMWrapperWorld):
+        (WebCore::DOMWrapperWorld::~DOMWrapperWorld):
+        (WebCore::DOMWrapperWorld::clearWrappers):
+        (WebCore::normalWorld):
+        (WebCore::mainThreadNormalWorld):
+        * bindings/js/DOMWrapperWorld.h:
+        (WebCore::debuggerWorld):
+        (WebCore::pluginWorld):
+        (WebCore::currentWorld):
+        * bindings/js/JSCSSStyleDeclarationCustom.cpp:
+        (WebCore::JSCSSStyleDeclaration::getPropertyCSSValue):
+        * bindings/js/JSCSSValueCustom.cpp:
+        (WebCore::JSCSSValueOwner::finalize):
+        * bindings/js/JSDOMBinding.h:
+        (WebCore::wrapperOwner):
+        (WebCore::wrapperContext):
+        (WebCore::getInlineCachedWrapper):
+        (WebCore::setInlineCachedWrapper):
+        (WebCore::clearInlineCachedWrapper):
+        (WebCore::getCachedWrapper):
+        (WebCore::cacheWrapper):
+        (WebCore::uncacheWrapper):
+        (WebCore::jsStringWithCache):
+        * bindings/js/JSDOMGlobalObject.cpp:
+        (WebCore::JSDOMGlobalObject::JSDOMGlobalObject):
+        (WebCore::toJSDOMGlobalObject):
+        * bindings/js/JSDOMGlobalObject.h:
+        (WebCore::JSDOMGlobalObject::world):
+        * bindings/js/JSDOMWindowBase.cpp:
+        (WebCore::JSDOMWindowBase::JSDOMWindowBase):
+        (WebCore::toJSDOMWindow):
+        * bindings/js/JSDOMWindowBase.h:
+        * bindings/js/JSDOMWindowShell.cpp:
+        (WebCore::JSDOMWindowShell::JSDOMWindowShell):
+        (WebCore::JSDOMWindowShell::setWindow):
+        (WebCore::toJSDOMWindowShell):
+        * bindings/js/JSDOMWindowShell.h:
+        (WebCore::JSDOMWindowShell::create):
+        (WebCore::JSDOMWindowShell::world):
+        * bindings/js/JSErrorHandler.cpp:
+        (WebCore::JSErrorHandler::JSErrorHandler):
+        * bindings/js/JSErrorHandler.h:
+        (WebCore::JSErrorHandler::create):
+        * bindings/js/JSEventListener.cpp:
+        (WebCore::JSEventListener::JSEventListener):
+        (WebCore::JSEventListener::handleEvent):
+        * bindings/js/JSEventListener.h:
+        (WebCore::JSEventListener::create):
+        (WebCore::JSEventListener::isolatedWorld):
+        * bindings/js/JSInjectedScriptHostCustom.cpp:
+        (WebCore::getJSListenerFunctions):
+        * bindings/js/JSLazyEventListener.cpp:
+        (WebCore::JSLazyEventListener::JSLazyEventListener):
+        * bindings/js/JSLazyEventListener.h:
+        * bindings/js/JSMutationCallback.cpp:
+        (WebCore::JSMutationCallback::JSMutationCallback):
+        (WebCore::JSMutationCallback::call):
+        * bindings/js/JSNodeCustom.cpp:
+        (WebCore::JSNodeOwner::finalize):
+        * bindings/js/JSPluginElementFunctions.h:
+        (WebCore::pluginElementCustomGetOwnPropertySlot):
+        * bindings/js/JSWorkerGlobalScopeBase.cpp:
+        (WebCore::JSWorkerGlobalScopeBase::JSWorkerGlobalScopeBase):
+        * bindings/js/ScheduledAction.cpp:
+        (WebCore::ScheduledAction::create):
+        (WebCore::ScheduledAction::ScheduledAction):
+        (WebCore::ScheduledAction::execute):
+        * bindings/js/ScheduledAction.h:
+        (WebCore::ScheduledAction::ScheduledAction):
+        * bindings/js/ScriptCachedFrameData.cpp:
+        (WebCore::ScriptCachedFrameData::restore):
+        * bindings/js/ScriptCachedFrameData.h:
+        * bindings/js/ScriptController.cpp:
+        (WebCore::ScriptController::~ScriptController):
+        (WebCore::ScriptController::destroyWindowShell):
+        (WebCore::ScriptController::createWindowShell):
+        (WebCore::ScriptController::evaluateInWorld):
+        (WebCore::ScriptController::getAllWorlds):
+        (WebCore::ScriptController::initScript):
+        (WebCore::ScriptController::executeScriptInWorld):
+        (WebCore::ScriptController::shouldBypassMainWorldContentSecurityPolicy):
+        * bindings/js/ScriptController.h:
+        (WebCore::ScriptController::windowShell):
+        (WebCore::ScriptController::existingWindowShell):
+        (WebCore::ScriptController::globalObject):
+        * bindings/js/ScriptDebugServer.cpp:
+        (WebCore::ScriptDebugServer::isContentScript):
+        * bindings/js/ScriptState.cpp:
+        (WebCore::execStateFromNode):
+        (WebCore::execStateFromPage):
+        * bindings/js/ScriptState.h:
+        * bindings/js/SerializedScriptValue.cpp:
+        (WebCore::SerializedScriptValue::transferArrayBuffers):
+        * bindings/js/WebCoreJSClientData.h:
+        (WebCore::WebCoreJSClientData::WebCoreJSClientData):
+        (WebCore::WebCoreJSClientData::normalWorld):
+        (WebCore::WebCoreJSClientData::getAllWorlds):
+        (WebCore::WebCoreJSClientData::rememberWorld):
+        (WebCore::WebCoreJSClientData::forgetWorld):
+        * bindings/js/WebCoreTypedArrayController.cpp:
+        (WebCore::WebCoreTypedArrayController::JSArrayBufferOwner::finalize):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateHeader):
+        (GenerateImplementation):
+        * dom/Document.cpp:
+        (WebCore::Document::ensurePlugInsInjectedScript):
+        * dom/Document.h:
+        * dom/DocumentStyleSheetCollection.cpp:
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::ensureIsolatedWorld):
+        (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
+        (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
+        * html/HTMLMediaElement.h:
+        * html/HTMLPlugInImageElement.cpp:
+        (WebCore::plugInImageElementIsolatedWorld):
+        (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
+        * inspector/InspectorAgent.cpp:
+        (WebCore::InspectorAgent::didClearWindowObjectInWorld):
+        * inspector/InspectorAgent.h:
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::didClearWindowObjectInWorld):
+        * inspector/InspectorController.h:
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::buildObjectForEventListener):
+        * inspector/InspectorInstrumentation.cpp:
+        (WebCore::InspectorInstrumentation::didClearWindowObjectInWorldImpl):
+        * inspector/InspectorInstrumentation.h:
+        (WebCore::InspectorInstrumentation::didClearWindowObjectInWorld):
+        * inspector/InspectorPageAgent.cpp:
+        (WebCore::InspectorPageAgent::didClearWindowObjectInWorld):
+        * inspector/InspectorPageAgent.h:
+        * loader/EmptyClients.h:
+        (WebCore::EmptyFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::dispatchDidClearWindowObjectsInAllWorlds):
+        (WebCore::FrameLoader::dispatchDidClearWindowObjectInWorld):
+        (WebCore::FrameLoader::dispatchGlobalObjectAvailableInAllWorlds):
+        * loader/FrameLoader.h:
+        * loader/FrameLoaderClient.h:
+        (WebCore::FrameLoaderClient::dispatchGlobalObjectAvailable):
+        * page/CaptionUserPreferencesMediaAF.cpp:
+        * page/DOMWindowExtension.cpp:
+        (WebCore::DOMWindowExtension::DOMWindowExtension):
+        * page/DOMWindowExtension.h:
+        (WebCore::DOMWindowExtension::create):
+        (WebCore::DOMWindowExtension::world):
+        * page/Frame.cpp:
+        (WebCore::Frame::injectUserScripts):
+        (WebCore::Frame::injectUserScriptsForWorld):
+        * page/Frame.h:
+        * page/PageGroup.cpp:
+        (WebCore::PageGroup::addUserScriptToWorld):
+        (WebCore::PageGroup::addUserStyleSheetToWorld):
+        (WebCore::PageGroup::removeUserScriptFromWorld):
+        (WebCore::PageGroup::removeUserStyleSheetFromWorld):
+        (WebCore::PageGroup::removeUserScriptsFromWorld):
+        (WebCore::PageGroup::removeUserStyleSheetsFromWorld):
+        * page/PageGroup.h:
+
 2013-10-02  Zan Dobersek  <zdobersek@igalia.com>
 
         Unreviewed, removing references to the recently removed Modules/filesystem directory.
index 1a2a1b2..254d284 100644 (file)
@@ -564,13 +564,13 @@ __ZN7WebCore16NavigationActionC1ERKNS_15ResourceRequestENS_13FrameLoadTypeEb
 __ZN7WebCore16NavigationActionC1ERKNS_15ResourceRequestENS_14NavigationTypeE
 __ZN7WebCore16NavigationActionC1Ev
 __ZN7WebCore16ResourceResponse19setCertificateChainEPK9__CFArray
-__ZN7WebCore16ScriptController10initScriptEPNS_15DOMWrapperWorldE
+__ZN7WebCore16ScriptController10initScriptERNS_15DOMWrapperWorldE
 __ZN7WebCore16ScriptController11createWorldEv
 __ZN7WebCore16ScriptController13executeScriptERKN3WTF6StringEb
 __ZN7WebCore16ScriptController17canExecuteScriptsENS_33ReasonForCallingCanExecuteScriptsE
 __ZN7WebCore16ScriptController17javaScriptContextEv
 __ZN7WebCore16ScriptController18windowScriptObjectEv
-__ZN7WebCore16ScriptController20executeScriptInWorldEPNS_15DOMWrapperWorldERKN3WTF6StringEb
+__ZN7WebCore16ScriptController20executeScriptInWorldERNS_15DOMWrapperWorldERKN3WTF6StringEb
 __ZN7WebCore16ScriptController21processingUserGestureEv
 __ZN7WebCore16ScriptController24jsObjectForPluginElementEPNS_17HTMLPlugInElementE
 __ZN7WebCore16ThreadGlobalData10staticDataE
@@ -614,7 +614,7 @@ __ZN7WebCore17languageDidChangeEv
 __ZN7WebCore17openTemporaryFileERKN3WTF6StringERi
 __ZN7WebCore17setCookiesFromDOMERKNS_21NetworkStorageSessionERKNS_3URLES5_RKN3WTF6StringE
 __ZN7WebCore17userVisibleStringEP5NSURL
-__ZN7WebCore18DOMWindowExtensionC1EPNS_5FrameEPNS_15DOMWrapperWorldE
+__ZN7WebCore18DOMWindowExtensionC1EPNS_5FrameERNS_15DOMWrapperWorldE
 __ZN7WebCore18PlatformPasteboard10uniqueNameEv
 __ZN7WebCore18PlatformPasteboard13bufferForTypeERKN3WTF6StringE
 __ZN7WebCore18PlatformPasteboard13stringForTypeERKN3WTF6StringE
@@ -1257,16 +1257,16 @@ __ZN7WebCore9PageGroup16syncLocalStorageEv
 __ZN7WebCore9PageGroup17closeLocalStorageEv
 __ZN7WebCore9PageGroup18addVisitedLinkHashEy
 __ZN7WebCore9PageGroup18numberOfPageGroupsEv
-__ZN7WebCore9PageGroup20addUserScriptToWorldEPNS_15DOMWrapperWorldERKN3WTF6StringERKNS_3URLERKNS3_6VectorIS4_Lm0ENS3_15CrashOnOverflowEEESE_NS_23UserScriptInjectionTimeENS_25UserContentInjectedFramesE
+__ZN7WebCore9PageGroup20addUserScriptToWorldERNS_15DOMWrapperWorldERKN3WTF6StringERKNS_3URLERKNS3_6VectorIS4_Lm0ENS3_15CrashOnOverflowEEESE_NS_23UserScriptInjectionTimeENS_25UserContentInjectedFramesE
 __ZN7WebCore9PageGroup20removeAllUserContentEv
 __ZN7WebCore9PageGroup21removeAllVisitedLinksEv
-__ZN7WebCore9PageGroup24addUserStyleSheetToWorldEPNS_15DOMWrapperWorldERKN3WTF6StringERKNS_3URLERKNS3_6VectorIS4_Lm0ENS3_15CrashOnOverflowEEESE_NS_25UserContentInjectedFramesENS_14UserStyleLevelENS_22UserStyleInjectionTimeE
-__ZN7WebCore9PageGroup25removeUserScriptFromWorldEPNS_15DOMWrapperWorldERKNS_3URLE
-__ZN7WebCore9PageGroup26removeUserScriptsFromWorldEPNS_15DOMWrapperWorldE
+__ZN7WebCore9PageGroup24addUserStyleSheetToWorldERNS_15DOMWrapperWorldERKN3WTF6StringERKNS_3URLERKNS3_6VectorIS4_Lm0ENS3_15CrashOnOverflowEEESE_NS_25UserContentInjectedFramesENS_14UserStyleLevelENS_22UserStyleInjectionTimeE
+__ZN7WebCore9PageGroup25removeUserScriptFromWorldERNS_15DOMWrapperWorldERKNS_3URLE
+__ZN7WebCore9PageGroup26removeUserScriptsFromWorldERNS_15DOMWrapperWorldE
 __ZN7WebCore9PageGroup26setShouldTrackVisitedLinksEb
-__ZN7WebCore9PageGroup29removeUserStyleSheetFromWorldEPNS_15DOMWrapperWorldERKNS_3URLE
+__ZN7WebCore9PageGroup29removeUserStyleSheetFromWorldERNS_15DOMWrapperWorldERKNS_3URLE
 __ZN7WebCore9PageGroup30closeIdleLocalStorageDatabasesEv
-__ZN7WebCore9PageGroup30removeUserStyleSheetsFromWorldEPNS_15DOMWrapperWorldE
+__ZN7WebCore9PageGroup30removeUserStyleSheetsFromWorldERNS_15DOMWrapperWorldE
 __ZN7WebCore9PageGroup9pageGroupERKN3WTF6StringE
 __ZN7WebCore9Scrollbar10mouseMovedERKNS_18PlatformMouseEventE
 __ZN7WebCore9Scrollbar11mouseExitedEv
index b691b87..c25efe2 100644 (file)
@@ -36,18 +36,18 @@ DOMWrapperWorld::DOMWrapperWorld(JSC::VM* vm, bool isNormal)
 {
     VM::ClientData* clientData = m_vm->clientData;
     ASSERT(clientData);
-    static_cast<WebCoreJSClientData*>(clientData)->rememberWorld(this);
+    static_cast<WebCoreJSClientData*>(clientData)->rememberWorld(*this);
 }
 
 DOMWrapperWorld::~DOMWrapperWorld()
 {
     VM::ClientData* clientData = m_vm->clientData;
     ASSERT(clientData);
-    static_cast<WebCoreJSClientData*>(clientData)->forgetWorld(this);
+    static_cast<WebCoreJSClientData*>(clientData)->forgetWorld(*this);
 
     // These items are created lazily.
     while (!m_scriptControllersWithWindowShells.isEmpty())
-        (*m_scriptControllersWithWindowShells.begin())->destroyWindowShell(this);
+        (*m_scriptControllersWithWindowShells.begin())->destroyWindowShell(*this);
 }
 
 void DOMWrapperWorld::clearWrappers()
@@ -57,20 +57,20 @@ void DOMWrapperWorld::clearWrappers()
 
     // These items are created lazily.
     while (!m_scriptControllersWithWindowShells.isEmpty())
-        (*m_scriptControllersWithWindowShells.begin())->destroyWindowShell(this);
+        (*m_scriptControllersWithWindowShells.begin())->destroyWindowShell(*this);
 }
 
-DOMWrapperWorld* normalWorld(JSC::VM& vm)
+DOMWrapperWorld& normalWorld(JSC::VM& vm)
 {
     VM::ClientData* clientData = vm.clientData;
     ASSERT(clientData);
     return static_cast<WebCoreJSClientData*>(clientData)->normalWorld();
 }
 
-DOMWrapperWorld* mainThreadNormalWorld()
+DOMWrapperWorld& mainThreadNormalWorld()
 {
     ASSERT(isMainThread());
-    static DOMWrapperWorld* cachedNormalWorld = normalWorld(*JSDOMWindow::commonVM());
+    static DOMWrapperWorld& cachedNormalWorld = normalWorld(*JSDOMWindow::commonVM());
     return cachedNormalWorld;
 }
 
index 64684ab..b8bc2cf 100644 (file)
@@ -67,12 +67,12 @@ private:
     bool m_isNormal;
 };
 
-DOMWrapperWorld* normalWorld(JSC::VM&);
-DOMWrapperWorld* mainThreadNormalWorld();
-inline DOMWrapperWorld* debuggerWorld() { return mainThreadNormalWorld(); }
-inline DOMWrapperWorld* pluginWorld() { return mainThreadNormalWorld(); }
+DOMWrapperWorld& normalWorld(JSC::VM&);
+DOMWrapperWorld& mainThreadNormalWorld();
+inline DOMWrapperWorld& debuggerWorld() { return mainThreadNormalWorld(); }
+inline DOMWrapperWorld& pluginWorld() { return mainThreadNormalWorld(); }
 
-inline DOMWrapperWorld* currentWorld(JSC::ExecState* exec)
+inline DOMWrapperWorld& currentWorld(JSC::ExecState* exec)
 {
     return JSC::jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->world();
 }
index 3ad5a41..0c93cee 100644 (file)
@@ -371,7 +371,7 @@ JSValue JSCSSStyleDeclaration::getPropertyCSSValue(ExecState* exec)
     if (!cssValue)
         return jsNull();
 
-    currentWorld(exec)->m_cssValueRoots.add(cssValue.get(), root(impl())); // Balanced by JSCSSValueOwner::finalize().
+    currentWorld(exec).m_cssValueRoots.add(cssValue.get(), root(impl())); // Balanced by JSCSSValueOwner::finalize().
     return toJS(exec, globalObject(), WTF::getPtr(cssValue));
 }
 
index 11f50b5..81863e5 100644 (file)
@@ -70,8 +70,8 @@ bool JSCSSValueOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handl
 void JSCSSValueOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
 {
     JSCSSValue* jsCSSValue = jsCast<JSCSSValue*>(handle.get().asCell());
-    DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
-    world->m_cssValueRoots.remove(jsCSSValue->impl());
+    DOMWrapperWorld& world = *static_cast<DOMWrapperWorld*>(context);
+    world.m_cssValueRoots.remove(jsCSSValue->impl());
     uncacheWrapper(world, jsCSSValue->impl(), jsCSSValue);
     jsCSSValue->releaseImpl();
 }
index 0087167..de37b07 100644 (file)
@@ -112,87 +112,87 @@ class DOMStringList;
         return JSC::jsCast<JSC::JSObject*>(asObject(getDOMStructure<WrapperClass>(vm, JSC::jsCast<JSDOMGlobalObject*>(globalObject))->storedPrototype()));
     }
 
-    inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld* world, JSC::ArrayBuffer*)
+    inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld& world, JSC::ArrayBuffer*)
     {
-        return static_cast<WebCoreTypedArrayController*>(world->vm()->m_typedArrayController.get())->wrapperOwner();
+        return static_cast<WebCoreTypedArrayController*>(world.vm()->m_typedArrayController.get())->wrapperOwner();
     }
     
-    inline void* wrapperContext(DOMWrapperWorld* world, JSC::ArrayBuffer*)
+    inline void* wrapperContext(DOMWrapperWorld& world, JSC::ArrayBuffer*)
     {
-        return world;
+        return &world;
     }
 
-    inline JSDOMWrapper* getInlineCachedWrapper(DOMWrapperWorld*, void*) { return 0; }
-    inline bool setInlineCachedWrapper(DOMWrapperWorld*, void*, JSDOMWrapper*, JSC::WeakHandleOwner*, void*) { return false; }
-    inline bool clearInlineCachedWrapper(DOMWrapperWorld*, void*, JSDOMWrapper*) { return false; }
+    inline JSDOMWrapper* getInlineCachedWrapper(DOMWrapperWorld&, void*) { return 0; }
+    inline bool setInlineCachedWrapper(DOMWrapperWorld&, void*, JSDOMWrapper*, JSC::WeakHandleOwner*, void*) { return false; }
+    inline bool clearInlineCachedWrapper(DOMWrapperWorld&, void*, JSDOMWrapper*) { return false; }
 
-    inline JSDOMWrapper* getInlineCachedWrapper(DOMWrapperWorld* world, ScriptWrappable* domObject)
+    inline JSDOMWrapper* getInlineCachedWrapper(DOMWrapperWorld& world, ScriptWrappable* domObject)
     {
-        if (!world->isNormal())
+        if (!world.isNormal())
             return 0;
         return domObject->wrapper();
     }
 
-    inline JSC::JSArrayBuffer* getInlineCachedWrapper(DOMWrapperWorld* world, JSC::ArrayBuffer* buffer)
+    inline JSC::JSArrayBuffer* getInlineCachedWrapper(DOMWrapperWorld& world, JSC::ArrayBuffer* buffer)
     {
-        if (!world->isNormal())
+        if (!world.isNormal())
             return 0;
         return buffer->m_wrapper.get();
     }
 
-    inline bool setInlineCachedWrapper(DOMWrapperWorld* world, ScriptWrappable* domObject, JSDOMWrapper* wrapper, JSC::WeakHandleOwner* wrapperOwner, void* context)
+    inline bool setInlineCachedWrapper(DOMWrapperWorld& world, ScriptWrappable* domObject, JSDOMWrapper* wrapper, JSC::WeakHandleOwner* wrapperOwner, void* context)
     {
-        if (!world->isNormal())
+        if (!world.isNormal())
             return false;
         domObject->setWrapper(wrapper, wrapperOwner, context);
         return true;
     }
 
-    inline bool setInlineCachedWrapper(DOMWrapperWorld* world, JSC::ArrayBuffer* domObject, JSC::JSArrayBuffer* wrapper, JSC::WeakHandleOwner* wrapperOwner, void* context)
+    inline bool setInlineCachedWrapper(DOMWrapperWorld& world, JSC::ArrayBuffer* domObject, JSC::JSArrayBuffer* wrapper, JSC::WeakHandleOwner* wrapperOwner, void* context)
     {
-        if (!world->isNormal())
+        if (!world.isNormal())
             return false;
         domObject->m_wrapper = JSC::Weak<JSC::JSArrayBuffer>(wrapper, wrapperOwner, context);
         return true;
     }
 
-    inline bool clearInlineCachedWrapper(DOMWrapperWorld* world, ScriptWrappable* domObject, JSDOMWrapper* wrapper)
+    inline bool clearInlineCachedWrapper(DOMWrapperWorld& world, ScriptWrappable* domObject, JSDOMWrapper* wrapper)
     {
-        if (!world->isNormal())
+        if (!world.isNormal())
             return false;
         domObject->clearWrapper(wrapper);
         return true;
     }
 
-    inline bool clearInlineCachedWrapper(DOMWrapperWorld* world, JSC::ArrayBuffer* domObject, JSC::JSArrayBuffer* wrapper)
+    inline bool clearInlineCachedWrapper(DOMWrapperWorld& world, JSC::ArrayBuffer* domObject, JSC::JSArrayBuffer* wrapper)
     {
-        if (!world->isNormal())
+        if (!world.isNormal())
             return false;
         weakClear(domObject->m_wrapper, wrapper);
         return true;
     }
 
-    template <typename DOMClass> inline JSC::JSObject* getCachedWrapper(DOMWrapperWorld* world, DOMClass* domObject)
+    template <typename DOMClass> inline JSC::JSObject* getCachedWrapper(DOMWrapperWorld& world, DOMClass* domObject)
     {
         if (JSC::JSObject* wrapper = getInlineCachedWrapper(world, domObject))
             return wrapper;
-        return world->m_wrappers.get(domObject);
+        return world.m_wrappers.get(domObject);
     }
 
-    template <typename DOMClass, typename WrapperClass> inline void cacheWrapper(DOMWrapperWorld* world, DOMClass* domObject, WrapperClass* wrapper)
+    template <typename DOMClass, typename WrapperClass> inline void cacheWrapper(DOMWrapperWorld& world, DOMClass* domObject, WrapperClass* wrapper)
     {
         JSC::WeakHandleOwner* owner = wrapperOwner(world, domObject);
         void* context = wrapperContext(world, domObject);
         if (setInlineCachedWrapper(world, domObject, wrapper, owner, context))
             return;
-        weakAdd(world->m_wrappers, (void*)domObject, JSC::Weak<JSC::JSObject>(wrapper, owner, context));
+        weakAdd(world.m_wrappers, (void*)domObject, JSC::Weak<JSC::JSObject>(wrapper, owner, context));
     }
 
-    template <typename DOMClass, typename WrapperClass> inline void uncacheWrapper(DOMWrapperWorld* world, DOMClass* domObject, WrapperClass* wrapper)
+    template <typename DOMClass, typename WrapperClass> inline void uncacheWrapper(DOMWrapperWorld& world, DOMClass* domObject, WrapperClass* wrapper)
     {
         if (clearInlineCachedWrapper(world, domObject, wrapper))
             return;
-        weakRemove(world->m_wrappers, (void*)domObject, wrapper);
+        weakRemove(world.m_wrappers, (void*)domObject, wrapper);
     }
     
     #define CREATE_DOM_WRAPPER(exec, globalObject, className, object) createWrapper<JS##className>(exec, globalObject, static_cast<className*>(object))
@@ -577,7 +577,7 @@ class DOMStringList;
             }
         }
 
-        JSStringCache& stringCache = currentWorld(exec)->m_stringCache;
+        JSStringCache& stringCache = currentWorld(exec).m_stringCache;
         JSStringCache::AddResult addResult = stringCache.add(stringImpl, nullptr);
         if (addResult.isNewEntry)
             addResult.iterator->value = JSC::jsString(exec, String(stringImpl));
index 35d5309..fcbd143 100644 (file)
@@ -47,6 +47,7 @@ JSDOMGlobalObject::JSDOMGlobalObject(VM& vm, Structure* structure, PassRefPtr<DO
     , m_currentEvent(0)
     , m_world(world)
 {
+    ASSERT(m_world);
 }
 
 void JSDOMGlobalObject::destroy(JSCell* cell)
@@ -124,12 +125,12 @@ JSDOMGlobalObject* toJSDOMGlobalObject(ScriptExecutionContext* scriptExecutionCo
     return 0;
 }
 
-JSDOMGlobalObject* toJSDOMGlobalObject(Document* document, DOMWrapperWorld* world)
+JSDOMGlobalObject* toJSDOMGlobalObject(Document* document, DOMWrapperWorld& world)
 {
     return toJSDOMWindow(document->frame(), world);
 }
 
-JSDOMGlobalObject* toJSDOMGlobalObject(ScriptExecutionContext* scriptExecutionContext, DOMWrapperWorld* world)
+JSDOMGlobalObject* toJSDOMGlobalObject(ScriptExecutionContext* scriptExecutionContext, DOMWrapperWorld& world)
 {
     if (scriptExecutionContext->isDocument())
         return toJSDOMGlobalObject(toDocument(scriptExecutionContext), world);
index a59a0e6..3ff82ac 100644 (file)
@@ -65,10 +65,11 @@ namespace WebCore {
 
         static void visitChildren(JSC::JSCell*, JSC::SlotVisitor&);
 
-        DOMWrapperWorld* world() { return m_world.get(); }
+        DOMWrapperWorld& world() { return *m_world; }
 
     protected:
         static WEBKIT_EXPORTDATA const JSC::ClassInfo s_info;
+
     public:
         static const JSC::ClassInfo* info() { return &s_info; }
 
@@ -100,8 +101,8 @@ namespace WebCore {
     JSDOMGlobalObject* toJSDOMGlobalObject(Document*, JSC::ExecState*);
     JSDOMGlobalObject* toJSDOMGlobalObject(ScriptExecutionContext*, JSC::ExecState*);
 
-    JSDOMGlobalObject* toJSDOMGlobalObject(Document*, DOMWrapperWorld*);
-    JSDOMGlobalObject* toJSDOMGlobalObject(ScriptExecutionContext*, DOMWrapperWorld*);
+    JSDOMGlobalObject* toJSDOMGlobalObject(Document*, DOMWrapperWorld&);
+    JSDOMGlobalObject* toJSDOMGlobalObject(ScriptExecutionContext*, DOMWrapperWorld&);
 
 } // namespace WebCore
 
index 26fec21..c29e6d5 100644 (file)
@@ -54,7 +54,7 @@ const ClassInfo JSDOMWindowBase::s_info = { "Window", &JSDOMGlobalObject::s_info
 const GlobalObjectMethodTable JSDOMWindowBase::s_globalObjectMethodTable = { &shouldAllowAccessFrom, &supportsProfiling, &supportsRichSourceInfo, &shouldInterruptScript, &javaScriptExperimentsEnabled, &queueTaskToEventLoop };
 
 JSDOMWindowBase::JSDOMWindowBase(VM& vm, Structure* structure, PassRefPtr<DOMWindow> window, JSDOMWindowShell* shell)
-    : JSDOMGlobalObject(vm, structure, shell->world(), &s_globalObjectMethodTable)
+    : JSDOMGlobalObject(vm, structure, &shell->world(), &s_globalObjectMethodTable)
     , m_impl(window)
     , m_shell(shell)
 {
@@ -212,7 +212,7 @@ JSValue toJS(ExecState* exec, DOMWindow* domWindow)
     return frame->script().windowShell(currentWorld(exec));
 }
 
-JSDOMWindow* toJSDOMWindow(Frame* frame, DOMWrapperWorld* world)
+JSDOMWindow* toJSDOMWindow(Frame* frame, DOMWrapperWorld& world)
 {
     if (!frame)
         return 0;
index bfa5f0c..8ca50b5 100644 (file)
@@ -85,7 +85,7 @@ namespace WebCore {
     JSC::JSValue toJS(JSC::ExecState*, DOMWindow*);
 
     // Returns JSDOMWindow or 0
-    JSDOMWindow* toJSDOMWindow(Frame*, DOMWrapperWorld*);
+    JSDOMWindow* toJSDOMWindow(Frame*, DOMWrapperWorld&);
     JSDOMWindow* toJSDOMWindow(JSC::JSValue);
 
 } // namespace WebCore
index 7f7da93..5973a27 100644 (file)
@@ -43,9 +43,9 @@ namespace WebCore {
 
 const ClassInfo JSDOMWindowShell::s_info = { "JSDOMWindowShell", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSDOMWindowShell) };
 
-JSDOMWindowShell::JSDOMWindowShell(Structure* structure, DOMWrapperWorld* world)
-    : Base(*world->vm(), structure)
-    , m_world(world)
+JSDOMWindowShell::JSDOMWindowShell(VM& vm, Structure* structure, DOMWrapperWorld& world)
+    : Base(vm, structure)
+    , m_world(&world)
 {
 }
 
@@ -61,11 +61,11 @@ void JSDOMWindowShell::destroy(JSCell* cell)
     static_cast<JSDOMWindowShell*>(cell)->JSDOMWindowShell::~JSDOMWindowShell();
 }
 
-void JSDOMWindowShell::setWindow(JSC::VM& vm, JSDOMWindow* window)
+void JSDOMWindowShell::setWindow(VM& vm, JSDOMWindow* window)
 {
     ASSERT_ARG(window, window);
     setTarget(vm, window);
-    structure()->setGlobalObject(*JSDOMWindow::commonVM(), window);
+    structure()->setGlobalObject(vm, window);
     gcController().garbageCollectSoon();
 }
 
@@ -77,13 +77,15 @@ void JSDOMWindowShell::setWindow(PassRefPtr<DOMWindow> domWindow)
     // Explicitly protect the global object's prototype so it isn't collected
     // when we allocate the global object. (Once the global object is fully
     // constructed, it can mark its own prototype.)
-    Structure* prototypeStructure = JSDOMWindowPrototype::createStructure(*JSDOMWindow::commonVM(), 0, jsNull());
-    Strong<JSDOMWindowPrototype> prototype(*JSDOMWindow::commonVM(), JSDOMWindowPrototype::create(*JSDOMWindow::commonVM(), 0, prototypeStructure));
-
-    Structure* structure = JSDOMWindow::createStructure(*JSDOMWindow::commonVM(), 0, prototype.get());
-    JSDOMWindow* jsDOMWindow = JSDOMWindow::create(*JSDOMWindow::commonVM(), structure, domWindow, this);
-    prototype->structure()->setGlobalObject(*JSDOMWindow::commonVM(), jsDOMWindow);
-    setWindow(*JSDOMWindow::commonVM(), jsDOMWindow);
+    
+    VM& vm = *JSDOMWindow::commonVM();
+    Structure* prototypeStructure = JSDOMWindowPrototype::createStructure(vm, 0, jsNull());
+    Strong<JSDOMWindowPrototype> prototype(vm, JSDOMWindowPrototype::create(vm, 0, prototypeStructure));
+
+    Structure* structure = JSDOMWindow::createStructure(vm, 0, prototype.get());
+    JSDOMWindow* jsDOMWindow = JSDOMWindow::create(vm, structure, domWindow, this);
+    prototype->structure()->setGlobalObject(vm, jsDOMWindow);
+    setWindow(vm, jsDOMWindow);
     ASSERT(jsDOMWindow->globalObject() == jsDOMWindow);
     ASSERT(prototype->globalObject() == jsDOMWindow);
 }
@@ -108,11 +110,11 @@ JSValue toJS(ExecState* exec, Frame* frame)
     return frame->script().windowShell(currentWorld(exec));
 }
 
-JSDOMWindowShell* toJSDOMWindowShell(Frame* frame, DOMWrapperWorld* isolatedWorld)
+JSDOMWindowShell* toJSDOMWindowShell(Frame* frame, DOMWrapperWorld& world)
 {
     if (!frame)
         return 0;
-    return frame->script().windowShell(isolatedWorld);
+    return frame->script().windowShell(world);
 }
 
 } // namespace WebCore
index 896ea7e..86526c5 100644 (file)
@@ -40,7 +40,6 @@ namespace WebCore {
     class JSDOMWindowShell : public JSC::JSProxy {
         typedef JSC::JSProxy Base;
     public:
-        JSDOMWindowShell(PassRefPtr<DOMWindow>, JSC::Structure*, DOMWrapperWorld*);
         static void destroy(JSCell*);
 
         JSDOMWindow* window() const { return JSC::jsCast<JSDOMWindow*>(target()); }
@@ -51,11 +50,10 @@ namespace WebCore {
 
         DOMWindow* impl() const;
 
-        static JSDOMWindowShell* create(PassRefPtr<DOMWindow> window, JSC::Structure* structure, DOMWrapperWorld* world) 
+        static JSDOMWindowShell* create(JSC::VM& vm, PassRefPtr<DOMWindow> window, JSC::Structure* structure, DOMWrapperWorld& world)
         {
-            JSC::Heap& heap = JSDOMWindow::commonVM()->heap;
-            JSDOMWindowShell* shell = new (NotNull, JSC::allocateCell<JSDOMWindowShell>(heap)) JSDOMWindowShell(structure, world);
-            shell->finishCreation(*world->vm(), window);
+            JSDOMWindowShell* shell = new (NotNull, JSC::allocateCell<JSDOMWindowShell>(vm.heap)) JSDOMWindowShell(vm, structure, world);
+            shell->finishCreation(vm, window);
             return shell; 
         }
 
@@ -64,17 +62,17 @@ namespace WebCore {
             return JSC::Structure::create(vm, 0, prototype, JSC::TypeInfo(JSC::ProxyType, StructureFlags), info());
         }
 
-        DOMWrapperWorld* world() { return m_world.get(); }
+        DOMWrapperWorld& world() { return *m_world; }
 
     protected:
-        JSDOMWindowShell(JSC::Structure*, DOMWrapperWorld*);
+        JSDOMWindowShell(JSC::VM&, JSC::Structure*, DOMWrapperWorld&);
         void finishCreation(JSC::VM&, PassRefPtr<DOMWindow>);
 
         RefPtr<DOMWrapperWorld> m_world;
     };
 
     JSC::JSValue toJS(JSC::ExecState*, Frame*);
-    JSDOMWindowShell* toJSDOMWindowShell(Frame*, DOMWrapperWorld*);
+    JSDOMWindowShell* toJSDOMWindowShell(Frame*, DOMWrapperWorld&);
 
 } // namespace WebCore
 
index c6b1139..a50747b 100644 (file)
@@ -45,8 +45,8 @@ using namespace JSC;
 
 namespace WebCore {
 
-JSErrorHandler::JSErrorHandler(JSObject* function, JSObject* wrapper, bool isAttribute, DOMWrapperWorld* isolatedWorld)
-    : JSEventListener(function, wrapper, isAttribute, isolatedWorld)
+JSErrorHandler::JSErrorHandler(JSObject* function, JSObject* wrapper, bool isAttribute, DOMWrapperWorld& world)
+    : JSEventListener(function, wrapper, isAttribute, world)
 {
 }
 
index 957fd81..55d2d53 100644 (file)
@@ -37,15 +37,15 @@ namespace WebCore {
 
 class JSErrorHandler : public JSEventListener {
 public:
-    static PassRefPtr<JSErrorHandler> create(JSC::JSObject* listener, JSC::JSObject* wrapper, bool isAttribute, DOMWrapperWorld* isolatedWorld)
+    static PassRefPtr<JSErrorHandler> create(JSC::JSObject* listener, JSC::JSObject* wrapper, bool isAttribute, DOMWrapperWorld& world)
     {
-        return adoptRef(new JSErrorHandler(listener, wrapper, isAttribute, isolatedWorld));
+        return adoptRef(new JSErrorHandler(listener, wrapper, isAttribute, world));
     }
 
     virtual ~JSErrorHandler();
 
 private:
-    JSErrorHandler(JSC::JSObject* function, JSC::JSObject* wrapper, bool isAttribute, DOMWrapperWorld* isolatedWorld);
+    JSErrorHandler(JSC::JSObject* function, JSC::JSObject* wrapper, bool isAttribute, DOMWrapperWorld&);
     virtual void handleEvent(ScriptExecutionContext*, Event*);
 };
 
index d914e30..d0dd3f5 100644 (file)
@@ -39,11 +39,11 @@ using namespace JSC;
 
 namespace WebCore {
 
-JSEventListener::JSEventListener(JSObject* function, JSObject* wrapper, bool isAttribute, DOMWrapperWorld* isolatedWorld)
+JSEventListener::JSEventListener(JSObject* function, JSObject* wrapper, bool isAttribute, DOMWrapperWorld& isolatedWorld)
     : EventListener(JSEventListenerType)
     , m_wrapper(wrapper)
     , m_isAttribute(isAttribute)
-    , m_isolatedWorld(isolatedWorld)
+    , m_isolatedWorld(&isolatedWorld)
 {
     if (wrapper) {
         JSC::Heap::writeBarrier(wrapper, function);
@@ -88,7 +88,7 @@ void JSEventListener::handleEvent(ScriptExecutionContext* scriptExecutionContext
     if (!jsFunction)
         return;
 
-    JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(scriptExecutionContext, m_isolatedWorld.get());
+    JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(scriptExecutionContext, *m_isolatedWorld);
     if (!globalObject)
         return;
 
index 0e78407..0639c96 100644 (file)
@@ -33,9 +33,9 @@ namespace WebCore {
 
     class JSEventListener : public EventListener {
     public:
-        static PassRefPtr<JSEventListener> create(JSC::JSObject* listener, JSC::JSObject* wrapper, bool isAttribute, DOMWrapperWorld* isolatedWorld)
+        static PassRefPtr<JSEventListener> create(JSC::JSObject* listener, JSC::JSObject* wrapper, bool isAttribute, DOMWrapperWorld& world)
         {
-            return adoptRef(new JSEventListener(listener, wrapper, isAttribute, isolatedWorld));
+            return adoptRef(new JSEventListener(listener, wrapper, isAttribute, world));
         }
 
         static const JSEventListener* cast(const EventListener* listener)
@@ -53,7 +53,7 @@ namespace WebCore {
         bool isAttribute() const { return m_isAttribute; }
 
         JSC::JSObject* jsFunction(ScriptExecutionContext*) const;
-        DOMWrapperWorld* isolatedWorld() const { return m_isolatedWorld.get(); }
+        DOMWrapperWorld& isolatedWorld() const { return *m_isolatedWorld; }
 
         JSC::JSObject* wrapper() const { return m_wrapper.get(); }
         void setWrapper(JSC::VM&, JSC::JSObject* wrapper) const { m_wrapper = JSC::Weak<JSC::JSObject>(wrapper); }
@@ -64,7 +64,7 @@ namespace WebCore {
         virtual bool virtualisAttribute() const;
 
     protected:
-        JSEventListener(JSC::JSObject* function, JSC::JSObject* wrapper, bool isAttribute, DOMWrapperWorld* isolatedWorld);
+        JSEventListener(JSC::JSObject* function, JSC::JSObject* wrapper, bool isAttribute, DOMWrapperWorld&);
         virtual void handleEvent(ScriptExecutionContext*, Event*);
 
     private:
index 1a29c35..cd98de4 100644 (file)
@@ -205,7 +205,7 @@ static JSArray* getJSListenerFunctions(ExecState* exec, Document* document, cons
             continue;
         }
         // Hide listeners from other contexts.
-        if (jsListener->isolatedWorld() != currentWorld(exec))
+        if (&jsListener->isolatedWorld() != &currentWorld(exec))
             continue;
         JSObject* function = jsListener->jsFunction(document);
         if (!function)
index e1f7f2e..01aee7f 100644 (file)
@@ -35,7 +35,7 @@ namespace WebCore {
 
 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, eventListenerCounter, ("JSLazyEventListener"));
 
-JSLazyEventListener::JSLazyEventListener(const String& functionName, const String& eventParameterName, const String& code, ContainerNode* node, const String& sourceURL, const TextPosition& position, JSObject* wrapper, DOMWrapperWorld* isolatedWorld)
+JSLazyEventListener::JSLazyEventListener(const String& functionName, const String& eventParameterName, const String& code, ContainerNode* node, const String& sourceURL, const TextPosition& position, JSObject* wrapper, DOMWrapperWorld& isolatedWorld)
     : JSEventListener(0, wrapper, true, isolatedWorld)
     , m_functionName(functionName)
     , m_eventParameterName(eventParameterName)
index 8a47e3f..b483e37 100644 (file)
@@ -38,7 +38,7 @@ namespace WebCore {
         virtual ~JSLazyEventListener();
 
     private:
-        JSLazyEventListener(const String& functionName, const String& eventParameterName, const String& code, ContainerNode*, const String& sourceURL, const TextPosition&, JSC::JSObject* wrapper, DOMWrapperWorld* isolatedWorld);
+        JSLazyEventListener(const String& functionName, const String& eventParameterName, const String& code, ContainerNode*, const String& sourceURL, const TextPosition&, JSC::JSObject* wrapper, DOMWrapperWorld& isolatedWorld);
 
         virtual JSC::JSObject* initializeJSFunction(ScriptExecutionContext*) const OVERRIDE;
         virtual bool wasCreatedFromMarkup() const OVERRIDE { return true; }
index c388cec..366259a 100644 (file)
@@ -43,7 +43,7 @@ namespace WebCore {
 JSMutationCallback::JSMutationCallback(JSObject* callback, JSDOMGlobalObject* globalObject)
     : ActiveDOMCallback(globalObject->scriptExecutionContext())
     , m_callback(callback)
-    , m_isolatedWorld(globalObject->world())
+    , m_isolatedWorld(&globalObject->world())
 {
 }
 
@@ -76,7 +76,7 @@ void JSMutationCallback::call(const Vector<RefPtr<MutationRecord> >& mutations,
         return;
     ASSERT(context->isDocument());
 
-    JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(context, m_isolatedWorld.get());
+    JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(context, *m_isolatedWorld);
     ExecState* exec = globalObject->globalExec();
 
     JSValue jsObserver = toJS(exec, globalObject, observer);
index 5ece25b..03db487 100644 (file)
@@ -134,7 +134,7 @@ bool JSNodeOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, v
 void JSNodeOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
 {
     JSNode* jsNode = static_cast<JSNode*>(handle.get().asCell());
-    DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
+    DOMWrapperWorld& world = *static_cast<DOMWrapperWorld*>(context);
     uncacheWrapper(world, jsNode->impl(), jsNode);
     jsNode->releaseImpl();
 }
index 15fcbf8..7ad37dc 100644 (file)
@@ -45,7 +45,7 @@ namespace WebCore {
 
     template <class Type, class Base> bool pluginElementCustomGetOwnPropertySlot(JSC::ExecState* exec, JSC::PropertyName propertyName, JSC::PropertySlot& slot, Type* element)
     {
-        if (!element->globalObject()->world()->isNormal()) {
+        if (!element->globalObject()->world().isNormal()) {
             if (JSC::getStaticValueSlot<Type, Base>(exec, *Type::info()->staticPropHashTable, element, propertyName, slot))
                 return true;
 
index ed9fd92..2f97abb 100644 (file)
@@ -50,7 +50,7 @@ const ClassInfo JSWorkerGlobalScopeBase::s_info = { "WorkerGlobalScope", &JSDOMG
 const GlobalObjectMethodTable JSWorkerGlobalScopeBase::s_globalObjectMethodTable = { &allowsAccessFrom, &supportsProfiling, &supportsRichSourceInfo, &shouldInterruptScript, &javaScriptExperimentsEnabled, &queueTaskToEventLoop };
 
 JSWorkerGlobalScopeBase::JSWorkerGlobalScopeBase(JSC::VM& vm, JSC::Structure* structure, PassRefPtr<WorkerGlobalScope> impl)
-    : JSDOMGlobalObject(vm, structure, normalWorld(vm), &s_globalObjectMethodTable)
+    : JSDOMGlobalObject(vm, structure, &normalWorld(vm), &s_globalObjectMethodTable)
     , m_impl(impl)
 {
 }
index 789ebd8..016931f 100644 (file)
@@ -49,7 +49,7 @@ using namespace JSC;
 
 namespace WebCore {
 
-PassOwnPtr<ScheduledAction> ScheduledAction::create(ExecState* exec, DOMWrapperWorld* isolatedWorld, ContentSecurityPolicy* policy)
+PassOwnPtr<ScheduledAction> ScheduledAction::create(ExecState* exec, DOMWrapperWorld& isolatedWorld, ContentSecurityPolicy* policy)
 {
     JSValue v = exec->argument(0);
     CallData callData;
@@ -65,9 +65,9 @@ PassOwnPtr<ScheduledAction> ScheduledAction::create(ExecState* exec, DOMWrapperW
     return adoptPtr(new ScheduledAction(exec, v, isolatedWorld));
 }
 
-ScheduledAction::ScheduledAction(ExecState* exec, JSValue function, DOMWrapperWorld* isolatedWorld)
+ScheduledAction::ScheduledAction(ExecState* exec, JSValue function, DOMWrapperWorld& isolatedWorld)
     : m_function(exec->vm(), function)
-    , m_isolatedWorld(isolatedWorld)
+    , m_isolatedWorld(&isolatedWorld)
 {
     // setTimeout(function, interval, arg0, arg1...).
     // Start at 2 to skip function and interval.
@@ -121,7 +121,7 @@ void ScheduledAction::executeFunctionInContext(JSGlobalObject* globalObject, JSV
 
 void ScheduledAction::execute(Document* document)
 {
-    JSDOMWindow* window = toJSDOMWindow(document->frame(), m_isolatedWorld.get());
+    JSDOMWindow* window = toJSDOMWindow(document->frame(), *m_isolatedWorld);
     if (!window)
         return;
 
@@ -132,7 +132,7 @@ void ScheduledAction::execute(Document* document)
     if (m_function)
         executeFunctionInContext(window, window->shell(), document);
     else
-        frame->script().executeScriptInWorld(m_isolatedWorld.get(), m_code);
+        frame->script().executeScriptInWorld(*m_isolatedWorld, m_code);
 }
 
 #if ENABLE(WORKERS)
index ab02d8b..3ee21bc 100644 (file)
@@ -46,16 +46,16 @@ namespace WebCore {
     class ScheduledAction {
         WTF_MAKE_NONCOPYABLE(ScheduledAction); WTF_MAKE_FAST_ALLOCATED;
     public:
-        static PassOwnPtr<ScheduledAction> create(JSC::ExecState*, DOMWrapperWorld* isolatedWorld, ContentSecurityPolicy*);
+        static PassOwnPtr<ScheduledAction> create(JSC::ExecState*, DOMWrapperWorld& isolatedWorld, ContentSecurityPolicy*);
 
         void execute(ScriptExecutionContext*);
 
     private:
-        ScheduledAction(JSC::ExecState*, JSC::JSValue function, DOMWrapperWorld* isolatedWorld);
-        ScheduledAction(const String& code, DOMWrapperWorld* isolatedWorld)
-            : m_function(*isolatedWorld->vm())
+        ScheduledAction(JSC::ExecState*, JSC::JSValue function, DOMWrapperWorld& isolatedWorld);
+        ScheduledAction(const String& code, DOMWrapperWorld& isolatedWorld)
+            : m_function(*isolatedWorld.vm())
             , m_code(code)
-            , m_isolatedWorld(isolatedWorld)
+            , m_isolatedWorld(&isolatedWorld)
         {
         }
 
index 45580d5..9322196 100644 (file)
@@ -73,10 +73,9 @@ void ScriptCachedFrameData::restore(Frame& frame)
     ScriptController& scriptController = frame.script();
     ScriptController::ShellMap& windowShells = scriptController.m_windowShells;
 
-    ScriptController::ShellMap::iterator windowShellsEnd = windowShells.end();
-    for (ScriptController::ShellMap::iterator iter = windowShells.begin(); iter != windowShellsEnd; ++iter) {
-        DOMWrapperWorld* world = iter->key.get();
-        JSDOMWindowShell* windowShell = iter->value.get();
+    for (auto it = windowShells.begin(), end = windowShells.end(); it != end; ++it) {
+        DOMWrapperWorld* world = it->key.get();
+        JSDOMWindowShell* windowShell = it->value.get();
 
         if (JSDOMWindow* window = m_windows.get(world).get())
             windowShell->setWindow(window->vm(), window);
index f95260e..55b98e3 100644 (file)
 #include <wtf/HashMap.h>
 
 namespace WebCore {
-    class Frame;
-    class JSDOMWindow;
-    class DOMWrapperWorld;
 
-    class ScriptCachedFrameData {
-        WTF_MAKE_NONCOPYABLE(ScriptCachedFrameData); WTF_MAKE_FAST_ALLOCATED;
-        typedef HashMap< RefPtr<DOMWrapperWorld>, JSC::Strong<JSDOMWindow> > JSDOMWindowSet;
+class Frame;
+class JSDOMWindow;
+class DOMWrapperWorld;
 
-    public:
-        ScriptCachedFrameData(Frame&);
-        ~ScriptCachedFrameData();
+class ScriptCachedFrameData {
+    WTF_MAKE_NONCOPYABLE(ScriptCachedFrameData); WTF_MAKE_FAST_ALLOCATED;
+public:
+    ScriptCachedFrameData(Frame&);
+    ~ScriptCachedFrameData();
 
-        void restore(Frame&);
-        void clear();
+    void restore(Frame&);
+    void clear();
 
-    private:
-        JSDOMWindowSet m_windows;
-    };
+private:
+    typedef HashMap<RefPtr<DOMWrapperWorld>, JSC::Strong<JSDOMWindow>> JSDOMWindowSet;
+    JSDOMWindowSet m_windows;
+};
 
 } // namespace WebCore
 
index 84860a9..1cb259f 100644 (file)
@@ -92,30 +92,33 @@ ScriptController::~ScriptController()
     // It's likely that destroying m_windowShells will create a lot of garbage.
     if (!m_windowShells.isEmpty()) {
         while (!m_windowShells.isEmpty())
-            destroyWindowShell(m_windowShells.begin()->key.get());
+            destroyWindowShell(*m_windowShells.begin()->key);
         gcController().garbageCollectSoon();
     }
 }
 
-void ScriptController::destroyWindowShell(DOMWrapperWorld* world)
+void ScriptController::destroyWindowShell(DOMWrapperWorld& world)
 {
-    ASSERT(m_windowShells.contains(world));
-    m_windowShells.remove(world);
-    world->didDestroyWindowShell(this);
+    ASSERT(m_windowShells.contains(&world));
+    m_windowShells.remove(&world);
+    world.didDestroyWindowShell(this);
 }
 
-JSDOMWindowShell* ScriptController::createWindowShell(DOMWrapperWorld* world)
+JSDOMWindowShell* ScriptController::createWindowShell(DOMWrapperWorld& world)
 {
-    ASSERT(!m_windowShells.contains(world));
-    Structure* structure = JSDOMWindowShell::createStructure(*world->vm(), jsNull());
-    Strong<JSDOMWindowShell> windowShell(*world->vm(), JSDOMWindowShell::create(m_frame.document()->domWindow(), structure, world));
+    ASSERT(!m_windowShells.contains(&world));
+
+    VM& vm = *world.vm();
+
+    Structure* structure = JSDOMWindowShell::createStructure(vm, jsNull());
+    Strong<JSDOMWindowShell> windowShell(vm, JSDOMWindowShell::create(vm, m_frame.document()->domWindow(), structure, world));
     Strong<JSDOMWindowShell> windowShell2(windowShell);
-    m_windowShells.add(world, windowShell);
-    world->didCreateWindowShell(this);
+    m_windowShells.add(&world, windowShell);
+    world.didCreateWindowShell(this);
     return windowShell.get();
 }
 
-ScriptValue ScriptController::evaluateInWorld(const ScriptSourceCode& sourceCode, DOMWrapperWorld* world)
+ScriptValue ScriptController::evaluateInWorld(const ScriptSourceCode& sourceCode, DOMWrapperWorld& world)
 {
     const SourceCode& jsSourceCode = sourceCode.jsSourceCode();
     String sourceURL = jsSourceCode.provider()->url();
@@ -164,7 +167,7 @@ PassRefPtr<DOMWrapperWorld> ScriptController::createWorld()
     return DOMWrapperWorld::create(JSDOMWindow::commonVM());
 }
 
-void ScriptController::getAllWorlds(Vector<RefPtr<DOMWrapperWorld> >& worlds)
+void ScriptController::getAllWorlds(Vector<Ref<DOMWrapperWorld>>& worlds)
 {
     static_cast<WebCoreJSClientData*>(JSDOMWindow::commonVM()->clientData)->getAllWorlds(worlds);
 }
@@ -205,11 +208,11 @@ void ScriptController::clearWindowShell(DOMWindow* newDOMWindow, bool goingIntoP
         gcController().garbageCollectSoon();
 }
 
-JSDOMWindowShell* ScriptController::initScript(DOMWrapperWorld* world)
+JSDOMWindowShell* ScriptController::initScript(DOMWrapperWorld& world)
 {
-    ASSERT(!m_windowShells.contains(world));
+    ASSERT(!m_windowShells.contains(&world));
 
-    JSLockHolder lock(world->vm());
+    JSLockHolder lock(world.vm());
 
     JSDOMWindowShell* windowShell = createWindowShell(world);
 
@@ -456,7 +459,7 @@ void ScriptController::clearScriptObjects()
 #endif
 }
 
-ScriptValue ScriptController::executeScriptInWorld(DOMWrapperWorld* world, const String& script, bool forceUserGesture)
+ScriptValue ScriptController::executeScriptInWorld(DOMWrapperWorld& world, const String& script, bool forceUserGesture)
 {
     UserGestureIndicator gestureIndicator(forceUserGesture ? DefinitelyProcessingUserGesture : PossiblyProcessingUserGesture);
     ScriptSourceCode sourceCode(script, m_frame.document()->url());
@@ -472,8 +475,8 @@ bool ScriptController::shouldBypassMainWorldContentSecurityPolicy()
     CallFrame* callFrame = JSDOMWindow::commonVM()->topCallFrame;
     if (!callFrame || callFrame == CallFrame::noCaller()) 
         return false;
-    DOMWrapperWorld* domWrapperWorld = currentWorld(callFrame);
-    if (domWrapperWorld->isNormal())
+    DOMWrapperWorld& domWrapperWorld = currentWorld(callFrame);
+    if (domWrapperWorld.isNormal())
         return false;
     return true;
 }
index 8f063e2..61b795f 100644 (file)
@@ -66,7 +66,7 @@ enum ReasonForCallingCanExecuteScripts {
 
 class ScriptController {
     friend class ScriptCachedFrameData;
-    typedef WTF::HashMap< RefPtr<DOMWrapperWorld>, JSC::Strong<JSDOMWindowShell> > ShellMap;
+    typedef HashMap<RefPtr<DOMWrapperWorld>, JSC::Strong<JSDOMWindowShell>> ShellMap;
 
 public:
     explicit ScriptController(Frame&);
@@ -74,29 +74,29 @@ public:
 
     static PassRefPtr<DOMWrapperWorld> createWorld();
 
-    JSDOMWindowShell* createWindowShell(DOMWrapperWorld*);
-    void destroyWindowShell(DOMWrapperWorld*);
+    JSDOMWindowShell* createWindowShell(DOMWrapperWorld&);
+    void destroyWindowShell(DOMWrapperWorld&);
 
-    JSDOMWindowShell* windowShell(DOMWrapperWorld* world)
+    JSDOMWindowShell* windowShell(DOMWrapperWorld& world)
     {
-        ShellMap::iterator iter = m_windowShells.find(world);
+        ShellMap::iterator iter = m_windowShells.find(&world);
         return (iter != m_windowShells.end()) ? iter->value.get() : initScript(world);
     }
-    JSDOMWindowShell* existingWindowShell(DOMWrapperWorld* world) const
+    JSDOMWindowShell* existingWindowShell(DOMWrapperWorld& world) const
     {
-        ShellMap::const_iterator iter = m_windowShells.find(world);
+        ShellMap::const_iterator iter = m_windowShells.find(&world);
         return (iter != m_windowShells.end()) ? iter->value.get() : 0;
     }
-    JSDOMWindow* globalObject(DOMWrapperWorld* world)
+    JSDOMWindow* globalObject(DOMWrapperWorld& world)
     {
         return windowShell(world)->window();
     }
 
-    static void getAllWorlds(Vector<RefPtr<DOMWrapperWorld> >&);
+    static void getAllWorlds(Vector<Ref<DOMWrapperWorld>>&);
 
     ScriptValue executeScript(const ScriptSourceCode&);
     ScriptValue executeScript(const String& script, bool forceUserGesture = false);
-    ScriptValue executeScriptInWorld(DOMWrapperWorld*, const String& script, bool forceUserGesture = false);
+    ScriptValue executeScriptInWorld(DOMWrapperWorld&, const String& script, bool forceUserGesture = false);
 
     // Returns true if argument is a JavaScript URL.
     bool executeIfJavaScriptURL(const URL&, ShouldReplaceDocumentIfJavaScriptURL shouldReplaceDocumentIfJavaScriptURL = ReplaceDocumentIfJavaScriptURL);
@@ -106,7 +106,7 @@ public:
     static void initializeThreading();
 
     ScriptValue evaluate(const ScriptSourceCode&);
-    ScriptValue evaluateInWorld(const ScriptSourceCode&, DOMWrapperWorld*);
+    ScriptValue evaluateInWorld(const ScriptSourceCode&, DOMWrapperWorld&);
 
     WTF::TextPosition eventHandlerPosition() const;
 
@@ -164,7 +164,7 @@ public:
     bool shouldBypassMainWorldContentSecurityPolicy();
 
 private:
-    JSDOMWindowShell* initScript(DOMWrapperWorld* world);
+    JSDOMWindowShell* initScript(DOMWrapperWorld&);
 
     void disconnectPlatformScriptObjects();
 
index 3b66e0b..8c81408 100644 (file)
@@ -369,7 +369,7 @@ void ScriptDebugServer::dispatchFailedToParseSource(const ListenerSet& listeners
 
 bool ScriptDebugServer::isContentScript(ExecState* exec)
 {
-    return currentWorld(exec) != mainThreadNormalWorld();
+    return &currentWorld(exec) != &mainThreadNormalWorld();
 }
 
 void ScriptDebugServer::detach(JSGlobalObject* globalObject)
index 96bebba..de3b09a 100644 (file)
@@ -73,7 +73,7 @@ JSC::ExecState* mainWorldExecState(Frame* frame)
     return shell->window()->globalExec();
 }
 
-JSC::ExecState* execStateFromNode(DOMWrapperWorld* world, Node* node)
+JSC::ExecState* execStateFromNode(DOMWrapperWorld& world, Node* node)
 {
     if (!node)
         return 0;
@@ -85,7 +85,7 @@ JSC::ExecState* execStateFromNode(DOMWrapperWorld* world, Node* node)
     return frame->script().globalObject(world)->globalExec();
 }
 
-JSC::ExecState* execStateFromPage(DOMWrapperWorld* world, Page* page)
+JSC::ExecState* execStateFromPage(DOMWrapperWorld& world, Page* page)
 {
     return page->mainFrame().script().globalObject(world)->globalExec();
 }
index eec68ae..4f41fda 100644 (file)
@@ -52,13 +52,13 @@ class WorkerGlobalScope;
 // For now, the separation is purely by convention.
 typedef JSC::ExecState ScriptState;
 
-DOMWindow* domWindowFromExecState(ScriptState*);
+DOMWindow* domWindowFromExecState(JSC::ExecState*);
 ScriptExecutionContext* scriptExecutionContextFromExecState(JSC::ExecState*);
 
 JSC::ExecState* mainWorldExecState(Frame*);
 
-JSC::ExecState* execStateFromNode(DOMWrapperWorld*, Node*);
-JSC::ExecState* execStateFromPage(DOMWrapperWorld*, Page*);
+JSC::ExecState* execStateFromNode(DOMWrapperWorld&, Node*);
+JSC::ExecState* execStateFromPage(DOMWrapperWorld&, Page*);
 
 #if ENABLE(WORKERS)
 JSC::ExecState* execStateFromWorkerGlobalScope(WorkerGlobalScope*);
index a77c7cf..2419615 100644 (file)
@@ -1892,7 +1892,7 @@ PassOwnPtr<SerializedScriptValue::ArrayBufferContentsArray> SerializedScriptValu
     }
 
     OwnPtr<ArrayBufferContentsArray> contents = adoptPtr(new ArrayBufferContentsArray(arrayBuffers.size()));
-    Vector<RefPtr<DOMWrapperWorld> > worlds;
+    Vector<Ref<DOMWrapperWorld>> worlds;
     static_cast<WebCoreJSClientData*>(exec->vm().clientData)->getAllWorlds(worlds);
 
     HashSet<JSC::ArrayBuffer*> visited;
index b8367fe..87e95de 100644 (file)
@@ -36,7 +36,10 @@ class WebCoreJSClientData : public JSC::VM::ClientData {
     friend void initNormalWorldClientData(JSC::VM*);
 
 public:
-    WebCoreJSClientData() { }
+    WebCoreJSClientData()
+    {
+    }
+
     virtual ~WebCoreJSClientData()
     {
         ASSERT(m_worldSet.contains(m_normalWorld.get()));
@@ -46,22 +49,27 @@ public:
         ASSERT(m_worldSet.isEmpty());
     }
 
-    DOMWrapperWorld* normalWorld() { return m_normalWorld.get(); }
+    DOMWrapperWorld& normalWorld() { return *m_normalWorld; }
 
-    void getAllWorlds(Vector<RefPtr<DOMWrapperWorld> >& worlds)
+    void getAllWorlds(Vector<Ref<DOMWrapperWorld>>& worlds)
     {
-        copyToVector(m_worldSet, worlds);
+        ASSERT(worlds.isEmpty());
+
+        worlds.reserveInitialCapacity(m_worldSet.size());
+        for (auto it = m_worldSet.begin(), end = m_worldSet.end(); it != end; ++it)
+            worlds.uncheckedAppend(*(*it));
     }
 
-    void rememberWorld(DOMWrapperWorld* world)
+    void rememberWorld(DOMWrapperWorld& world)
     {
-        ASSERT(!m_worldSet.contains(world));
-        m_worldSet.add(world);
+        ASSERT(!m_worldSet.contains(&world));
+        m_worldSet.add(&world);
     }
-    void forgetWorld(DOMWrapperWorld* world)
+
+    void forgetWorld(DOMWrapperWorld& world)
     {
-        ASSERT(m_worldSet.contains(world));
-        m_worldSet.remove(world);
+        ASSERT(m_worldSet.contains(&world));
+        m_worldSet.remove(&world);
     }
 
     DOMObjectHashTableMap hashTableMap;
index 2ad698f..0db3d52 100644 (file)
@@ -59,7 +59,7 @@ void WebCoreTypedArrayController::JSArrayBufferOwner::finalize(JSC::Handle<JSC::
 {
     auto& wrapper = *static_cast<JSC::JSArrayBuffer*>(handle.get().asCell());
     auto& buffer = *wrapper.impl();
-    uncacheWrapper(static_cast<DOMWrapperWorld*>(context), &buffer, &wrapper);
+    uncacheWrapper(*static_cast<DOMWrapperWorld*>(context), &buffer, &wrapper);
     buffer.deref();
 }
 
index b9db6dc..67ad9bd 100644 (file)
@@ -935,15 +935,15 @@ sub GenerateHeader
         push(@headerContent, "    virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);\n");
         push(@headerContent, "};\n");
         push(@headerContent, "\n");
-        push(@headerContent, "inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld*, $implType*)\n");
+        push(@headerContent, "inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, $implType*)\n");
         push(@headerContent, "{\n");
         push(@headerContent, "    DEFINE_STATIC_LOCAL(JS${interfaceName}Owner, js${interfaceName}Owner, ());\n");
         push(@headerContent, "    return &js${interfaceName}Owner;\n");
         push(@headerContent, "}\n");
         push(@headerContent, "\n");
-        push(@headerContent, "inline void* wrapperContext(DOMWrapperWorld* world, $implType*)\n");
+        push(@headerContent, "inline void* wrapperContext(DOMWrapperWorld& world, $implType*)\n");
         push(@headerContent, "{\n");
-        push(@headerContent, "    return world;\n");
+        push(@headerContent, "    return &world;\n");
         push(@headerContent, "}\n");
         push(@headerContent, "\n");
     }
@@ -2627,7 +2627,7 @@ sub GenerateImplementation
         push(@implContent, "void JS${interfaceName}Owner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)\n");
         push(@implContent, "{\n");
         push(@implContent, "    JS${interfaceName}* js${interfaceName} = jsCast<JS${interfaceName}*>(handle.get().asCell());\n");
-        push(@implContent, "    DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);\n");
+        push(@implContent, "    DOMWrapperWorld& world = *static_cast<DOMWrapperWorld*>(context);\n");
         push(@implContent, "    uncacheWrapper(world, js${interfaceName}->impl(), js${interfaceName});\n");
         push(@implContent, "    js${interfaceName}->releaseImpl();\n");
         push(@implContent, "}\n\n");
index ee21032..449c3dc 100644 (file)
@@ -6026,7 +6026,7 @@ void Document::didAssociateFormControlsTimerFired(Timer<Document>* timer)
     m_associatedFormControls.clear();
 }
 
-void Document::ensurePlugInsInjectedScript(DOMWrapperWorld* world)
+void Document::ensurePlugInsInjectedScript(DOMWrapperWorld& world)
 {
     if (m_hasInjectedPlugInsScript)
         return;
index aa7bedf..154faf5 100644 (file)
@@ -112,7 +112,6 @@ class IntPoint;
 class LayoutPoint;
 class LayoutRect;
 class LiveNodeListBase;
-class DOMWrapperWorld;
 class JSNode;
 class Locale;
 class MediaCanStartListener;
@@ -1182,7 +1181,7 @@ public:
     PassRefPtr<FontLoader> fontloader();
 #endif
 
-    void ensurePlugInsInjectedScript(DOMWrapperWorld*);
+    void ensurePlugInsInjectedScript(DOMWrapperWorld&);
 
     void setVisualUpdatesAllowedByClient(bool);
 
index 570ab25..a096dad 100644 (file)
@@ -29,7 +29,6 @@
 #include "DocumentStyleSheetCollection.h"
 
 #include "CSSStyleSheet.h"
-#include "DOMWrapperWorld.h"
 #include "Document.h"
 #include "Element.h"
 #include "HTMLIFrameElement.h"
index fa554ef..ad79d8c 100644 (file)
@@ -5164,11 +5164,11 @@ void HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture()
 }
 
 #if ENABLE(MEDIA_CONTROLS_SCRIPT)
-DOMWrapperWorld* HTMLMediaElement::ensureIsolatedWorld()
+DOMWrapperWorld& HTMLMediaElement::ensureIsolatedWorld()
 {
     if (!m_isolatedWorld)
         m_isolatedWorld = DOMWrapperWorld::create(JSDOMWindow::commonVM());
-    return m_isolatedWorld.get();
+    return *m_isolatedWorld;
 }
 
 bool HTMLMediaElement::ensureMediaControlsInjectedScript()
@@ -5181,7 +5181,7 @@ bool HTMLMediaElement::ensureMediaControlsInjectedScript()
     if (!mediaControlsScript.length())
         return false;
 
-    DOMWrapperWorld* world = ensureIsolatedWorld();
+    DOMWrapperWorld& world = ensureIsolatedWorld();
     ScriptController& scriptController = page->mainFrame().script();
     JSDOMGlobalObject* globalObject = JSC::jsCast<JSDOMGlobalObject*>(scriptController.globalObject(world));
     JSC::ExecState* exec = globalObject->globalExec();
@@ -5205,9 +5205,7 @@ void HTMLMediaElement::didAddUserAgentShadowRoot(ShadowRoot* root)
     if (!page)
         return;
 
-    DOMWrapperWorld* world = ensureIsolatedWorld();
-    if (!world)
-        return;
+    DOMWrapperWorld& world = ensureIsolatedWorld();
 
     if (!ensureMediaControlsInjectedScript())
         return;
index 77360b3..6ea51d9 100644 (file)
@@ -627,7 +627,7 @@ private:
 
 #if ENABLE(MEDIA_CONTROLS_SCRIPT)
     virtual void didAddUserAgentShadowRoot(ShadowRoot*) OVERRIDE;
-    DOMWrapperWorld* ensureIsolatedWorld();
+    DOMWrapperWorld& ensureIsolatedWorld();
     bool ensureMediaControlsInjectedScript();
 #endif
 
index 9c2813b..b0bd8b5 100644 (file)
@@ -356,6 +356,12 @@ void HTMLPlugInImageElement::checkSnapshotStatus()
     ensureUserAgentShadowRoot().dispatchEvent(Event::create(eventNames().resizeEvent, true, false));
 }
 
+static DOMWrapperWorld& plugInImageElementIsolatedWorld()
+{
+    static DOMWrapperWorld& isolatedWorld = *DOMWrapperWorld::create(JSDOMWindow::commonVM()).leakRef();
+    return isolatedWorld;
+}
+
 void HTMLPlugInImageElement::didAddUserAgentShadowRoot(ShadowRoot* root)
 {
     Page* page = document().page();
@@ -369,7 +375,7 @@ void HTMLPlugInImageElement::didAddUserAgentShadowRoot(ShadowRoot* root)
     
     String mimeType = loadedMimeType();
 
-    static DOMWrapperWorld* isolatedWorld = DOMWrapperWorld::create(JSDOMWindow::commonVM()).leakRef();
+    DOMWrapperWorld& isolatedWorld = plugInImageElementIsolatedWorld();
     document().ensurePlugInsInjectedScript(isolatedWorld);
 
     ScriptController& scriptController = page->mainFrame().script();
index 8ec55fd..d409a97 100644 (file)
@@ -77,9 +77,9 @@ InspectorAgent::~InspectorAgent()
     m_instrumentingAgents->setInspectorAgent(0);
 }
 
-void InspectorAgent::didClearWindowObjectInWorld(Frame* frame, DOMWrapperWorld* world)
+void InspectorAgent::didClearWindowObjectInWorld(Frame* frame, DOMWrapperWorld& world)
 {
-    if (world != mainThreadNormalWorld())
+    if (&world != &mainThreadNormalWorld())
         return;
 
     if (m_injectedScriptForOrigin.isEmpty())
index 6d492b2..b8a3567 100644 (file)
@@ -75,7 +75,7 @@ public:
     virtual void setFrontend(InspectorFrontend*);
     virtual void clearFrontend();
 
-    void didClearWindowObjectInWorld(Frame*, DOMWrapperWorld*);
+    void didClearWindowObjectInWorld(Frame*, DOMWrapperWorld&);
 
     void didCommitLoad();
     void domContentLoadedEventFired();
index 6f87e96..0066139 100644 (file)
@@ -211,9 +211,9 @@ bool InspectorController::hasInspectorFrontendClient() const
     return m_inspectorFrontendClient;
 }
 
-void InspectorController::didClearWindowObjectInWorld(Frame* frame, DOMWrapperWorld* world)
+void InspectorController::didClearWindowObjectInWorld(Frame* frame, DOMWrapperWorld& world)
 {
-    if (world != mainThreadNormalWorld())
+    if (&world != &mainThreadNormalWorld())
         return;
 
     // If the page is supposed to serve as InspectorFrontend notify inspector frontend
index d827ca1..3f10b77 100644 (file)
@@ -88,7 +88,7 @@ public:
 
     void setInspectorFrontendClient(PassOwnPtr<InspectorFrontendClient>);
     bool hasInspectorFrontendClient() const;
-    void didClearWindowObjectInWorld(Frame*, DOMWrapperWorld*);
+    void didClearWindowObjectInWorld(Frame*, DOMWrapperWorld&);
     void setInjectedScriptForOrigin(const String& origin, const String& source);
 
     void dispatchMessageFromFrontend(const String& message);
index 715c36b..1c663a1 100644 (file)
@@ -1488,7 +1488,7 @@ PassRefPtr<TypeBuilder::DOM::EventListener> InspectorDOMAgent::buildObjectForEve
     String scriptId;
     String sourceName;
     if (auto scriptListener = JSEventListener::cast(eventListener.get())) {
-        JSC::JSLockHolder lock(scriptListener->isolatedWorld()->vm());
+        JSC::JSLockHolder lock(scriptListener->isolatedWorld().vm());
         state = execStateFromNode(scriptListener->isolatedWorld(), &node->document());
         handler = scriptListener->jsFunction(&node->document());
         if (handler) {
index 11bd583..735bb06 100644 (file)
@@ -153,7 +153,7 @@ InspectorInstrumentationCookie::~InspectorInstrumentationCookie()
 {
 }
 
-void InspectorInstrumentation::didClearWindowObjectInWorldImpl(InstrumentingAgents* instrumentingAgents, Frame* frame, DOMWrapperWorld* world)
+void InspectorInstrumentation::didClearWindowObjectInWorldImpl(InstrumentingAgents* instrumentingAgents, Frame* frame, DOMWrapperWorld& world)
 {
     InspectorPageAgent* pageAgent = instrumentingAgents->inspectorPageAgent();
     if (pageAgent)
@@ -162,12 +162,12 @@ void InspectorInstrumentation::didClearWindowObjectInWorldImpl(InstrumentingAgen
         inspectorAgent->didClearWindowObjectInWorld(frame, world);
 #if ENABLE(JAVASCRIPT_DEBUGGER)
     if (PageDebuggerAgent* debuggerAgent = instrumentingAgents->pageDebuggerAgent()) {
-        if (pageAgent && world == mainThreadNormalWorld() && frame == pageAgent->mainFrame())
+        if (pageAgent && &world == &mainThreadNormalWorld() && frame == pageAgent->mainFrame())
             debuggerAgent->didClearMainFrameWindowObject();
     }
 #endif
     if (PageRuntimeAgent* pageRuntimeAgent = instrumentingAgents->pageRuntimeAgent()) {
-        if (world == mainThreadNormalWorld())
+        if (&world == &mainThreadNormalWorld())
             pageRuntimeAgent->didCreateMainWorldContext(frame);
     }
 }
index df3ea28..2d6b485 100644 (file)
@@ -115,7 +115,7 @@ private:
 
 class InspectorInstrumentation {
 public:
-    static void didClearWindowObjectInWorld(Frame*, DOMWrapperWorld*);
+    static void didClearWindowObjectInWorld(Frame*, DOMWrapperWorld&);
     static bool isDebuggerPaused(Frame*);
 
     static void willInsertDOMNode(Document*, Node* parent);
@@ -319,7 +319,7 @@ public:
 
 private:
 #if ENABLE(INSPECTOR)
-    static void didClearWindowObjectInWorldImpl(InstrumentingAgents*, Frame*, DOMWrapperWorld*);
+    static void didClearWindowObjectInWorldImpl(InstrumentingAgents*, Frame*, DOMWrapperWorld&);
     static bool isDebuggerPausedImpl(InstrumentingAgents*);
 
     static void willInsertDOMNodeImpl(InstrumentingAgents*, Node* parent);
@@ -512,7 +512,7 @@ private:
 #endif
 };
 
-inline void InspectorInstrumentation::didClearWindowObjectInWorld(Frame* frame, DOMWrapperWorld* world)
+inline void InspectorInstrumentation::didClearWindowObjectInWorld(Frame* frame, DOMWrapperWorld& world)
 {
 #if ENABLE(INSPECTOR)
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
index 49a7a9d..a9a493b 100644 (file)
@@ -868,9 +868,9 @@ void InspectorPageAgent::setScriptExecutionDisabled(ErrorString*, bool value)
     m_ignoreScriptsEnabledNotification = false;
 }
 
-void InspectorPageAgent::didClearWindowObjectInWorld(Frame* frame, DOMWrapperWorld* world)
+void InspectorPageAgent::didClearWindowObjectInWorld(Frame* frame, DOMWrapperWorld& world)
 {
-    if (world != mainThreadNormalWorld())
+    if (&world != &mainThreadNormalWorld())
         return;
 
     if (frame->isMainFrame())
index 2b02ec7..3cb954b 100644 (file)
@@ -141,7 +141,7 @@ public:
     DeviceOrientationData* overrideDeviceOrientation(DeviceOrientationData*);
 
     // InspectorInstrumentation API
-    void didClearWindowObjectInWorld(Frame*, DOMWrapperWorld*);
+    void didClearWindowObjectInWorld(Frame*, DOMWrapperWorld&);
     void domContentEventFired();
     void loadEventFired();
     void frameNavigated(DocumentLoader*);
index 33b2b91..23417a9 100644 (file)
@@ -354,7 +354,7 @@ public:
     virtual String overrideMediaType() const { return String(); }
 
     virtual void redirectDataToPlugin(Widget*) { }
-    virtual void dispatchDidClearWindowObjectInWorld(DOMWrapperWorld*) { }
+    virtual void dispatchDidClearWindowObjectInWorld(DOMWrapperWorld&) { }
     virtual void documentElementAvailable() { }
     virtual void didPerformFirstNavigation() const { }
 
index 729fcae..e440965 100644 (file)
@@ -3248,13 +3248,13 @@ void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds()
     if (!m_frame.script().canExecuteScripts(NotAboutToExecuteScript))
         return;
 
-    Vector<RefPtr<DOMWrapperWorld> > worlds;
+    Vector<Ref<DOMWrapperWorld>> worlds;
     ScriptController::getAllWorlds(worlds);
     for (size_t i = 0; i < worlds.size(); ++i)
         dispatchDidClearWindowObjectInWorld(worlds[i].get());
 }
 
-void FrameLoader::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld* world)
+void FrameLoader::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld& world)
 {
     if (!m_frame.script().canExecuteScripts(NotAboutToExecuteScript) || !m_frame.script().existingWindowShell(world))
         return;
@@ -3271,7 +3271,7 @@ void FrameLoader::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld* world)
 
 void FrameLoader::dispatchGlobalObjectAvailableInAllWorlds()
 {
-    Vector<RefPtr<DOMWrapperWorld> > worlds;
+    Vector<Ref<DOMWrapperWorld>> worlds;
     ScriptController::getAllWorlds(worlds);
     for (size_t i = 0; i < worlds.size(); ++i)
         m_client.dispatchGlobalObjectAvailable(worlds[i].get());
index 08539b9..2ef8124 100644 (file)
@@ -209,7 +209,7 @@ public:
     void handledOnloadEvents();
     String userAgent(const URL&) const;
 
-    void dispatchDidClearWindowObjectInWorld(DOMWrapperWorld*);
+    void dispatchDidClearWindowObjectInWorld(DOMWrapperWorld&);
     void dispatchDidClearWindowObjectsInAllWorlds();
     void dispatchDocumentElementAvailable();
 
index dc7d9e9..e15b796 100644 (file)
@@ -275,7 +275,7 @@ namespace WebCore {
         virtual ObjectContentType objectContentType(const URL&, const String& mimeType, bool shouldPreferPlugInsForImages) = 0;
         virtual String overrideMediaType() const = 0;
 
-        virtual void dispatchDidClearWindowObjectInWorld(DOMWrapperWorld*) = 0;
+        virtual void dispatchDidClearWindowObjectInWorld(DOMWrapperWorld&) = 0;
         virtual void documentElementAvailable() = 0;
         virtual void didPerformFirstNavigation() const = 0; // "Navigation" here means a transition from one page to another that ends up in the back/forward list.
 
@@ -328,7 +328,7 @@ namespace WebCore {
 
         virtual void dispatchWillOpenSocketStream(SocketStreamHandle*) { }
 
-        virtual void dispatchGlobalObjectAvailable(DOMWrapperWorld*) { }
+        virtual void dispatchGlobalObjectAvailable(DOMWrapperWorld&) { }
         virtual void dispatchWillDisconnectDOMWindowExtensionFromGlobalObject(DOMWindowExtension*) { }
         virtual void dispatchDidReconnectDOMWindowExtensionToGlobalObject(DOMWindowExtension*) { }
         virtual void dispatchWillDestroyGlobalObjectForDOMWindowExtension(DOMWindowExtension*) { }
index 67c0f8d..e54fe8c 100644 (file)
@@ -32,7 +32,6 @@
 #if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
 #include "CoreText/CoreText.h"
 #endif
-#include "DOMWrapperWorld.h"
 #include "FloatConversion.h"
 #include "HTMLMediaElement.h"
 #include "URL.h"
index 32bf04f..cdfe9aa 100644 (file)
 
 namespace WebCore {
 
-DOMWindowExtension::DOMWindowExtension(Frame* frame, DOMWrapperWorld* world)
+DOMWindowExtension::DOMWindowExtension(Frame* frame, DOMWrapperWorld& world)
     : DOMWindowProperty(frame)
-    , m_world(world)
+    , m_world(&world)
     , m_wasDetached(false)
 {
     ASSERT(this->frame());
-    ASSERT(m_world);
 }
 
 void DOMWindowExtension::disconnectFrameForPageCache()
index 53b873c..a0bc544 100644 (file)
@@ -39,7 +39,7 @@ class Frame;
 
 class DOMWindowExtension : public RefCounted<DOMWindowExtension>, public DOMWindowProperty {
 public:
-    static PassRefPtr<DOMWindowExtension> create(Frame* frame, DOMWrapperWorld* world)
+    static PassRefPtr<DOMWindowExtension> create(Frame* frame, DOMWrapperWorld& world)
     {
         return adoptRef(new DOMWindowExtension(frame, world));
     }
@@ -50,10 +50,10 @@ public:
     virtual void willDestroyGlobalObjectInFrame() OVERRIDE;
     virtual void willDetachGlobalObjectFromFrame() OVERRIDE;
 
-    DOMWrapperWorld* world() const { return m_world.get(); }
+    DOMWrapperWorld& world() const { return *m_world; }
 
 private:
-    DOMWindowExtension(Frame*, DOMWrapperWorld*);
+    DOMWindowExtension(Frame*, DOMWrapperWorld&);
 
     RefPtr<DOMWrapperWorld> m_world;
     RefPtr<Frame> m_disconnectedFrame;
index e5b3c73..2fb73c9 100644 (file)
@@ -537,10 +537,10 @@ void Frame::injectUserScripts(UserScriptInjectionTime injectionTime)
         return;
 
     for (auto it = userScripts->begin(), end = userScripts->end(); it != end; ++it)
-        injectUserScriptsForWorld(it->key.get(), *it->value, injectionTime);
+        injectUserScriptsForWorld(*it->key.get(), *it->value, injectionTime);
 }
 
-void Frame::injectUserScriptsForWorld(DOMWrapperWorld* world, const UserScriptVector& userScripts, UserScriptInjectionTime injectionTime)
+void Frame::injectUserScriptsForWorld(DOMWrapperWorld& world, const UserScriptVector& userScripts, UserScriptInjectionTime injectionTime)
 {
     if (userScripts.isEmpty())
         return;
index 5ab795b..b8b806a 100644 (file)
@@ -205,7 +205,7 @@ namespace WebCore {
         Frame(Page&, HTMLFrameOwnerElement*, FrameLoaderClient&);
 
     private:
-        void injectUserScriptsForWorld(DOMWrapperWorld*, const UserScriptVector&, UserScriptInjectionTime);
+        void injectUserScriptsForWorld(DOMWrapperWorld&, const UserScriptVector&, UserScriptInjectionTime);
 
         HashSet<FrameDestructionObserver*> m_destructionObservers;
 
index 0747c59..a6aa775 100644 (file)
@@ -260,33 +260,23 @@ StorageNamespace* PageGroup::transientLocalStorage(SecurityOrigin* topOrigin)
     return result.iterator->value.get();
 }
 
-void PageGroup::addUserScriptToWorld(DOMWrapperWorld* world, const String& source, const URL& url,
-                                     const Vector<String>& whitelist, const Vector<String>& blacklist,
-                                     UserScriptInjectionTime injectionTime, UserContentInjectedFrames injectedFrames)
+void PageGroup::addUserScriptToWorld(DOMWrapperWorld& world, const String& source, const URL& url, const Vector<String>& whitelist, const Vector<String>& blacklist, UserScriptInjectionTime injectionTime, UserContentInjectedFrames injectedFrames)
 {
-    ASSERT_ARG(world, world);
-
     auto userScript = std::make_unique<UserScript>(source, url, whitelist, blacklist, injectionTime, injectedFrames);
     if (!m_userScripts)
         m_userScripts = std::make_unique<UserScriptMap>();
-    std::unique_ptr<UserScriptVector>& scriptsInWorld = m_userScripts->add(world, nullptr).iterator->value;
+    std::unique_ptr<UserScriptVector>& scriptsInWorld = m_userScripts->add(&world, nullptr).iterator->value;
     if (!scriptsInWorld)
         scriptsInWorld = std::make_unique<UserScriptVector>();
     scriptsInWorld->append(std::move(userScript));
 }
 
-void PageGroup::addUserStyleSheetToWorld(DOMWrapperWorld* world, const String& source, const URL& url,
-                                         const Vector<String>& whitelist, const Vector<String>& blacklist,
-                                         UserContentInjectedFrames injectedFrames,
-                                         UserStyleLevel level,
-                                         UserStyleInjectionTime injectionTime)
+void PageGroup::addUserStyleSheetToWorld(DOMWrapperWorld& world, const String& source, const URL& url, const Vector<String>& whitelist, const Vector<String>& blacklist, UserContentInjectedFrames injectedFrames, UserStyleLevel level, UserStyleInjectionTime injectionTime)
 {
-    ASSERT_ARG(world, world);
-
     auto userStyleSheet = std::make_unique<UserStyleSheet>(source, url, whitelist, blacklist, injectedFrames, level);
     if (!m_userStyleSheets)
         m_userStyleSheets = std::make_unique<UserStyleSheetMap>();
-    std::unique_ptr<UserStyleSheetVector>& styleSheetsInWorld = m_userStyleSheets->add(world, nullptr).iterator->value;
+    std::unique_ptr<UserStyleSheetVector>& styleSheetsInWorld = m_userStyleSheets->add(&world, nullptr).iterator->value;
     if (!styleSheetsInWorld)
         styleSheetsInWorld = std::make_unique<UserStyleSheetVector>();
     styleSheetsInWorld->append(std::move(userStyleSheet));
@@ -295,14 +285,12 @@ void PageGroup::addUserStyleSheetToWorld(DOMWrapperWorld* world, const String& s
         invalidateInjectedStyleSheetCacheInAllFrames();
 }
 
-void PageGroup::removeUserScriptFromWorld(DOMWrapperWorld* world, const URL& url)
+void PageGroup::removeUserScriptFromWorld(DOMWrapperWorld& world, const URL& url)
 {
-    ASSERT_ARG(world, world);
-
     if (!m_userScripts)
         return;
 
-    auto it = m_userScripts->find(world);
+    auto it = m_userScripts->find(&world);
     if (it == m_userScripts->end())
         return;
     
@@ -316,14 +304,12 @@ void PageGroup::removeUserScriptFromWorld(DOMWrapperWorld* world, const URL& url
         m_userScripts->remove(it);
 }
 
-void PageGroup::removeUserStyleSheetFromWorld(DOMWrapperWorld* world, const URL& url)
+void PageGroup::removeUserStyleSheetFromWorld(DOMWrapperWorld& world, const URL& url)
 {
-    ASSERT_ARG(world, world);
-
     if (!m_userStyleSheets)
         return;
 
-    auto it = m_userStyleSheets->find(world);
+    auto it = m_userStyleSheets->find(&world);
     bool sheetsChanged = false;
     if (it == m_userStyleSheets->end())
         return;
@@ -345,24 +331,20 @@ void PageGroup::removeUserStyleSheetFromWorld(DOMWrapperWorld* world, const URL&
     invalidateInjectedStyleSheetCacheInAllFrames();
 }
 
-void PageGroup::removeUserScriptsFromWorld(DOMWrapperWorld* world)
+void PageGroup::removeUserScriptsFromWorld(DOMWrapperWorld& world)
 {
-    ASSERT_ARG(world, world);
-
     if (!m_userScripts)
         return;
 
-    m_userScripts->remove(world);
+    m_userScripts->remove(&world);
 }
 
-void PageGroup::removeUserStyleSheetsFromWorld(DOMWrapperWorld* world)
+void PageGroup::removeUserStyleSheetsFromWorld(DOMWrapperWorld& world)
 {
-    ASSERT_ARG(world, world);
-
     if (!m_userStyleSheets)
         return;
 
-    if (!m_userStyleSheets->remove(world))
+    if (!m_userStyleSheets->remove(&world))
         return;
 
     invalidateInjectedStyleSheetCacheInAllFrames();
index e68316a..cfbc0ed 100644 (file)
@@ -90,20 +90,12 @@ namespace WebCore {
 
         StorageNamespace* transientLocalStorage(SecurityOrigin* topOrigin);
 
-        void addUserScriptToWorld(DOMWrapperWorld*, const String& source, const URL&,
-                                  const Vector<String>& whitelist, const Vector<String>& blacklist,
-                                  UserScriptInjectionTime, UserContentInjectedFrames);
-        void addUserStyleSheetToWorld(DOMWrapperWorld*, const String& source, const URL&,
-                                      const Vector<String>& whitelist, const Vector<String>& blacklist,
-                                      UserContentInjectedFrames,
-                                      UserStyleLevel level = UserStyleUserLevel,
-                                      UserStyleInjectionTime injectionTime = InjectInExistingDocuments);
-        void removeUserScriptFromWorld(DOMWrapperWorld*, const URL&);
-        void removeUserStyleSheetFromWorld(DOMWrapperWorld*, const URL&);
-
-        void removeUserScriptsFromWorld(DOMWrapperWorld*);
-        void removeUserStyleSheetsFromWorld(DOMWrapperWorld*);
-
+        void addUserScriptToWorld(DOMWrapperWorld&, const String& source, const URL&, const Vector<String>& whitelist, const Vector<String>& blacklist, UserScriptInjectionTime, UserContentInjectedFrames);
+        void addUserStyleSheetToWorld(DOMWrapperWorld&, const String& source, const URL&, const Vector<String>& whitelist, const Vector<String>& blacklist, UserContentInjectedFrames, UserStyleLevel = UserStyleUserLevel, UserStyleInjectionTime = InjectInExistingDocuments);
+        void removeUserScriptFromWorld(DOMWrapperWorld&, const URL&);
+        void removeUserStyleSheetFromWorld(DOMWrapperWorld&, const URL&);
+        void removeUserScriptsFromWorld(DOMWrapperWorld&);
+        void removeUserStyleSheetsFromWorld(DOMWrapperWorld&);
         void removeAllUserContent();
 
         const UserScriptMap* userScripts() const { return m_userScripts.get(); }
index 67b1e0b..c57be4a 100644 (file)
@@ -1,3 +1,16 @@
+2013-10-01  Sam Weinig  <sam@webkit.org>
+
+        CTTE: DOMWrapperWorlds should be passed around by reference
+        https://bugs.webkit.org/show_bug.cgi?id=122206
+
+        Reviewed by Andreas Kling.
+
+        * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
+        (DumpRenderTreeSupportEfl::evaluateScriptInIsolatedWorld):
+        * WebCoreSupport/FrameLoaderClientEfl.cpp:
+        (WebCore::FrameLoaderClientEfl::dispatchDidClearWindowObjectInWorld):
+        * WebCoreSupport/FrameLoaderClientEfl.h:
+
 2013-09-30  Sam Weinig  <sam@webkit.org>
 
         Fix the build.
index 9ea51d2..c442c1b 100644 (file)
@@ -511,7 +511,7 @@ void DumpRenderTreeSupportEfl::evaluateScriptInIsolatedWorld(const Evas_Object*
 
     // The code below is only valid for JSC, V8 specific code is to be added
     // when V8 will be supported in EFL port. See Qt implemenation.
-    proxy.executeScriptInWorld(scriptWorld.get(), script, true);
+    proxy.executeScriptInWorld(*scriptWorld, script, true);
 }
 
 JSGlobalContextRef DumpRenderTreeSupportEfl::globalContextRefForFrame(const Evas_Object* ewkFrame)
index e512589..78c343e 100644 (file)
@@ -453,9 +453,9 @@ String FrameLoaderClientEfl::overrideMediaType() const
     return String::fromUTF8(ewk_settings_css_media_type_get());
 }
 
-void FrameLoaderClientEfl::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld* world)
+void FrameLoaderClientEfl::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld& world)
 {
-    if (world != mainThreadNormalWorld())
+    if (&world != &mainThreadNormalWorld())
         return;
 
     Frame* coreFrame = EWKPrivate::coreFrame(m_frame);
index 84707be..b0d6fc2 100644 (file)
@@ -81,7 +81,7 @@ class FrameLoaderClientEfl : public FrameLoaderClient {
     virtual void dispatchDidPushStateWithinPage();
     virtual void dispatchDidPopStateWithinPage();
     virtual void dispatchDidReplaceStateWithinPage();
-    virtual void dispatchDidClearWindowObjectInWorld(WebCore::DOMWrapperWorld*);
+    virtual void dispatchDidClearWindowObjectInWorld(WebCore::DOMWrapperWorld&);
 
     virtual void dispatchDidCancelAuthenticationChallenge(DocumentLoader*, unsigned long  identifier, const AuthenticationChallenge&);
     virtual void dispatchDidReceiveResponse(DocumentLoader*, unsigned long  identifier, const ResourceResponse&);
index a3f81f6..87d31a0 100644 (file)
@@ -1,3 +1,14 @@
+2013-10-01  Sam Weinig  <sam@webkit.org>
+
+        CTTE: DOMWrapperWorlds should be passed around by reference
+        https://bugs.webkit.org/show_bug.cgi?id=122206
+
+        Reviewed by Andreas Kling.
+
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        (WebKit::FrameLoaderClient::dispatchDidClearWindowObjectInWorld):
+        * WebCoreSupport/FrameLoaderClientGtk.h:
+
 2013-09-30  Benjamin Poulain  <benjamin@webkit.org>
 
         Remove the code guarded by STYLE_SCOPED
index 919afa4..158d93b 100644 (file)
@@ -575,9 +575,9 @@ String FrameLoaderClient::overrideMediaType() const
     return String();
 }
 
-void FrameLoaderClient::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld* world)
+void FrameLoaderClient::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld& world)
 {
-    if (world != mainThreadNormalWorld())
+    if (&world != &mainThreadNormalWorld())
         return;
 
     // Is this obsolete now?
index 7b82e12..f56fb54 100644 (file)
@@ -122,7 +122,7 @@ namespace WebKit {
         virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget);
         virtual PassRefPtr<WebCore::Widget> createJavaAppletWidget(const WebCore::IntSize&, WebCore::HTMLAppletElement*, const WebCore::URL& baseURL, const WTF::Vector<WTF::String>& paramNames, const WTF::Vector<WTF::String>& paramValues);
         virtual WTF::String overrideMediaType() const;
-        virtual void dispatchDidClearWindowObjectInWorld(WebCore::DOMWrapperWorld*);
+        virtual void dispatchDidClearWindowObjectInWorld(WebCore::DOMWrapperWorld&);
         virtual void documentElementAvailable();
         virtual void didPerformFirstNavigation() const;
 
index d1cf05d..70177e7 100644 (file)
@@ -1,3 +1,33 @@
+2013-10-01  Sam Weinig  <sam@webkit.org>
+
+        CTTE: DOMWrapperWorlds should be passed around by reference
+        https://bugs.webkit.org/show_bug.cgi?id=122206
+
+        Reviewed by Andreas Kling.
+
+        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+        (WebKit::NetscapePluginInstanceProxy::getWindowNPObject):
+        (WebKit::NetscapePluginInstanceProxy::getPluginElementNPObject):
+        (WebKit::NetscapePluginInstanceProxy::evaluate):
+        * WebCoreSupport/WebFrameLoaderClient.h:
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+        * WebView/WebFrame.mm:
+        (-[WebFrame _stringByEvaluatingJavaScriptFromString:withGlobalObject:inScriptWorld:]):
+        (-[WebFrame _globalContextForScriptWorld:]):
+        (-[WebFrame jsWrapperForNode:inScriptWorld:]):
+        * WebView/WebScriptWorld.mm:
+        (+[WebScriptWorld standardWorld]):
+        (+[WebScriptWorld findOrCreateWorld:]):
+        * WebView/WebScriptWorldInternal.h:
+        * WebView/WebView.mm:
+        (-[WebView _injectOutlookQuirksScript]):
+        (+[WebView _addUserScriptToGroup:world:source:url:whitelist:blacklist:injectionTime:injectedFrames:]):
+        (+[WebView _addUserStyleSheetToGroup:world:source:url:whitelist:blacklist:injectedFrames:]):
+        (+[WebView _removeUserScriptFromGroup:world:url:]):
+        (+[WebView _removeUserStyleSheetFromGroup:world:url:]):
+        (+[WebView _removeUserScriptsFromGroup:world:]):
+        (+[WebView _removeUserStyleSheetsFromGroup:world:]):
+
 2013-09-30  Sam Weinig  <sam@webkit.org>
 
         Remove support for DOMFileSystem
index ab47299..5417224 100644 (file)
@@ -842,7 +842,7 @@ bool NetscapePluginInstanceProxy::getWindowNPObject(uint32_t& objectID)
     if (!frame->script().canExecuteScripts(NotAboutToExecuteScript))
         objectID = 0;
     else
-        objectID = m_localObjects.idForObject(*pluginWorld()->vm(), frame->script().windowShell(pluginWorld())->window());
+        objectID = m_localObjects.idForObject(*pluginWorld().vm(), frame->script().windowShell(pluginWorld())->window());
         
     return true;
 }
@@ -854,7 +854,7 @@ bool NetscapePluginInstanceProxy::getPluginElementNPObject(uint32_t& objectID)
         return false;
     
     if (JSObject* object = frame->script().jsObjectForPluginElement([m_pluginView element]))
-        objectID = m_localObjects.idForObject(*pluginWorld()->vm(), object);
+        objectID = m_localObjects.idForObject(*pluginWorld().vm(), object);
     else
         objectID = 0;
     
@@ -883,8 +883,8 @@ bool NetscapePluginInstanceProxy::evaluate(uint32_t objectID, const String& scri
     if (!frame)
         return false;
 
-    JSLockHolder lock(pluginWorld()->vm());
-    Strong<JSGlobalObject> globalObject(*pluginWorld()->vm(), frame->script().globalObject(pluginWorld()));
+    JSLockHolder lock(pluginWorld().vm());
+    Strong<JSGlobalObject> globalObject(*pluginWorld().vm(), frame->script().globalObject(pluginWorld()));
     ExecState* exec = globalObject->globalExec();
 
     UserGestureIndicator gestureIndicator(allowPopups ? DefinitelyProcessingUserGesture : PossiblyProcessingUserGesture);
index 429f25d..1bfdd19 100644 (file)
@@ -213,7 +213,7 @@ private:
     virtual WebCore::ObjectContentType objectContentType(const WebCore::URL&, const WTF::String& mimeType, bool shouldPreferPlugInsForImages) OVERRIDE;
     virtual WTF::String overrideMediaType() const OVERRIDE;
     
-    virtual void dispatchDidClearWindowObjectInWorld(WebCore::DOMWrapperWorld*) OVERRIDE;
+    virtual void dispatchDidClearWindowObjectInWorld(WebCore::DOMWrapperWorld&) OVERRIDE;
     virtual void documentElementAvailable() OVERRIDE;
     virtual void didPerformFirstNavigation() const OVERRIDE;
 
index 46066d3..72c527c 100644 (file)
@@ -1939,7 +1939,7 @@ String WebFrameLoaderClient::overrideMediaType() const
 void WebFrameLoaderClient::documentElementAvailable() {
 }
 
-void WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld* world)
+void WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld& world)
 {
     WebView *webView = getWebView(m_webFrame.get());
     WebFrameLoadDelegateImplementationCache* implementations = WebViewGetFrameLoadDelegateImplementations(webView);
@@ -1950,7 +1950,7 @@ void WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld*
         return;
     }
 
-    if (world != mainThreadNormalWorld())
+    if (&world != &mainThreadNormalWorld())
         return;
 
     Frame *frame = core(m_webFrame.get());
index 6a3fe09..2d3358f 100644 (file)
@@ -1092,6 +1092,9 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
     if (!string)
         return @"";
 
+    if (!world)
+        return @"";
+
     // Start off with some guess at a frame and a global object, we'll try to do better...!
     JSDOMWindow* anyWorldGlobalObject = _private->coreFrame->script().globalObject(mainThreadNormalWorld());
 
@@ -1105,7 +1108,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
     ASSERT(frame->document());
     RetainPtr<WebFrame> webFrame(kit(frame)); // Running arbitrary JavaScript can destroy the frame.
 
-    JSC::JSValue result = frame->script().executeScriptInWorld(core(world), string, true).jsValue();
+    JSC::JSValue result = frame->script().executeScriptInWorld(*core(world), string, true).jsValue();
 
     if (!webFrame->_private->coreFrame) // In case the script removed our frame from the page.
         return @"";
@@ -1129,7 +1132,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
     DOMWrapperWorld* coreWorld = core(world);
     if (!coreWorld)
         return 0;
-    return toGlobalRef(coreFrame->script().globalObject(coreWorld)->globalExec());
+    return toGlobalRef(coreFrame->script().globalObject(*coreWorld)->globalExec());
 }
 
 #if JSC_OBJC_API_ENABLED
@@ -1260,7 +1263,10 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
     if (!coreFrame)
         return 0;
 
-    JSDOMWindow* globalObject = coreFrame->script().globalObject(core(world));
+    if (!world)
+        return 0;
+
+    JSDOMWindow* globalObject = coreFrame->script().globalObject(*core(world));
     JSC::ExecState* exec = globalObject->globalExec();
 
     JSC::JSLockHolder lock(exec);
index 915db43..7848b24 100644 (file)
@@ -93,7 +93,7 @@ static WorldMap& allWorlds()
 
 + (WebScriptWorld *)standardWorld
 {
-    static WebScriptWorld *world = [[WebScriptWorld alloc] initWithWorld:mainThreadNormalWorld()];
+    static WebScriptWorld *world = [[WebScriptWorld alloc] initWithWorld:&mainThreadNormalWorld()];
     return world;
 }
 
@@ -123,17 +123,15 @@ DOMWrapperWorld* core(WebScriptWorld *world)
     return world ? world->_private->world.get() : 0;
 }
 
-+ (WebScriptWorld *)findOrCreateWorld:(DOMWrapperWorld*) world
++ (WebScriptWorld *)findOrCreateWorld:(DOMWrapperWorld&)world
 {
-    ASSERT_ARG(world, world);
-
-    if (world == mainThreadNormalWorld())
+    if (&world == &mainThreadNormalWorld())
         return [self standardWorld];
 
-    if (WebScriptWorld *existingWorld = allWorlds().get(world))
+    if (WebScriptWorld *existingWorld = allWorlds().get(&world))
         return existingWorld;
 
-    return [[[self alloc] initWithWorld:world] autorelease];
+    return [[[self alloc] initWithWorld:&world] autorelease];
 }
 
 @end
index 785d9c0..7ff51f2 100644 (file)
@@ -31,5 +31,5 @@ namespace WebCore {
 WebCore::DOMWrapperWorld* core(WebScriptWorld *);
 
 @interface WebScriptWorld (WebInternal)
-+ (WebScriptWorld *)findOrCreateWorld:(WebCore::DOMWrapperWorld*)world;
++ (WebScriptWorld *)findOrCreateWorld:(WebCore::DOMWrapperWorld&)world;
 @end
index 0e063f7..af68771 100644 (file)
@@ -681,7 +681,7 @@ static NSString *leakOutlookQuirksUserScriptContents()
 -(void)_injectOutlookQuirksScript
 {
     static NSString *outlookQuirksScriptContents = leakOutlookQuirksUserScriptContents();
-    core(self)->group().addUserScriptToWorld(core([WebScriptWorld world]),
+    core(self)->group().addUserScriptToWorld(*core([WebScriptWorld world]),
         outlookQuirksScriptContents, URL(), Vector<String>(), Vector<String>(), InjectAtDocumentEnd, InjectInAllFrames);
 }
 
@@ -2688,8 +2688,11 @@ static Vector<String> toStringVector(NSArray* patterns)
     PageGroup* pageGroup = PageGroup::pageGroup(group);
     if (!pageGroup)
         return;
-    
-    pageGroup->addUserScriptToWorld(core(world), source, url, toStringVector(whitelist), toStringVector(blacklist), 
+
+    if (!world)
+        return;
+
+    pageGroup->addUserScriptToWorld(*core(world), source, url, toStringVector(whitelist), toStringVector(blacklist),
                                     injectionTime == WebInjectAtDocumentStart ? InjectAtDocumentStart : InjectAtDocumentEnd,
                                     injectedFrames == WebInjectInAllFrames ? InjectInAllFrames : InjectInTopFrameOnly);
 }
@@ -2712,7 +2715,10 @@ static Vector<String> toStringVector(NSArray* patterns)
     if (!pageGroup)
         return;
 
-    pageGroup->addUserStyleSheetToWorld(core(world), source, url, toStringVector(whitelist), toStringVector(blacklist), injectedFrames == WebInjectInAllFrames ? InjectInAllFrames : InjectInTopFrameOnly);
+    if (!world)
+        return;
+
+    pageGroup->addUserStyleSheetToWorld(*core(world), source, url, toStringVector(whitelist), toStringVector(blacklist), injectedFrames == WebInjectInAllFrames ? InjectInAllFrames : InjectInTopFrameOnly);
 }
 
 + (void)_removeUserScriptFromGroup:(NSString *)groupName world:(WebScriptWorld *)world url:(NSURL *)url
@@ -2725,7 +2731,10 @@ static Vector<String> toStringVector(NSArray* patterns)
     if (!pageGroup)
         return;
 
-    pageGroup->removeUserScriptFromWorld(core(world), url);
+    if (!world)
+        return;
+
+    pageGroup->removeUserScriptFromWorld(*core(world), url);
 }
 
 + (void)_removeUserStyleSheetFromGroup:(NSString *)groupName world:(WebScriptWorld *)world url:(NSURL *)url
@@ -2738,7 +2747,10 @@ static Vector<String> toStringVector(NSArray* patterns)
     if (!pageGroup)
         return;
 
-    pageGroup->removeUserStyleSheetFromWorld(core(world), url);
+    if (!world)
+        return;
+
+    pageGroup->removeUserStyleSheetFromWorld(*core(world), url);
 }
 
 + (void)_removeUserScriptsFromGroup:(NSString *)groupName world:(WebScriptWorld *)world
@@ -2751,7 +2763,10 @@ static Vector<String> toStringVector(NSArray* patterns)
     if (!pageGroup)
         return;
 
-    pageGroup->removeUserScriptsFromWorld(core(world));
+    if (!world)
+        return;
+
+    pageGroup->removeUserScriptsFromWorld(*core(world));
 }
 
 + (void)_removeUserStyleSheetsFromGroup:(NSString *)groupName world:(WebScriptWorld *)world
@@ -2764,7 +2779,10 @@ static Vector<String> toStringVector(NSArray* patterns)
     if (!pageGroup)
         return;
 
-    pageGroup->removeUserStyleSheetsFromWorld(core(world));
+    if (!world)
+        return;
+
+    pageGroup->removeUserStyleSheetsFromWorld(*core(world));
 }
 
 + (void)_removeAllUserContentFromGroup:(NSString *)groupName
index 7fc5767..ae6dac2 100644 (file)
@@ -1,3 +1,19 @@
+2013-10-01  Sam Weinig  <sam@webkit.org>
+
+        CTTE: DOMWrapperWorlds should be passed around by reference
+        https://bugs.webkit.org/show_bug.cgi?id=122206
+
+        Reviewed by Andreas Kling.
+
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
+        * WebCoreSupport/WebFrameLoaderClient.h:
+        * WebScriptWorld.cpp:
+        (WebScriptWorld::standardWorld):
+        (WebScriptWorld::findOrCreateWorld):
+        * WebScriptWorld.h:
+        (WebScriptWorld::world):
+
 2013-10-01  Alex Christensen  <achristensen@webkit.org>
 
         Implemented createWebViewWithRequest in WinLauncher.
index f4cb8ce..dc5bd1e 100644 (file)
@@ -1262,7 +1262,7 @@ void WebFrameLoaderClient::documentElementAvailable()
 {
 }
 
-void WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld* world)
+void WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld& world)
 {
     Frame* coreFrame = core(m_webFrame);
     ASSERT(coreFrame);
@@ -1279,7 +1279,7 @@ void WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld*
     if (delegatePrivate && delegatePrivate->didClearWindowObjectForFrameInScriptWorld(webView, m_webFrame, WebScriptWorld::findOrCreateWorld(world).get()) != E_NOTIMPL)
         return;
 
-    if (world != mainThreadNormalWorld())
+    if (&world != &mainThreadNormalWorld())
         return;
 
     JSContextRef context = toRef(coreFrame->script().globalObject(world)->globalExec());
index ae428f5..51b62d6 100644 (file)
@@ -188,7 +188,7 @@ public:
     virtual WebCore::ObjectContentType objectContentType(const WebCore::URL&, const WTF::String& mimeType, bool shouldPreferPlugInsForImages) OVERRIDE;
     virtual WTF::String overrideMediaType() const OVERRIDE;
 
-    virtual void dispatchDidClearWindowObjectInWorld(WebCore::DOMWrapperWorld*) OVERRIDE;
+    virtual void dispatchDidClearWindowObjectInWorld(WebCore::DOMWrapperWorld&) OVERRIDE;
     virtual void documentElementAvailable() OVERRIDE;
     virtual void didPerformFirstNavigation() const OVERRIDE;
 
index 01bea68..479fb9b 100644 (file)
@@ -63,7 +63,7 @@ WebScriptWorld::~WebScriptWorld()
 
 WebScriptWorld* WebScriptWorld::standardWorld()
 {
-    static WebScriptWorld* standardWorld = createInstance(mainThreadNormalWorld()).leakRef();
+    static WebScriptWorld* standardWorld = createInstance(&mainThreadNormalWorld()).leakRef();
     return standardWorld;
 }
 
@@ -77,15 +77,15 @@ COMPtr<WebScriptWorld> WebScriptWorld::createInstance(PassRefPtr<DOMWrapperWorld
     return new WebScriptWorld(world);
 }
 
-COMPtr<WebScriptWorld> WebScriptWorld::findOrCreateWorld(DOMWrapperWorld* world)
+COMPtr<WebScriptWorld> WebScriptWorld::findOrCreateWorld(DOMWrapperWorld& world)
 {
-    if (world == mainThreadNormalWorld())
+    if (&world == &mainThreadNormalWorld())
         return standardWorld();
 
     if (WebScriptWorld* existingWorld = allWorlds().get(world))
         return existingWorld;
 
-    return createInstance(world);
+    return createInstance(&world);
 }
 
 ULONG WebScriptWorld::AddRef()
index 4b0fa48..1485b8e 100644 (file)
@@ -38,12 +38,12 @@ public:
     static WebScriptWorld* standardWorld();
     static COMPtr<WebScriptWorld> createInstance();
 
-    static COMPtr<WebScriptWorld> findOrCreateWorld(WebCore::DOMWrapperWorld*);
+    static COMPtr<WebScriptWorld> findOrCreateWorld(WebCore::DOMWrapperWorld&);
 
     virtual ULONG STDMETHODCALLTYPE AddRef();
     virtual ULONG STDMETHODCALLTYPE Release();
 
-    WebCore::DOMWrapperWorld* world() const { return m_world.get(); }
+    WebCore::DOMWrapperWorld& world() const { return *m_world; }
 
 private:
     static COMPtr<WebScriptWorld> createInstance(PassRefPtr<WebCore::DOMWrapperWorld>);
index 9968051..3be6c29 100644 (file)
@@ -1,3 +1,14 @@
+2013-10-01  Sam Weinig  <sam@webkit.org>
+
+        CTTE: DOMWrapperWorlds should be passed around by reference
+        https://bugs.webkit.org/show_bug.cgi?id=122206
+
+        Reviewed by Andreas Kling.
+
+        * WebCoreSupport/FrameLoaderClientWinCE.cpp:
+        (WebKit::FrameLoaderClientWinCE::dispatchDidClearWindowObjectInWorld):
+        * WebCoreSupport/FrameLoaderClientWinCE.h:
+
 2013-09-30  Patrick Gansterer  <paroga@webkit.org>
 
         Unreviewed WinCE build fix after r153927.
index 17382a5..201b7ab 100644 (file)
@@ -197,7 +197,7 @@ String FrameLoaderClientWinCE::overrideMediaType() const
     return String();
 }
 
-void FrameLoaderClientWinCE::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld*)
+void FrameLoaderClientWinCE::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld&)
 {
     notImplemented();
 }
index b10f02b..75e4e5a 100644 (file)
@@ -111,7 +111,7 @@ public:
     virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget);
     virtual PassRefPtr<WebCore::Widget> createJavaAppletWidget(const WebCore::IntSize&, WebCore::HTMLAppletElement*, const WebCore::URL& baseURL, const WTF::Vector<WTF::String>& paramNames, const WTF::Vector<WTF::String>& paramValues);
     virtual WTF::String overrideMediaType() const;
-    virtual void dispatchDidClearWindowObjectInWorld(WebCore::DOMWrapperWorld*);
+    virtual void dispatchDidClearWindowObjectInWorld(WebCore::DOMWrapperWorld&);
     virtual void documentElementAvailable();
     virtual void didPerformFirstNavigation() const;
 
index e58ba5c..016452e 100644 (file)
@@ -1,3 +1,27 @@
+2013-10-01  Sam Weinig  <sam@webkit.org>
+
+        CTTE: DOMWrapperWorlds should be passed around by reference
+        https://bugs.webkit.org/show_bug.cgi?id=122206
+
+        Reviewed by Andreas Kling.
+
+        * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
+        (WebKit::InjectedBundlePageLoaderClient::didClearWindowObjectForFrame):
+        (WebKit::InjectedBundlePageLoaderClient::globalObjectIsAvailableForFrame):
+        * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
+        * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
+        (WebKit::InjectedBundleScriptWorld::getOrCreate):
+        (WebKit::InjectedBundleScriptWorld::normalWorld):
+        (WebKit::InjectedBundleScriptWorld::coreWorld):
+        * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h:
+        * WebProcess/Plugins/PluginView.cpp:
+        (WebKit::PluginView::windowScriptNPObject):
+        (WebKit::PluginView::pluginElementNPObject):
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
+        (WebKit::WebFrameLoaderClient::dispatchGlobalObjectAvailable):
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
+
 2013-10-01  Mark Rowe  <mrowe@apple.com>
 
         <http://webkit.org/b/122190> WebKit2 APIs returning CF and NS types should explicitly declare whether they return retained objects.
index 3c9700d..3bfe977 100644 (file)
@@ -257,7 +257,7 @@ void InjectedBundlePageLoaderClient::didLayout(WebPage* page, LayoutMilestones m
     userData = adoptRef(toImpl(userDataToPass));
 }
 
-void InjectedBundlePageLoaderClient::didClearWindowObjectForFrame(WebPage* page, WebFrame* frame, DOMWrapperWorld* world)
+void InjectedBundlePageLoaderClient::didClearWindowObjectForFrame(WebPage* page, WebFrame* frame, DOMWrapperWorld& world)
 {
     if (!m_client.didClearWindowObjectForFrame)
         return;
@@ -289,7 +289,7 @@ void InjectedBundlePageLoaderClient::didHandleOnloadEventsForFrame(WebPage* page
     m_client.didHandleOnloadEventsForFrame(toAPI(page), toAPI(frame), m_client.clientInfo);
 }
 
-void InjectedBundlePageLoaderClient::globalObjectIsAvailableForFrame(WebPage* page, WebFrame* frame, WebCore::DOMWrapperWorld* world)
+void InjectedBundlePageLoaderClient::globalObjectIsAvailableForFrame(WebPage* page, WebFrame* frame, WebCore::DOMWrapperWorld& world)
 {
     if (!m_client.globalObjectIsAvailableForFrame)
         return;
index c538682..dfce8e5 100644 (file)
@@ -77,12 +77,12 @@ public:
     void didLayoutForFrame(WebPage*, WebFrame*);
     void didLayout(WebPage*, WebCore::LayoutMilestones, RefPtr<APIObject>& userData);
 
-    void didClearWindowObjectForFrame(WebPage*, WebFrame*, WebCore::DOMWrapperWorld*);
+    void didClearWindowObjectForFrame(WebPage*, WebFrame*, WebCore::DOMWrapperWorld&);
     void didCancelClientRedirectForFrame(WebPage*, WebFrame*);
     void willPerformClientRedirectForFrame(WebPage*, WebFrame*, const String& url, double delay, double date);
     void didHandleOnloadEventsForFrame(WebPage*, WebFrame*);
 
-    void globalObjectIsAvailableForFrame(WebPage*, WebFrame*, WebCore::DOMWrapperWorld*);
+    void globalObjectIsAvailableForFrame(WebPage*, WebFrame*, WebCore::DOMWrapperWorld&);
     void willDisconnectDOMWindowExtensionFromGlobalObject(WebPage*, WebCore::DOMWindowExtension*);
     void didReconnectDOMWindowExtensionToGlobalObject(WebPage*, WebCore::DOMWindowExtension*);
     void willDestroyGlobalObjectForDOMWindowExtension(WebPage*, WebCore::DOMWindowExtension*);
index 2f40fd3..35a53e3 100644 (file)
@@ -47,20 +47,20 @@ PassRefPtr<InjectedBundleScriptWorld> InjectedBundleScriptWorld::create()
     return adoptRef(new InjectedBundleScriptWorld(ScriptController::createWorld()));
 }
 
-PassRefPtr<InjectedBundleScriptWorld> InjectedBundleScriptWorld::getOrCreate(DOMWrapperWorld* world)
+PassRefPtr<InjectedBundleScriptWorld> InjectedBundleScriptWorld::getOrCreate(DOMWrapperWorld& world)
 {
-    if (world == mainThreadNormalWorld())
+    if (&world == &mainThreadNormalWorld())
         return normalWorld();
 
-    if (InjectedBundleScriptWorld* existingWorld = allWorlds().get(world))
+    if (InjectedBundleScriptWorld* existingWorld = allWorlds().get(&world))
         return existingWorld;
 
-    return adoptRef(new InjectedBundleScriptWorld(world));
+    return adoptRef(new InjectedBundleScriptWorld(&world));
 }
 
 InjectedBundleScriptWorld* InjectedBundleScriptWorld::normalWorld()
 {
-    static InjectedBundleScriptWorld* world = adoptRef(new InjectedBundleScriptWorld(mainThreadNormalWorld())).leakRef();
+    static InjectedBundleScriptWorld* world = adoptRef(new InjectedBundleScriptWorld(&mainThreadNormalWorld())).leakRef();
     return world;
 }
 
@@ -77,9 +77,9 @@ InjectedBundleScriptWorld::~InjectedBundleScriptWorld()
     allWorlds().remove(m_world.get());
 }
 
-DOMWrapperWorld* InjectedBundleScriptWorld::coreWorld() const
+DOMWrapperWorld& InjectedBundleScriptWorld::coreWorld() const
 {
-    return m_world.get();
+    return *m_world.get();
 }
     
 void InjectedBundleScriptWorld::clearWrappers()
index acdc830..48a6f0f 100644 (file)
@@ -39,12 +39,12 @@ namespace WebKit {
 class InjectedBundleScriptWorld : public TypedAPIObject<APIObject::TypeBundleScriptWorld> {
 public:
     static PassRefPtr<InjectedBundleScriptWorld> create();
-    static PassRefPtr<InjectedBundleScriptWorld> getOrCreate(WebCore::DOMWrapperWorld*);
+    static PassRefPtr<InjectedBundleScriptWorld> getOrCreate(WebCore::DOMWrapperWorld&);
     static InjectedBundleScriptWorld* normalWorld();
 
     virtual ~InjectedBundleScriptWorld();
 
-    WebCore::DOMWrapperWorld* coreWorld() const;
+    WebCore::DOMWrapperWorld& coreWorld() const;
     
     void clearWrappers();
 
index e5fdbd9..40fd808 100644 (file)
@@ -1365,7 +1365,7 @@ NPObject* PluginView::windowScriptNPObject()
         return 0;
     }
 
-    return m_npRuntimeObjectMap.getOrCreateNPObject(*pluginWorld()->vm(), frame()->script().windowShell(pluginWorld())->window());
+    return m_npRuntimeObjectMap.getOrCreateNPObject(*pluginWorld().vm(), frame()->script().windowShell(pluginWorld())->window());
 }
 
 NPObject* PluginView::pluginElementNPObject()
@@ -1381,7 +1381,7 @@ NPObject* PluginView::pluginElementNPObject()
     JSObject* object = frame()->script().jsObjectForPluginElement(m_pluginElement.get());
     ASSERT(object);
 
-    return m_npRuntimeObjectMap.getOrCreateNPObject(*pluginWorld()->vm(), object);
+    return m_npRuntimeObjectMap.getOrCreateNPObject(*pluginWorld().vm(), object);
 }
 
 bool PluginView::evaluate(NPObject* npObject, const String& scriptString, NPVariant* result, bool allowPopups)
index 9b68462..baf37bc 100644 (file)
@@ -1441,7 +1441,7 @@ String WebFrameLoaderClient::overrideMediaType() const
     return String();
 }
 
-void WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld* world)
+void WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld& world)
 {
     WebPage* webPage = m_frame->page();
     if (!webPage)
@@ -1456,7 +1456,7 @@ void WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld*
 }
 
 
-void WebFrameLoaderClient::dispatchGlobalObjectAvailable(DOMWrapperWorld* world)
+void WebFrameLoaderClient::dispatchGlobalObjectAvailable(DOMWrapperWorld& world)
 {
     WebPage* webPage = m_frame->page();
     if (!webPage)
index 7022681..8d3be99 100644 (file)
@@ -195,9 +195,9 @@ private:
     virtual WebCore::ObjectContentType objectContentType(const WebCore::URL&, const String& mimeType, bool shouldPreferPlugInsForImages) OVERRIDE;
     virtual String overrideMediaType() const OVERRIDE;
 
-    virtual void dispatchDidClearWindowObjectInWorld(WebCore::DOMWrapperWorld*) OVERRIDE;
+    virtual void dispatchDidClearWindowObjectInWorld(WebCore::DOMWrapperWorld&) OVERRIDE;
     
-    virtual void dispatchGlobalObjectAvailable(WebCore::DOMWrapperWorld*) OVERRIDE;
+    virtual void dispatchGlobalObjectAvailable(WebCore::DOMWrapperWorld&) OVERRIDE;
     virtual void dispatchWillDisconnectDOMWindowExtensionFromGlobalObject(WebCore::DOMWindowExtension*) OVERRIDE;
     virtual void dispatchDidReconnectDOMWindowExtensionToGlobalObject(WebCore::DOMWindowExtension*) OVERRIDE;
     virtual void dispatchWillDestroyGlobalObjectForDOMWindowExtension(WebCore::DOMWindowExtension*) OVERRIDE;