2011-02-15 Anders Carlsson <andersca@apple.com>
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Feb 2011 04:11:01 +0000 (04:11 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Feb 2011 04:11:01 +0000 (04:11 +0000)
commit3a6541a5fadabc61dec15684b7271186aa4743c9
tree3981023eac18b6f13c9ab6084356189ef018d956
parentbfee946bee8cde2233ae98d010e4226b91b866ec
2011-02-15  Anders Carlsson  <andersca@apple.com>

        Reviewed by Sam Weinig.

        WebPluginSiteDataManager should work with plug-in process
        https://bugs.webkit.org/show_bug.cgi?id=54523
        <rdar://problem/8689312>

        * PluginProcess/PluginProcess.cpp:
        (WebKit::PluginProcess::removeWebProcessConnection):
        Call startShutdownTimerIfNecessary().

        (WebKit::PluginProcess::getSitesWithData):
        Ask the plug-in module for the sites with data and send them back
        in a PluginProcessProxy::DidGetSitesWithData message.

        (WebKit::PluginProcess::clearSiteData):
        Clear site data and send back a DidClearSiteData message.

        (WebKit::PluginProcess::startShutdownTimerIfNecessary):
        Factor code out from removeWebProcessConnection.

        * PluginProcess/PluginProcess.messages.in:
        Add new messages.

        * UIProcess/Plugins/PluginInfoStore.cpp:
        (WebKit::PluginInfoStore::plugins):
        New function for getting all plug-ins.

        * UIProcess/Plugins/PluginProcessManager.cpp:
        (WebKit::PluginProcessManager::getPluginProcessConnection):
        Call getOrCreatePluginProcess.

        (WebKit::PluginProcessManager::getSitesWithData):
        Get a plug-in process proxy and call getSitesWithData.

        (WebKit::PluginProcessManager::clearSiteData):
        Get a plug-in process proxy and call clearSiteData.

        (WebKit::PluginProcessManager::getOrCreatePluginProcess):
        Factor code to create a plug-in process out into a separate function.

        * UIProcess/Plugins/PluginProcessProxy.cpp:
        (WebKit::PluginProcessProxy::getSitesWithData):
        (WebKit::PluginProcessProxy::clearSiteData):
        Update the pending reply struct. If the process is still launching,
        enqueue the request. Otherwise, just send the message.

        (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch):
        Make sure that pending replies are sent out.

        (WebKit::PluginProcessProxy::didFinishLaunching):
        Send our pending requests.

        (WebKit::PluginProcessProxy::didGetSitesWithData):
        (WebKit::PluginProcessProxy::didClearSiteData):
        Call down to the plug-in site data manager.

        * UIProcess/Plugins/PluginProcessProxy.messages.in:
        Add DidGetSitesWithData and DidClearSiteData messages.

        * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
        (WebKit::WebPluginSiteDataManager::GetSitesWithDataState::GetSitesWithDataState):
        Initialize the state.

        (WebKit::WebPluginSiteDataManager::GetSitesWithDataState::getSitesWithDataForNextPlugin):
        If the plug-in queue is empty, call didGetSitesWithDataForAllPlugins. Otherwise, ask
        the plug-in process manager to get sites for the next plug-in.

        (WebKit::WebPluginSiteDataManager::GetSitesWithDataState::didGetSitesWithDataForSinglePlugin):
        Update the sites set and get sites for the next plug-in.

        (WebKit::WebPluginSiteDataManager::ClearSiteDataState::ClearSiteDataState):
        Initialize the state.

        (WebKit::WebPluginSiteDataManager::ClearSiteDataState::clearSiteDataForNextPlugin):
        If the plug-in queue is empty, call didClearSiteDataForAllPlugins. Otherwise, ask
        the plug-in process manager to get sites for the next plug-in.

        (WebKit::WebPluginSiteDataManager::ClearSiteDataState::didClearSiteDataForSinglePlugin):
        Update the sites set and ask the next plug-in to clear site data.

        (WebKit::WebPluginSiteDataManager::~WebPluginSiteDataManager):
        Assert that all maps are empty.

        (WebKit::WebPluginSiteDataManager::invalidate):
        Delete and clear the pending state maps.

        (WebKit::WebPluginSiteDataManager::getSitesWithData):
        In the ENABLE(PLUGIN_PROCESS) case, allocate a new GetSitesWithDataState object and
        tell it to get sites for the next plug-in. Otherwise, make sure that the web process
        is alive before sending a GetSitesWithPluginData message.

        (WebKit::WebPluginSiteDataManager::clearSiteData):
        In the ENABLE(PLUGIN_PROCESS) case, allocate a new ClearSiteDataState object and
        tell it to get sites for the next plug-in. Otherwise, make sure that the web process
        is alive before sending a ClearPluginSiteData message.

        (WebKit::WebPluginSiteDataManager::didGetSitesWithDataForSinglePlugin):
        Call down to the GetSitesWithDataState object.

        (WebKit::WebPluginSiteDataManager::didGetSitesWithDataForAllPlugins):
        Free the GetSitesWithDataState object and invoke the callback.

        (WebKit::WebPluginSiteDataManager::didClearSiteDataForSinglePlugin):
        Call down to the GetSitesWithDataState object.

        (WebKit::WebPluginSiteDataManager::didClearSiteDataForAllPlugins):
        Free the GetSitesWithDataState object and invoke the callback.

        * UIProcess/WebContext.cpp:
        (WebKit::WebContext::processDidClose):
        Don't invalidate the plug-in site data manager if we're using a plug-in process.

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::getSitesWithPluginData):
        (WebKit::WebProcess::clearPluginSiteData):
        Call shutdownIfPossible().

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@78676 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/PluginProcess/PluginProcess.cpp
Source/WebKit2/PluginProcess/PluginProcess.h
Source/WebKit2/PluginProcess/PluginProcess.messages.in
Source/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp
Source/WebKit2/UIProcess/Plugins/PluginInfoStore.h
Source/WebKit2/UIProcess/Plugins/PluginProcessManager.cpp
Source/WebKit2/UIProcess/Plugins/PluginProcessManager.h
Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp
Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h
Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.messages.in
Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.cpp
Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.h
Source/WebKit2/UIProcess/WebContext.cpp
Source/WebKit2/UIProcess/WebContext.h
Source/WebKit2/WebProcess/WebProcess.cpp