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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 #include "base/location.h" | 13 #include "base/location.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/metrics/histogram_macros.h" | 15 #include "base/metrics/histogram_macros.h" |
16 #include "base/single_thread_task_runner.h" | 16 #include "base/single_thread_task_runner.h" |
17 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
18 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
19 #include "base/synchronization/waitable_event.h" | 19 #include "base/synchronization/waitable_event.h" |
20 #include "base/threading/sequenced_worker_pool.h" | 20 #include "base/task_scheduler/post_task.h" |
21 #include "base/threading/thread.h" | 21 #include "base/threading/thread.h" |
22 #include "base/threading/thread_task_runner_handle.h" | 22 #include "base/threading/thread_task_runner_handle.h" |
23 #include "build/build_config.h" | 23 #include "build/build_config.h" |
24 #include "content/browser/ppapi_plugin_process_host.h" | 24 #include "content/browser/ppapi_plugin_process_host.h" |
25 #include "content/browser/renderer_host/render_process_host_impl.h" | 25 #include "content/browser/renderer_host/render_process_host_impl.h" |
26 #include "content/browser/renderer_host/render_view_host_impl.h" | 26 #include "content/browser/renderer_host/render_view_host_impl.h" |
27 #include "content/common/content_switches_internal.h" | 27 #include "content/common/content_switches_internal.h" |
28 #include "content/common/pepper_plugin_list.h" | 28 #include "content/common/pepper_plugin_list.h" |
29 #include "content/common/plugin_list.h" | 29 #include "content/common/plugin_list.h" |
30 #include "content/common/view_messages.h" | 30 #include "content/common/view_messages.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
90 counted = true; | 90 counted = true; |
91 UMA_HISTOGRAM_ENUMERATION("Plugin.FlashUsage", TOTAL_BROWSER_PROCESSES, | 91 UMA_HISTOGRAM_ENUMERATION("Plugin.FlashUsage", TOTAL_BROWSER_PROCESSES, |
92 FLASH_USAGE_ENUM_COUNT); | 92 FLASH_USAGE_ENUM_COUNT); |
93 } | 93 } |
94 } | 94 } |
95 | 95 |
96 PluginServiceImpl::~PluginServiceImpl() { | 96 PluginServiceImpl::~PluginServiceImpl() { |
97 } | 97 } |
98 | 98 |
99 void PluginServiceImpl::Init() { | 99 void PluginServiceImpl::Init() { |
100 plugin_list_task_runner_ = | 100 plugin_list_task_runner_ = base::CreateSequencedTaskRunnerWithTraits( |
101 BrowserThread::GetBlockingPool() | 101 base::TaskTraits() |
102 ->GetSequencedTaskRunnerWithShutdownBehavior( | 102 .MayBlock() |
103 base::SequencedWorkerPool::GetSequenceToken(), | 103 .WithPriority(base::TaskPriority::BACKGROUND) |
boliu
2017/04/24 18:41:25
probably should be user visible, I assume this is
fdoray
2017/04/26 19:35:07
Done.
| |
104 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); | 104 .WithShutdownBehavior(base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN)); |
105 PluginList::Singleton()->set_will_load_plugins_callback( | 105 PluginList::Singleton()->set_will_load_plugins_callback( |
106 base::Bind(&WillLoadPluginsCallback, &plugin_list_sequence_checker_)); | 106 base::Bind(&WillLoadPluginsCallback, &plugin_list_sequence_checker_)); |
107 | 107 |
108 RegisterPepperPlugins(); | 108 RegisterPepperPlugins(); |
109 } | 109 } |
110 | 110 |
111 PpapiPluginProcessHost* PluginServiceImpl::FindPpapiPluginProcess( | 111 PpapiPluginProcessHost* PluginServiceImpl::FindPpapiPluginProcess( |
112 const base::FilePath& plugin_path, | 112 const base::FilePath& plugin_path, |
113 const base::FilePath& profile_data_directory) { | 113 const base::FilePath& profile_data_directory) { |
114 for (PpapiPluginProcessHostIterator iter; !iter.Done(); ++iter) { | 114 for (PpapiPluginProcessHostIterator iter; !iter.Done(); ++iter) { |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
415 } | 415 } |
416 | 416 |
417 bool PluginServiceImpl::PpapiDevChannelSupported( | 417 bool PluginServiceImpl::PpapiDevChannelSupported( |
418 BrowserContext* browser_context, | 418 BrowserContext* browser_context, |
419 const GURL& document_url) { | 419 const GURL& document_url) { |
420 return GetContentClient()->browser()->IsPluginAllowedToUseDevChannelAPIs( | 420 return GetContentClient()->browser()->IsPluginAllowedToUseDevChannelAPIs( |
421 browser_context, document_url); | 421 browser_context, document_url); |
422 } | 422 } |
423 | 423 |
424 } // namespace content | 424 } // namespace content |
OLD | NEW |