Chromium Code Reviews| 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/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 322 NOTREACHED(); // Init is not expected to fail. | 322 NOTREACHED(); // Init is not expected to fail. |
| 323 return NULL; | 323 return NULL; |
| 324 } | 324 } |
| 325 return new_host.release(); | 325 return new_host.release(); |
| 326 } | 326 } |
| 327 | 327 |
| 328 PpapiPluginProcessHost* PluginServiceImpl::FindOrStartPpapiPluginProcess( | 328 PpapiPluginProcessHost* PluginServiceImpl::FindOrStartPpapiPluginProcess( |
| 329 int render_process_id, | 329 int render_process_id, |
| 330 const base::FilePath& plugin_path, | 330 const base::FilePath& plugin_path, |
| 331 const base::FilePath& profile_data_directory, | 331 const base::FilePath& profile_data_directory, |
| 332 PpapiPluginProcessHost::PluginClient* client) { | 332 PpapiPluginProcessHost::PluginClient* client) { |
|
yzshen1
2013/08/16 20:40:42
This parameter is not needed any more.
ygorshenin1
2013/08/19 14:33:35
Done.
| |
| 333 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 333 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 334 | 334 |
| 335 if (filter_ && !filter_->CanLoadPlugin(render_process_id, plugin_path)) | 335 if (filter_ && !filter_->CanLoadPlugin(render_process_id, plugin_path)) |
| 336 return NULL; | 336 return NULL; |
| 337 | 337 |
| 338 PpapiPluginProcessHost* plugin_host = | 338 PpapiPluginProcessHost* plugin_host = |
| 339 FindPpapiPluginProcess(plugin_path, profile_data_directory); | 339 FindPpapiPluginProcess(plugin_path, profile_data_directory); |
| 340 if (plugin_host) | 340 if (plugin_host) |
| 341 return plugin_host; | 341 return plugin_host; |
| 342 | 342 |
| 343 // Validate that the plugin is actually registered. | 343 // Validate that the plugin is actually registered. |
| 344 PepperPluginInfo* info = GetRegisteredPpapiPluginInfo(plugin_path); | 344 PepperPluginInfo* info = GetRegisteredPpapiPluginInfo(plugin_path); |
| 345 if (!info) | 345 if (!info) |
| 346 return NULL; | 346 return NULL; |
| 347 | 347 |
| 348 // Record when PPAPI Flash process is started for the first time. | 348 // Record when PPAPI Flash process is started for the first time. |
| 349 static bool counted = false; | 349 static bool counted = false; |
| 350 if (!counted && info->name == kFlashPluginName) { | 350 if (!counted && info->name == kFlashPluginName) { |
| 351 counted = true; | 351 counted = true; |
| 352 UMA_HISTOGRAM_ENUMERATION("Plugin.FlashUsage", | 352 UMA_HISTOGRAM_ENUMERATION("Plugin.FlashUsage", |
| 353 START_PPAPI_FLASH_AT_LEAST_ONCE, | 353 START_PPAPI_FLASH_AT_LEAST_ONCE, |
| 354 FLASH_USAGE_ENUM_COUNT); | 354 FLASH_USAGE_ENUM_COUNT); |
| 355 } | 355 } |
| 356 | 356 |
| 357 // This plugin isn't loaded by any plugin process, so create a new process. | 357 // This plugin isn't loaded by any plugin process, so create a new process. |
| 358 return PpapiPluginProcessHost::CreatePluginHost( | 358 return PpapiPluginProcessHost::CreatePluginHost( |
| 359 *info, profile_data_directory, | 359 *info, profile_data_directory); |
| 360 client->GetResourceContext()->GetHostResolver()); | |
| 361 } | 360 } |
| 362 | 361 |
| 363 PpapiPluginProcessHost* PluginServiceImpl::FindOrStartPpapiBrokerProcess( | 362 PpapiPluginProcessHost* PluginServiceImpl::FindOrStartPpapiBrokerProcess( |
| 364 int render_process_id, | 363 int render_process_id, |
| 365 const base::FilePath& plugin_path) { | 364 const base::FilePath& plugin_path) { |
| 366 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 365 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 367 | 366 |
| 368 if (filter_ && !filter_->CanLoadPlugin(render_process_id, plugin_path)) | 367 if (filter_ && !filter_->CanLoadPlugin(render_process_id, plugin_path)) |
| 369 return NULL; | 368 return NULL; |
| 370 | 369 |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 837 window, kPluginVersionAtomProperty, plugin_version); | 836 window, kPluginVersionAtomProperty, plugin_version); |
| 838 return true; | 837 return true; |
| 839 } | 838 } |
| 840 | 839 |
| 841 bool PluginServiceImpl::IsPluginWindow(HWND window) { | 840 bool PluginServiceImpl::IsPluginWindow(HWND window) { |
| 842 return ui::GetClassName(window) == base::string16(kNativeWindowClassName); | 841 return ui::GetClassName(window) == base::string16(kNativeWindowClassName); |
| 843 } | 842 } |
| 844 #endif | 843 #endif |
| 845 | 844 |
| 846 } // namespace content | 845 } // namespace content |
| OLD | NEW |