OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 base::FilePath(), | 246 base::FilePath(), |
247 false /* in_process */, | 247 false /* in_process */, |
248 false /* external_plugin */)); | 248 false /* external_plugin */)); |
249 } | 249 } |
250 | 250 |
251 bool PpapiPluginProcessHost::Init(const PepperPluginInfo& info) { | 251 bool PpapiPluginProcessHost::Init(const PepperPluginInfo& info) { |
252 plugin_path_ = info.path; | 252 plugin_path_ = info.path; |
253 if (info.name.empty()) { | 253 if (info.name.empty()) { |
254 process_->SetName(plugin_path_.BaseName().LossyDisplayName()); | 254 process_->SetName(plugin_path_.BaseName().LossyDisplayName()); |
255 } else { | 255 } else { |
256 process_->SetName(UTF8ToUTF16(info.name)); | 256 process_->SetName(base::UTF8ToUTF16(info.name)); |
257 } | 257 } |
258 | 258 |
259 std::string channel_id = process_->GetHost()->CreateChannel(); | 259 std::string channel_id = process_->GetHost()->CreateChannel(); |
260 if (channel_id.empty()) { | 260 if (channel_id.empty()) { |
261 VLOG(1) << "Could not create pepper host channel."; | 261 VLOG(1) << "Could not create pepper host channel."; |
262 return false; | 262 return false; |
263 } | 263 } |
264 | 264 |
265 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); | 265 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); |
266 CommandLine::StringType plugin_launcher = | 266 CommandLine::StringType plugin_launcher = |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 // sent_requests_ queue should be the one that the plugin just created. | 436 // sent_requests_ queue should be the one that the plugin just created. |
437 Client* client = sent_requests_.front(); | 437 Client* client = sent_requests_.front(); |
438 sent_requests_.pop(); | 438 sent_requests_.pop(); |
439 | 439 |
440 const ChildProcessData& data = process_->GetData(); | 440 const ChildProcessData& data = process_->GetData(); |
441 client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle), | 441 client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle), |
442 data.id); | 442 data.id); |
443 } | 443 } |
444 | 444 |
445 } // namespace content | 445 } // namespace content |
OLD | NEW |