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_loader_posix.h" | 5 #include "content/browser/plugin_loader_posix.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
11 #include "content/browser/utility_process_host_impl.h" | 11 #include "content/browser/utility_process_host_impl.h" |
12 #include "content/common/child_process_host_impl.h" | 12 #include "content/common/child_process_host_impl.h" |
13 #include "content/common/plugin_list.h" | 13 #include "content/common/plugin_list.h" |
14 #include "content/common/utility_messages.h" | 14 #include "content/common/utility_messages.h" |
15 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
| 16 #include "content/public/browser/plugin_service.h" |
16 | 17 |
17 namespace content { | 18 namespace content { |
18 | 19 |
19 PluginLoaderPosix::PluginLoaderPosix() | 20 PluginLoaderPosix::PluginLoaderPosix() |
20 : next_load_index_(0) { | 21 : next_load_index_(0) { |
21 } | 22 } |
22 | 23 |
23 void PluginLoaderPosix::LoadPlugins( | 24 void PluginLoaderPosix::LoadPlugins( |
24 scoped_refptr<base::MessageLoopProxy> target_loop, | 25 scoped_refptr<base::MessageLoopProxy> target_loop, |
25 const PluginService::GetPluginsCallback& callback) { | 26 const PluginService::GetPluginsCallback& callback) { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 69 |
69 void PluginLoaderPosix::GetPluginsToLoad() { | 70 void PluginLoaderPosix::GetPluginsToLoad() { |
70 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 71 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
71 | 72 |
72 base::TimeTicks start_time(base::TimeTicks::Now()); | 73 base::TimeTicks start_time(base::TimeTicks::Now()); |
73 | 74 |
74 loaded_plugins_.clear(); | 75 loaded_plugins_.clear(); |
75 next_load_index_ = 0; | 76 next_load_index_ = 0; |
76 | 77 |
77 canonical_list_.clear(); | 78 canonical_list_.clear(); |
78 PluginList::Singleton()->GetPluginPathsToLoad(&canonical_list_); | 79 PluginList::Singleton()->GetPluginPathsToLoad( |
| 80 &canonical_list_, |
| 81 PluginService::GetInstance()->NPAPIPluginsSupported()); |
79 | 82 |
80 internal_plugins_.clear(); | 83 internal_plugins_.clear(); |
81 PluginList::Singleton()->GetInternalPlugins(&internal_plugins_); | 84 PluginList::Singleton()->GetInternalPlugins(&internal_plugins_); |
82 | 85 |
83 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 86 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
84 base::Bind(&PluginLoaderPosix::LoadPluginsInternal, | 87 base::Bind(&PluginLoaderPosix::LoadPluginsInternal, |
85 make_scoped_refptr(this))); | 88 make_scoped_refptr(this))); |
86 | 89 |
87 HISTOGRAM_TIMES("PluginLoaderPosix.GetPluginList", | 90 HISTOGRAM_TIMES("PluginLoaderPosix.GetPluginList", |
88 (base::TimeTicks::Now() - start_time) * | 91 (base::TimeTicks::Now() - start_time) * |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 scoped_refptr<base::MessageLoopProxy> loop, | 193 scoped_refptr<base::MessageLoopProxy> loop, |
191 const PluginService::GetPluginsCallback& cb) | 194 const PluginService::GetPluginsCallback& cb) |
192 : target_loop(loop), | 195 : target_loop(loop), |
193 callback(cb) { | 196 callback(cb) { |
194 } | 197 } |
195 | 198 |
196 PluginLoaderPosix::PendingCallback::~PendingCallback() { | 199 PluginLoaderPosix::PendingCallback::~PendingCallback() { |
197 } | 200 } |
198 | 201 |
199 } // namespace content | 202 } // namespace content |
OLD | NEW |