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

Unified Diff: content/browser/plugin_loader_posix.cc

Issue 9665017: PluginLoader loads plugins again after last load completes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove logs Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/plugin_loader_posix.h ('k') | content/browser/plugin_loader_posix_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/plugin_loader_posix.cc
diff --git a/content/browser/plugin_loader_posix.cc b/content/browser/plugin_loader_posix.cc
index 58525d824ee6d0acc8cdfb8591fefefaea975e7c..a0cd63938caa7124d2c55da4329524ee61ba99f5 100644
--- a/content/browser/plugin_loader_posix.cc
+++ b/content/browser/plugin_loader_posix.cc
@@ -164,19 +164,27 @@ bool PluginLoaderPosix::MaybeRunPendingCallbacks() {
PluginServiceImpl::GetInstance()->GetPluginList()->SetPlugins(
loaded_plugins_);
- for (std::vector<PendingCallback>::iterator it = callbacks_.begin();
- it != callbacks_.end();
- ++it) {
- it->target_loop->PostTask(FROM_HERE,
- base::Bind(it->callback, loaded_plugins_));
+
+ // Only call the first callback with loaded plugins because there may be
+ // some extra plugin paths added since the first callback is added.
+ if (!callbacks_.empty()) {
+ PendingCallback callback = callbacks_.front();
+ callbacks_.pop_front();
+ callback.target_loop->PostTask(
+ FROM_HERE,
+ base::Bind(callback.callback, loaded_plugins_));
}
- callbacks_.clear();
HISTOGRAM_TIMES("PluginLoaderPosix.LoadDone",
(base::TimeTicks::Now() - load_start_time_)
* base::Time::kMicrosecondsPerMillisecond);
load_start_time_ = base::TimeTicks();
+ if (!callbacks_.empty()) {
+ BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
+ base::Bind(&PluginLoaderPosix::GetPluginsToLoad, this));
+ return false;
+ }
return true;
}
« no previous file with comments | « content/browser/plugin_loader_posix.h ('k') | content/browser/plugin_loader_posix_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698