Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(798)

Unified Diff: content/plugin/plugin_channel.cc

Issue 9924010: Revert 129627 - Add a sandbox API for broker handle duplication (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/plugin/plugin_channel.h ('k') | content/plugin/webplugin_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/plugin/plugin_channel.cc
===================================================================
--- content/plugin/plugin_channel.cc (revision 129628)
+++ content/plugin/plugin_channel.cc (working copy)
@@ -161,7 +161,8 @@
}
PluginChannel::PluginChannel()
- : renderer_id_(-1),
+ : renderer_handle_(0),
+ renderer_id_(-1),
in_send_(0),
incognito_(false),
filter_(new MessageFilter()) {
@@ -172,6 +173,9 @@
}
PluginChannel::~PluginChannel() {
+ if (renderer_handle_)
+ base::CloseProcessHandle(renderer_handle_);
+
MessageLoop::current()->PostDelayedTask(
FROM_HERE,
base::Bind(&PluginReleaseCallback),
@@ -288,7 +292,18 @@
return filter_->GetModalDialogEvent(containing_window);
}
+void PluginChannel::OnChannelConnected(int32 peer_pid) {
+ base::ProcessHandle handle;
+ if (!base::OpenProcessHandle(peer_pid, &handle)) {
+ NOTREACHED();
+ }
+ renderer_handle_ = handle;
+ NPChannelBase::OnChannelConnected(peer_pid);
+}
+
void PluginChannel::OnChannelError() {
+ base::CloseProcessHandle(renderer_handle_);
+ renderer_handle_ = 0;
NPChannelBase::OnChannelError();
CleanUp();
}
« no previous file with comments | « content/plugin/plugin_channel.h ('k') | content/plugin/webplugin_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698