summaryrefslogtreecommitdiffstats
path: root/content/browser/plugin_process_host.cc
diff options
context:
space:
mode:
authorbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-12 11:00:21 +0000
committerbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-12 11:00:21 +0000
commit1a5acea8faf7ad8af233f97a43920df0dea901f4 (patch)
tree4d2ac1317836f881e8d234b66a6739dd197a7ee3 /content/browser/plugin_process_host.cc
parent25395f24a4adb701c1052f773704fdf5cfe00d2b (diff)
downloadchromium_src-1a5acea8faf7ad8af233f97a43920df0dea901f4.zip
chromium_src-1a5acea8faf7ad8af233f97a43920df0dea901f4.tar.gz
chromium_src-1a5acea8faf7ad8af233f97a43920df0dea901f4.tar.bz2
Cancel pending plugin channel requests before destroying the ResourceContext.
BUG=94704 TEST=none Review URL: http://codereview.chromium.org/7810021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100671 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/plugin_process_host.cc')
-rw-r--r--content/browser/plugin_process_host.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/content/browser/plugin_process_host.cc b/content/browser/plugin_process_host.cc
index dfc3548..23516c7 100644
--- a/content/browser/plugin_process_host.cc
+++ b/content/browser/plugin_process_host.cc
@@ -332,6 +332,23 @@ void PluginProcessHost::CancelRequests() {
}
}
+// static
+void PluginProcessHost::CancelPendingRequestsForResourceContext(
+ const content::ResourceContext* context) {
+ for (BrowserChildProcessHost::Iterator host_it(
+ ChildProcessInfo::PLUGIN_PROCESS);
+ !host_it.Done(); ++host_it) {
+ PluginProcessHost* host = static_cast<PluginProcessHost*>(*host_it);
+ for (size_t i = 0; i < host->pending_requests_.size(); ++i) {
+ if (&host->pending_requests_[i]->GetResourceContext() == context) {
+ host->pending_requests_[i]->OnError();
+ host->pending_requests_.erase(host->pending_requests_.begin() + i);
+ --i;
+ }
+ }
+ }
+}
+
void PluginProcessHost::OpenChannelToPlugin(Client* client) {
InstanceCreated();
client->SetPluginInfo(info_);