| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/ppapi_broker_process_host.h" | 5 #include "content/browser/ppapi_broker_process_host.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 11 #include "chrome/common/chrome_switches.h" | 11 #include "chrome/common/chrome_switches.h" |
| 12 #include "chrome/common/pepper_plugin_registry.h" | 12 #include "chrome/common/pepper_plugin_registry.h" |
| 13 #include "chrome/common/render_messages.h" | 13 #include "chrome/common/render_messages.h" |
| 14 #include "content/browser/plugin_service.h" | 14 #include "content/browser/plugin_service.h" |
| 15 #include "content/browser/renderer_host/render_message_filter.h" | 15 #include "content/browser/renderer_host/render_message_filter.h" |
| 16 #include "ipc/ipc_switches.h" | 16 #include "ipc/ipc_switches.h" |
| 17 #include "ppapi/proxy/ppapi_messages.h" | 17 #include "ppapi/proxy/ppapi_messages.h" |
| 18 | 18 |
| 19 PpapiBrokerProcessHost::PpapiBrokerProcessHost() | 19 PpapiBrokerProcessHost::PpapiBrokerProcessHost() |
| 20 : BrowserChildProcessHost( | 20 : BrowserChildProcessHost(ChildProcessInfo::PPAPI_BROKER_PROCESS) { |
| 21 ChildProcessInfo::PPAPI_BROKER_PROCESS, NULL) { | |
| 22 } | 21 } |
| 23 | 22 |
| 24 PpapiBrokerProcessHost::~PpapiBrokerProcessHost() { | 23 PpapiBrokerProcessHost::~PpapiBrokerProcessHost() { |
| 25 CancelRequests(); | 24 CancelRequests(); |
| 26 } | 25 } |
| 27 | 26 |
| 28 bool PpapiBrokerProcessHost::Init(const PepperPluginInfo& info) { | 27 bool PpapiBrokerProcessHost::Init(const PepperPluginInfo& info) { |
| 29 broker_path_ = info.path; | 28 broker_path_ = info.path; |
| 30 set_name(UTF8ToWide(info.name)); | 29 set_name(UTF8ToWide(info.name)); |
| 31 set_version(UTF8ToWide(info.version)); | 30 set_version(UTF8ToWide(info.version)); |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 ::DuplicateHandle(::GetCurrentProcess(), broker_process, | 169 ::DuplicateHandle(::GetCurrentProcess(), broker_process, |
| 171 renderer_process, &renderers_broker_handle, | 170 renderer_process, &renderers_broker_handle, |
| 172 0, FALSE, DUPLICATE_SAME_ACCESS); | 171 0, FALSE, DUPLICATE_SAME_ACCESS); |
| 173 #elif defined(OS_POSIX) | 172 #elif defined(OS_POSIX) |
| 174 // Don't need to duplicate anything on POSIX since it's just a PID. | 173 // Don't need to duplicate anything on POSIX since it's just a PID. |
| 175 base::ProcessHandle renderers_broker_handle = broker_process; | 174 base::ProcessHandle renderers_broker_handle = broker_process; |
| 176 #endif | 175 #endif |
| 177 | 176 |
| 178 client->OnChannelOpened(renderers_broker_handle, channel_handle); | 177 client->OnChannelOpened(renderers_broker_handle, channel_handle); |
| 179 } | 178 } |
| OLD | NEW |