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

Unified Diff: content/browser/plugin_loader_posix.cc

Issue 8372015: [Linux] Load plugins out-of-process. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: '' Created 9 years, 2 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 e27e543aa5805f61180657228845a94587947ce9..a68e9fe09c995daf07f07fad91fa4b13acc03a83 100644
--- a/content/browser/plugin_loader_posix.cc
+++ b/content/browser/plugin_loader_posix.cc
@@ -45,6 +45,7 @@ void PluginLoaderPosix::OnProcessCrashed(int exit_code) {
canonical_list_.erase(canonical_list_.begin(),
canonical_list_.begin() + next_load_index_ + 1);
next_load_index_ = 0;
+
LoadPluginsInternal();
}
@@ -82,6 +83,11 @@ void PluginLoaderPosix::GetPluginsToLoad() {
void PluginLoaderPosix::LoadPluginsInternal() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ // Check if the list is empty or all plugins have already been loaded before
+ // forking.
+ if (MaybeRunPendingCallbacks())
+ return;
+
if (load_start_time_.is_null())
load_start_time_ = base::TimeTicks::Now();
@@ -106,7 +112,7 @@ void PluginLoaderPosix::OnPluginLoaded(const webkit::WebPluginInfo& plugin) {
++next_load_index_;
- RunPendingCallbacks();
+ MaybeRunPendingCallbacks();
}
void PluginLoaderPosix::OnPluginLoadFailed(const FilePath& plugin_path) {
@@ -119,7 +125,7 @@ void PluginLoaderPosix::OnPluginLoadFailed(const FilePath& plugin_path) {
++next_load_index_;
MaybeAddInternalPlugin(plugin_path);
- RunPendingCallbacks();
+ MaybeRunPendingCallbacks();
}
bool PluginLoaderPosix::MaybeAddInternalPlugin(const FilePath& plugin_path) {
@@ -136,9 +142,9 @@ bool PluginLoaderPosix::MaybeAddInternalPlugin(const FilePath& plugin_path) {
return false;
}
-void PluginLoaderPosix::RunPendingCallbacks() {
+bool PluginLoaderPosix::MaybeRunPendingCallbacks() {
if (next_load_index_ < canonical_list_.size())
- return;
+ return false;
PluginList::Singleton()->SetPlugins(loaded_plugins_);
for (std::vector<PendingCallback>::iterator it = callbacks_.begin();
@@ -153,6 +159,8 @@ void PluginLoaderPosix::RunPendingCallbacks() {
(base::TimeTicks::Now() - load_start_time_)
* base::Time::kMicrosecondsPerMillisecond);
load_start_time_ = base::TimeTicks();
+
+ return true;
}
PluginLoaderPosix::PendingCallback::PendingCallback(
« 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