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

Unified Diff: content/browser/plugin_loader_posix.h

Issue 718523002: Fix a bug that would cause the plugin_loader to stall. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from avi. Created 6 years, 1 month 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 | « no previous file | content/browser/plugin_loader_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/plugin_loader_posix.h
diff --git a/content/browser/plugin_loader_posix.h b/content/browser/plugin_loader_posix.h
index 5b1580c17fa0e968b0feda0cdeb5099c11150fea..3a50bcd496ccb5288334f3169800dd4db4d88e9a 100644
--- a/content/browser/plugin_loader_posix.h
+++ b/content/browser/plugin_loader_posix.h
@@ -56,6 +56,7 @@ class CONTENT_EXPORT PluginLoaderPosix
// UtilityProcessHostClient:
void OnProcessCrashed(int exit_code) override;
+ void OnProcessLaunchFailed() override;
bool OnMessageReceived(const IPC::Message& message) override;
// IPC::Sender:
@@ -80,15 +81,27 @@ class CONTENT_EXPORT PluginLoaderPosix
void OnPluginLoaded(uint32 index, const WebPluginInfo& plugin);
void OnPluginLoadFailed(uint32 index, const base::FilePath& plugin_path);
- // Checks if the plugin path is an internal plugin, and, if it is, adds it to
- // |loaded_plugins_|.
- bool MaybeAddInternalPlugin(const base::FilePath& plugin_path);
+ // Returns an iterator to the plugin in |internal_plugins_| whose path
+ // matches |plugin_path|.
+ std::vector<WebPluginInfo>::iterator FindInternalPlugin(
+ const base::FilePath& plugin_path);
// Runs all the registered callbacks on each's target loop if the condition
// for ending the load process is done (i.e. the |next_load_index_| is outside
// the range of the |canonical_list_|).
bool MaybeRunPendingCallbacks();
+ // Returns true if there are no plugins left to load.
+ bool IsFinishedLoadingPlugins();
+
+ // This method should be called when the plugins are finished loading.
+ // It updates the PluginList's list of plugins, and runs the queued callbacks.
+ void FinishedLoadingPlugins();
+
+ // Launches the utility process that loads the plugins.
+ // Virtual for testing.
+ virtual bool LaunchUtilityProcess();
+
// The process host for which this is a client.
base::WeakPtr<UtilityProcessHost> process_host_;
@@ -110,8 +123,8 @@ class CONTENT_EXPORT PluginLoaderPosix
// plugin loading process has been completed.
std::vector<PluginService::GetPluginsCallback> callbacks_;
- // The time at which plugin loading started.
- base::TimeTicks load_start_time_;
+ // True if there is (or is about to be) a utility process that loads plugins.
+ bool loading_plugins_;
friend class MockPluginLoaderPosix;
DISALLOW_COPY_AND_ASSIGN(PluginLoaderPosix);
« no previous file with comments | « no previous file | content/browser/plugin_loader_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698