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/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 AddFilter(filter_.get()); | 102 AddFilter(filter_.get()); |
103 } | 103 } |
104 | 104 |
105 PpapiPluginProcessHost::PpapiPluginProcessHost() | 105 PpapiPluginProcessHost::PpapiPluginProcessHost() |
106 : BrowserChildProcessHost(ChildProcessInfo::PPAPI_BROKER_PROCESS), | 106 : BrowserChildProcessHost(ChildProcessInfo::PPAPI_BROKER_PROCESS), |
107 is_broker_(true) { | 107 is_broker_(true) { |
108 } | 108 } |
109 | 109 |
110 bool PpapiPluginProcessHost::Init(const content::PepperPluginInfo& info) { | 110 bool PpapiPluginProcessHost::Init(const content::PepperPluginInfo& info) { |
111 plugin_path_ = info.path; | 111 plugin_path_ = info.path; |
112 set_name(UTF8ToUTF16(info.name)); | 112 if (info.name.empty()) { |
| 113 set_name(plugin_path_.BaseName().LossyDisplayName()); |
| 114 } else { |
| 115 set_name(UTF8ToUTF16(info.name)); |
| 116 } |
113 set_version(UTF8ToUTF16(info.version)); | 117 set_version(UTF8ToUTF16(info.version)); |
114 | 118 |
115 if (!CreateChannel()) | 119 if (!CreateChannel()) |
116 return false; | 120 return false; |
117 | 121 |
118 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); | 122 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); |
119 CommandLine::StringType plugin_launcher = | 123 CommandLine::StringType plugin_launcher = |
120 browser_command_line.GetSwitchValueNative(switches::kPpapiPluginLauncher); | 124 browser_command_line.GetSwitchValueNative(switches::kPpapiPluginLauncher); |
121 | 125 |
122 #if defined(OS_LINUX) | 126 #if defined(OS_LINUX) |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 ::DuplicateHandle(::GetCurrentProcess(), plugin_process, | 273 ::DuplicateHandle(::GetCurrentProcess(), plugin_process, |
270 renderer_process, &renderers_plugin_handle, | 274 renderer_process, &renderers_plugin_handle, |
271 0, FALSE, DUPLICATE_SAME_ACCESS); | 275 0, FALSE, DUPLICATE_SAME_ACCESS); |
272 #elif defined(OS_POSIX) | 276 #elif defined(OS_POSIX) |
273 // Don't need to duplicate anything on POSIX since it's just a PID. | 277 // Don't need to duplicate anything on POSIX since it's just a PID. |
274 base::ProcessHandle renderers_plugin_handle = plugin_process; | 278 base::ProcessHandle renderers_plugin_handle = plugin_process; |
275 #endif | 279 #endif |
276 | 280 |
277 client->OnChannelOpened(renderers_plugin_handle, channel_handle); | 281 client->OnChannelOpened(renderers_plugin_handle, channel_handle); |
278 } | 282 } |
OLD | NEW |