Chromium Code Reviews| 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..082e21866b74a6710bdf3762d4bc32d7301e3015 100644 |
| --- a/content/browser/plugin_loader_posix.cc |
| +++ b/content/browser/plugin_loader_posix.cc |
| @@ -45,7 +45,9 @@ void PluginLoaderPosix::OnProcessCrashed(int exit_code) { |
| canonical_list_.erase(canonical_list_.begin(), |
| canonical_list_.begin() + next_load_index_ + 1); |
| next_load_index_ = 0; |
| - LoadPluginsInternal(); |
| + |
| + if (!MaybeRunPendingCallbacks()) |
| + LoadPluginsInternal(); |
|
Bernhard Bauer
2011/10/24 14:57:08
You could have the check for an empty canonical li
Robert Sesek
2011/10/24 16:44:40
Done.
|
| } |
| bool PluginLoaderPosix::Send(IPC::Message* message) { |
| @@ -106,7 +108,7 @@ void PluginLoaderPosix::OnPluginLoaded(const webkit::WebPluginInfo& plugin) { |
| ++next_load_index_; |
| - RunPendingCallbacks(); |
| + MaybeRunPendingCallbacks(); |
| } |
| void PluginLoaderPosix::OnPluginLoadFailed(const FilePath& plugin_path) { |
| @@ -119,7 +121,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 +138,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 +155,8 @@ void PluginLoaderPosix::RunPendingCallbacks() { |
| (base::TimeTicks::Now() - load_start_time_) |
| * base::Time::kMicrosecondsPerMillisecond); |
| load_start_time_ = base::TimeTicks(); |
| + |
| + return true; |
| } |
| PluginLoaderPosix::PendingCallback::PendingCallback( |