| 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/plugin_service_impl.h" | 5 #include "content/browser/plugin_service_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 | 337 |
| 338 void PluginServiceImpl::OpenChannelToPpapiPlugin( | 338 void PluginServiceImpl::OpenChannelToPpapiPlugin( |
| 339 const FilePath& path, | 339 const FilePath& path, |
| 340 PpapiPluginProcessHost::PluginClient* client) { | 340 PpapiPluginProcessHost::PluginClient* client) { |
| 341 PpapiPluginProcessHost* plugin_host = FindOrStartPpapiPluginProcess( | 341 PpapiPluginProcessHost* plugin_host = FindOrStartPpapiPluginProcess( |
| 342 path, client); | 342 path, client); |
| 343 if (plugin_host) { | 343 if (plugin_host) { |
| 344 plugin_host->OpenChannelToPlugin(client); | 344 plugin_host->OpenChannelToPlugin(client); |
| 345 } else { | 345 } else { |
| 346 // Send error. | 346 // Send error. |
| 347 client->OnPpapiChannelOpened(base::kNullProcessHandle, | 347 client->OnPpapiChannelOpened(IPC::ChannelHandle(), 0); |
| 348 IPC::ChannelHandle(), 0); | |
| 349 } | 348 } |
| 350 } | 349 } |
| 351 | 350 |
| 352 void PluginServiceImpl::OpenChannelToPpapiBroker( | 351 void PluginServiceImpl::OpenChannelToPpapiBroker( |
| 353 const FilePath& path, | 352 const FilePath& path, |
| 354 PpapiPluginProcessHost::BrokerClient* client) { | 353 PpapiPluginProcessHost::BrokerClient* client) { |
| 355 PpapiPluginProcessHost* plugin_host = FindOrStartPpapiBrokerProcess(path); | 354 PpapiPluginProcessHost* plugin_host = FindOrStartPpapiBrokerProcess(path); |
| 356 if (plugin_host) { | 355 if (plugin_host) { |
| 357 plugin_host->OpenChannelToPlugin(client); | 356 plugin_host->OpenChannelToPlugin(client); |
| 358 } else { | 357 } else { |
| 359 // Send error. | 358 // Send error. |
| 360 client->OnPpapiChannelOpened(base::kNullProcessHandle, | 359 client->OnPpapiChannelOpened(IPC::ChannelHandle(), 0); |
| 361 IPC::ChannelHandle(), 0); | |
| 362 } | 360 } |
| 363 } | 361 } |
| 364 | 362 |
| 365 void PluginServiceImpl::CancelOpenChannelToNpapiPlugin( | 363 void PluginServiceImpl::CancelOpenChannelToNpapiPlugin( |
| 366 PluginProcessHost::Client* client) { | 364 PluginProcessHost::Client* client) { |
| 367 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 365 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 368 DCHECK(ContainsKey(pending_plugin_clients_, client)); | 366 DCHECK(ContainsKey(pending_plugin_clients_, client)); |
| 369 pending_plugin_clients_.erase(client); | 367 pending_plugin_clients_.erase(client); |
| 370 } | 368 } |
| 371 | 369 |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 plugin_list_->RegisterInternalPlugin(info, add_at_beginning); | 710 plugin_list_->RegisterInternalPlugin(info, add_at_beginning); |
| 713 } | 711 } |
| 714 | 712 |
| 715 string16 PluginServiceImpl::GetPluginGroupName(const std::string& plugin_name) { | 713 string16 PluginServiceImpl::GetPluginGroupName(const std::string& plugin_name) { |
| 716 return plugin_list_->GetPluginGroupName(plugin_name); | 714 return plugin_list_->GetPluginGroupName(plugin_name); |
| 717 } | 715 } |
| 718 | 716 |
| 719 webkit::npapi::PluginList* PluginServiceImpl::GetPluginList() { | 717 webkit::npapi::PluginList* PluginServiceImpl::GetPluginList() { |
| 720 return plugin_list_; | 718 return plugin_list_; |
| 721 } | 719 } |
| OLD | NEW |