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

Unified Diff: content/browser/ppapi_plugin_process_host.cc

Issue 10378057: Broker out PPAPI handle duplication (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 7 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/browser/ppapi_plugin_process_host.h ('k') | content/browser/renderer_host/render_message_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/ppapi_plugin_process_host.cc
===================================================================
--- content/browser/ppapi_plugin_process_host.cc (revision 136613)
+++ content/browser/ppapi_plugin_process_host.cc (working copy)
@@ -207,13 +207,12 @@
// We can't send any sync messages from the browser because it might lead to
// a hang. See the similar code in PluginProcessHost for more description.
PpapiMsg_CreateChannel* msg = new PpapiMsg_CreateChannel(
- process_handle, renderer_id, client->OffTheRecord());
+ renderer_id, client->OffTheRecord());
msg->set_unblock(true);
if (Send(msg)) {
sent_requests_.push(client);
} else {
- client->OnPpapiChannelOpened(base::kNullProcessHandle,
- IPC::ChannelHandle(), 0);
+ client->OnPpapiChannelOpened(IPC::ChannelHandle(), 0);
}
}
@@ -260,14 +259,12 @@
DVLOG(1) << "PpapiPluginProcessHost" << (is_broker_ ? "[broker]" : "")
<< "CancelRequests()";
for (size_t i = 0; i < pending_requests_.size(); i++) {
- pending_requests_[i]->OnPpapiChannelOpened(base::kNullProcessHandle,
- IPC::ChannelHandle(), 0);
+ pending_requests_[i]->OnPpapiChannelOpened(IPC::ChannelHandle(), 0);
}
pending_requests_.clear();
while (!sent_requests_.empty()) {
- sent_requests_.front()->OnPpapiChannelOpened(base::kNullProcessHandle,
- IPC::ChannelHandle(), 0);
+ sent_requests_.front()->OnPpapiChannelOpened(IPC::ChannelHandle(), 0);
sent_requests_.pop();
}
}
@@ -283,22 +280,5 @@
Client* client = sent_requests_.front();
sent_requests_.pop();
- // Prepare the handle to send to the renderer.
- base::ProcessHandle plugin_process = process_->GetHandle();
-#if defined(OS_WIN)
- base::ProcessHandle renderer_process;
- int renderer_id;
- client->GetPpapiChannelInfo(&renderer_process, &renderer_id);
-
- base::ProcessHandle renderers_plugin_handle = NULL;
- ::DuplicateHandle(::GetCurrentProcess(), plugin_process,
- renderer_process, &renderers_plugin_handle,
- 0, FALSE, DUPLICATE_SAME_ACCESS);
-#elif defined(OS_POSIX)
- // Don't need to duplicate anything on POSIX since it's just a PID.
- base::ProcessHandle renderers_plugin_handle = plugin_process;
-#endif
-
- client->OnPpapiChannelOpened(renderers_plugin_handle, channel_handle,
- process_->GetData().id);
+ client->OnPpapiChannelOpened(channel_handle, process_->GetData().id);
}
« no previous file with comments | « content/browser/ppapi_plugin_process_host.h ('k') | content/browser/renderer_host/render_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698