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

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

Issue 19518006: Remove the two years old code to enable the nacl plugin once if it's disabled. This was added to de… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 5 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
« no previous file with comments | « chrome/common/pref_names.cc ('k') | content/browser/plugin_service_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_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
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
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
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
OLDNEW
« no previous file with comments | « chrome/common/pref_names.cc ('k') | content/browser/plugin_service_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698