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.h" | 8 #include "base/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" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
68 | 68 |
69 void PluginLoaderPosix::GetPluginsToLoad() { | 69 void PluginLoaderPosix::GetPluginsToLoad() { |
70 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 70 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
71 | 71 |
72 base::TimeTicks start_time(base::TimeTicks::Now()); | 72 base::TimeTicks start_time(base::TimeTicks::Now()); |
73 | 73 |
74 loaded_plugins_.clear(); | 74 loaded_plugins_.clear(); |
75 next_load_index_ = 0; | 75 next_load_index_ = 0; |
76 | 76 |
77 canonical_list_.clear(); | 77 canonical_list_.clear(); |
78 PluginServiceImpl::GetInstance()->GetPluginList()->GetPluginPathsToLoad( | 78 webkit::npapi::PluginList::Singleton()->GetPluginPathsToLoad( |
Bernhard Bauer
2013/07/17 15:59:52
Is this related to this change?
jam
2013/07/17 16:02:16
yep, I removed PluginService::GetPluginList since
Bernhard Bauer
2013/07/17 16:06:33
But... it's used by this class, no? :)
The least-
jam
2013/07/17 16:10:43
My plan is to remove MockPluginList since most of
| |
79 &canonical_list_); | 79 &canonical_list_); |
80 | 80 |
81 internal_plugins_.clear(); | 81 internal_plugins_.clear(); |
82 PluginServiceImpl::GetInstance()->GetPluginList()->GetInternalPlugins( | 82 webkit::npapi::PluginList::Singleton()->GetInternalPlugins( |
83 &internal_plugins_); | 83 &internal_plugins_); |
84 | 84 |
85 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 85 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
86 base::Bind(&PluginLoaderPosix::LoadPluginsInternal, | 86 base::Bind(&PluginLoaderPosix::LoadPluginsInternal, |
87 make_scoped_refptr(this))); | 87 make_scoped_refptr(this))); |
88 | 88 |
89 HISTOGRAM_TIMES("PluginLoaderPosix.GetPluginList", | 89 HISTOGRAM_TIMES("PluginLoaderPosix.GetPluginList", |
90 (base::TimeTicks::Now() - start_time) * | 90 (base::TimeTicks::Now() - start_time) * |
91 base::Time::kMicrosecondsPerMillisecond); | 91 base::Time::kMicrosecondsPerMillisecond); |
92 } | 92 } |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
156 return true; | 156 return true; |
157 } | 157 } |
158 } | 158 } |
159 return false; | 159 return false; |
160 } | 160 } |
161 | 161 |
162 bool PluginLoaderPosix::MaybeRunPendingCallbacks() { | 162 bool PluginLoaderPosix::MaybeRunPendingCallbacks() { |
163 if (next_load_index_ < canonical_list_.size()) | 163 if (next_load_index_ < canonical_list_.size()) |
164 return false; | 164 return false; |
165 | 165 |
166 PluginServiceImpl::GetInstance()->GetPluginList()->SetPlugins( | 166 webkit::npapi::PluginList::Singleton()->SetPlugins(loaded_plugins_); |
167 loaded_plugins_); | |
168 | 167 |
169 // Only call the first callback with loaded plugins because there may be | 168 // Only call the first callback with loaded plugins because there may be |
170 // some extra plugin paths added since the first callback is added. | 169 // some extra plugin paths added since the first callback is added. |
171 if (!callbacks_.empty()) { | 170 if (!callbacks_.empty()) { |
172 PendingCallback callback = callbacks_.front(); | 171 PendingCallback callback = callbacks_.front(); |
173 callbacks_.pop_front(); | 172 callbacks_.pop_front(); |
174 callback.target_loop->PostTask( | 173 callback.target_loop->PostTask( |
175 FROM_HERE, | 174 FROM_HERE, |
176 base::Bind(callback.callback, loaded_plugins_)); | 175 base::Bind(callback.callback, loaded_plugins_)); |
177 } | 176 } |
(...skipping 15 matching lines...) Expand all Loading... | |
193 scoped_refptr<base::MessageLoopProxy> loop, | 192 scoped_refptr<base::MessageLoopProxy> loop, |
194 const PluginService::GetPluginsCallback& cb) | 193 const PluginService::GetPluginsCallback& cb) |
195 : target_loop(loop), | 194 : target_loop(loop), |
196 callback(cb) { | 195 callback(cb) { |
197 } | 196 } |
198 | 197 |
199 PluginLoaderPosix::PendingCallback::~PendingCallback() { | 198 PluginLoaderPosix::PendingCallback::~PendingCallback() { |
200 } | 199 } |
201 | 200 |
202 } // namespace content | 201 } // namespace content |
OLD | NEW |