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
diff --git a/content/browser/plugin_service.h b/content/browser/plugin_service.h
index f7cb6f3..23ef03b 100644
--- a/content/browser/plugin_service.h
+++ b/content/browser/plugin_service.h
@@ -99,6 +99,9 @@
void OpenChannelToPpapiBroker(const FilePath& path,
PpapiBrokerProcessHost::Client* client);
+ // Cancels opening a channel to a NPAPI plugin.
+ void CancelOpenChannelToNpapiPlugin(PluginProcessHost::Client* client);
+
// Gets the plugin in the list of plugins that matches the given url and mime
// type. Must be called on the FILE thread if |use_stale| is NULL.
bool GetPluginInfo(int render_process_id,
@@ -193,6 +196,8 @@
// Weak pointer; outlives us.
content::PluginServiceFilter* filter_;
+ std::set<PluginProcessHost::Client*> pending_plugin_clients_;
+
DISALLOW_COPY_AND_ASSIGN(PluginService);
};