| 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(
|
|
|