Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Side by Side Diff: content/browser/plugin_service_impl.cc

Issue 10378057: Broker out PPAPI handle duplication (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « content/browser/plugin_data_remover_impl.cc ('k') | content/browser/ppapi_plugin_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698