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/plugin_process_host.h" | 5 #include "content/browser/plugin_process_host.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #elif defined(OS_POSIX) | 9 #elif defined(OS_POSIX) |
10 #include <utility> // for pair<> | 10 #include <utility> // for pair<> |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 } | 148 } |
149 } | 149 } |
150 #endif | 150 #endif |
151 // Cancel all pending and sent requests. | 151 // Cancel all pending and sent requests. |
152 CancelRequests(); | 152 CancelRequests(); |
153 } | 153 } |
154 | 154 |
155 bool PluginProcessHost::Init(const webkit::npapi::WebPluginInfo& info, | 155 bool PluginProcessHost::Init(const webkit::npapi::WebPluginInfo& info, |
156 const std::string& locale) { | 156 const std::string& locale) { |
157 info_ = info; | 157 info_ = info; |
158 set_name(UTF16ToWideHack(info_.name)); | 158 set_name(info_.name); |
159 set_version(UTF16ToWideHack(info_.version)); | 159 set_version(info_.version); |
160 | 160 |
161 if (!CreateChannel()) | 161 if (!CreateChannel()) |
162 return false; | 162 return false; |
163 | 163 |
164 // Build command line for plugin. When we have a plugin launcher, we can't | 164 // Build command line for plugin. When we have a plugin launcher, we can't |
165 // allow "self" on linux and we need the real file path. | 165 // allow "self" on linux and we need the real file path. |
166 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); | 166 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); |
167 CommandLine::StringType plugin_launcher = | 167 CommandLine::StringType plugin_launcher = |
168 browser_command_line.GetSwitchValueNative(switches::kPluginLauncher); | 168 browser_command_line.GetSwitchValueNative(switches::kPluginLauncher); |
169 FilePath exe_path = GetChildPath(plugin_launcher.empty()); | 169 FilePath exe_path = GetChildPath(plugin_launcher.empty()); |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 } | 346 } |
347 } | 347 } |
348 | 348 |
349 void PluginProcessHost::OnChannelCreated( | 349 void PluginProcessHost::OnChannelCreated( |
350 const IPC::ChannelHandle& channel_handle) { | 350 const IPC::ChannelHandle& channel_handle) { |
351 Client* client = sent_requests_.front(); | 351 Client* client = sent_requests_.front(); |
352 | 352 |
353 client->OnChannelOpened(channel_handle); | 353 client->OnChannelOpened(channel_handle); |
354 sent_requests_.pop(); | 354 sent_requests_.pop(); |
355 } | 355 } |
OLD | NEW |