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

Unified Diff: chrome/plugin/plugin_channel.cc

Issue 42054: Stop using renderer specific host ids in ResourceDispatcher. This allows it ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | « chrome/plugin/plugin_channel.h ('k') | chrome/plugin/plugin_thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/plugin/plugin_channel.cc
===================================================================
--- chrome/plugin/plugin_channel.cc (revision 11493)
+++ chrome/plugin/plugin_channel.cc (working copy)
@@ -8,29 +8,23 @@
#include "chrome/common/plugin_messages.h"
#include "base/command_line.h"
+#include "base/process_util.h"
#include "base/string_util.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/plugin/plugin_process.h"
#include "chrome/plugin/plugin_thread.h"
-PluginChannel* PluginChannel::GetPluginChannel(
- int process_id, HANDLE renderer_handle, MessageLoop* ipc_message_loop) {
- // map renderer's process id to a (single) channel to that process
+PluginChannel* PluginChannel::GetPluginChannel(MessageLoop* ipc_message_loop) {
+ static int next_id;
std::wstring channel_name = StringPrintf(
- L"%d.r%d", GetCurrentProcessId(), process_id);
+ L"%d.r%d", GetCurrentProcessId(), ++next_id);
- PluginChannelBase* result = PluginChannelBase::GetChannel(
+ return static_cast<PluginChannel*>(PluginChannelBase::GetChannel(
channel_name,
IPC::Channel::MODE_SERVER,
ClassFactory,
ipc_message_loop,
- false);
-
- PluginChannel* channel = static_cast<PluginChannel*>(result);
- if (channel && !channel->renderer_handle())
- channel->renderer_handle_.Set(renderer_handle);
-
- return channel;
+ false));
}
PluginChannel::PluginChannel() : in_send_(0) {
@@ -105,6 +99,11 @@
return InterlockedIncrement(&last_id);
}
+void PluginChannel::OnChannelConnected(int32 peer_pid) {
+ renderer_handle_.Set(base::OpenProcessHandle(peer_pid));
+ PluginChannelBase::OnChannelConnected(peer_pid);
+}
+
void PluginChannel::OnChannelError() {
renderer_handle_.Set(NULL);
PluginChannelBase::OnChannelError();
« no previous file with comments | « chrome/plugin/plugin_channel.h ('k') | chrome/plugin/plugin_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698