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_plugin_process_host.h" | 5 #include "content/browser/ppapi_plugin_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" |
(...skipping 13 matching lines...) Expand all Loading... |
24 } | 24 } |
25 | 25 |
26 PpapiPluginProcessHost::~PpapiPluginProcessHost() { | 26 PpapiPluginProcessHost::~PpapiPluginProcessHost() { |
27 net::NetworkChangeNotifier::RemoveOnlineStateObserver(this); | 27 net::NetworkChangeNotifier::RemoveOnlineStateObserver(this); |
28 net::NetworkChangeNotifier::RemoveIPAddressObserver(this); | 28 net::NetworkChangeNotifier::RemoveIPAddressObserver(this); |
29 CancelRequests(); | 29 CancelRequests(); |
30 } | 30 } |
31 | 31 |
32 bool PpapiPluginProcessHost::Init(const PepperPluginInfo& info) { | 32 bool PpapiPluginProcessHost::Init(const PepperPluginInfo& info) { |
33 plugin_path_ = info.path; | 33 plugin_path_ = info.path; |
34 set_name(UTF8ToWide(info.name)); | 34 set_name(UTF8ToUTF16(info.name)); |
35 set_version(UTF8ToWide(info.version)); | 35 set_version(UTF8ToUTF16(info.version)); |
36 | 36 |
37 if (!CreateChannel()) | 37 if (!CreateChannel()) |
38 return false; | 38 return false; |
39 | 39 |
40 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); | 40 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); |
41 CommandLine::StringType plugin_launcher = | 41 CommandLine::StringType plugin_launcher = |
42 browser_command_line.GetSwitchValueNative(switches::kPpapiPluginLauncher); | 42 browser_command_line.GetSwitchValueNative(switches::kPpapiPluginLauncher); |
43 | 43 |
44 FilePath exe_path = ChildProcessHost::GetChildPath(plugin_launcher.empty()); | 44 FilePath exe_path = ChildProcessHost::GetChildPath(plugin_launcher.empty()); |
45 if (exe_path.empty()) | 45 if (exe_path.empty()) |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 ::DuplicateHandle(::GetCurrentProcess(), plugin_process, | 196 ::DuplicateHandle(::GetCurrentProcess(), plugin_process, |
197 renderer_process, &renderers_plugin_handle, | 197 renderer_process, &renderers_plugin_handle, |
198 0, FALSE, DUPLICATE_SAME_ACCESS); | 198 0, FALSE, DUPLICATE_SAME_ACCESS); |
199 #elif defined(OS_POSIX) | 199 #elif defined(OS_POSIX) |
200 // Don't need to duplicate anything on POSIX since it's just a PID. | 200 // Don't need to duplicate anything on POSIX since it's just a PID. |
201 base::ProcessHandle renderers_plugin_handle = plugin_process; | 201 base::ProcessHandle renderers_plugin_handle = plugin_process; |
202 #endif | 202 #endif |
203 | 203 |
204 client->OnChannelOpened(renderers_plugin_handle, channel_handle); | 204 client->OnChannelOpened(renderers_plugin_handle, channel_handle); |
205 } | 205 } |
OLD | NEW |