diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-14 22:49:09 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-14 22:49:09 +0000 |
commit | 4befe759d0281fb6ac017ac4a1fbbad75380ccb8 (patch) | |
tree | 57aba0209c811bf18fabd14e2aca30eb3d0d3d36 /content/browser/plugin_process_host.h | |
parent | a2bf73fa21b1881c814e3c1d524232cb2e171c4b (diff) | |
download | chromium_src-4befe759d0281fb6ac017ac4a1fbbad75380ccb8.zip chromium_src-4befe759d0281fb6ac017ac4a1fbbad75380ccb8.tar.gz chromium_src-4befe759d0281fb6ac017ac4a1fbbad75380ccb8.tar.bz2 |
Reland r100733 - Cancel plugin channel requests when the renderer goes away.
Logic:
- Profile shutdown kills all renderer processes
- When the RMF detects the channel closing, it kills off any plugin channel requests from:
* PluginService (which needs to check the PluginServiceFilter on the FILE thread)
* PluginProcessHost (which may need to wait for the channel to get established)
- RMF uses the new OnPluginProcessHostFound() to cancel at the PluginService or PluginProcessHost
Modified in Reland:
* PluginProcessHost may be blocked on the browser<=>plugin channel to be established, OR on the plugin<=>renderer channel to be established.
* Already covered the former case in the previous changelist (pending_requests_) but not the latter case (sent_requests_).
* Cover both cases and add tests.
BUG=94704
TEST=New PluginService tests
Review URL: http://codereview.chromium.org/7887027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101181 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/plugin_process_host.h')
-rw-r--r-- | content/browser/plugin_process_host.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/content/browser/plugin_process_host.h b/content/browser/plugin_process_host.h index fcec36c..8cfc249 100644 --- a/content/browser/plugin_process_host.h +++ b/content/browser/plugin_process_host.h @@ -8,7 +8,7 @@ #include "build/build_config.h" -#include <queue> +#include <list> #include <set> #include <string> #include <vector> @@ -52,6 +52,8 @@ class PluginProcessHost : public BrowserChildProcessHost { virtual const content::ResourceContext& GetResourceContext() = 0; virtual bool OffTheRecord() = 0; virtual void SetPluginInfo(const webkit::WebPluginInfo& info) = 0; + virtual void OnFoundPluginProcessHost(PluginProcessHost* host) = 0; + virtual void OnSentPluginChannelRequest() = 0; // The client should delete itself when one of these methods is called. virtual void OnChannelOpened(const IPC::ChannelHandle& handle) = 0; virtual void OnError() = 0; @@ -83,6 +85,12 @@ class PluginProcessHost : public BrowserChildProcessHost { static void CancelPendingRequestsForResourceContext( const content::ResourceContext* context); + // This function is called to cancel pending requests to open new channels. + void CancelPendingRequest(Client* client); + + // This function is called to cancel sent requests to open new channels. + void CancelSentRequest(Client* client); + // This function is called on the IO thread once we receive a reply from the // modal HTML dialog (in the form of a JSON string). This function forwards // that reply back to the plugin that requested the dialog. @@ -138,7 +146,7 @@ class PluginProcessHost : public BrowserChildProcessHost { // These are the channel requests that we have already sent to // the plugin process, but haven't heard back about yet. - std::queue<Client*> sent_requests_; + std::list<Client*> sent_requests_; // Information about the plugin. webkit::WebPluginInfo info_; |