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

Unified Diff: webkit/default_plugin/plugin_install_job_monitor.h

Issue 18824: thread.cc race fix take 2 (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 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
Index: webkit/default_plugin/plugin_install_job_monitor.h
===================================================================
--- webkit/default_plugin/plugin_install_job_monitor.h (revision 8505)
+++ webkit/default_plugin/plugin_install_job_monitor.h (working copy)
@@ -9,12 +9,15 @@
#include "base/logging.h"
#include "base/thread.h"
+#include "base/ref_counted.h"
// Provides the plugin installation job monitoring functionality.
// The PluginInstallationJobMonitorThread class represents a background
// thread which monitors the install job completion port which is associated
// with the job when an instance of this class is initialized.
-class PluginInstallationJobMonitorThread : public base::Thread {
+class PluginInstallationJobMonitorThread : public base::Thread,
+ public base::RefCountedThreadSafe<PluginInstallationJobMonitorThread> {
jeremy 2009/01/26 23:00:34 Also 4 spaces. Personally, I'd actually format th
John Grabowski 2009/01/27 00:31:25 Reformatted.
+
public:
PluginInstallationJobMonitorThread();
virtual ~PluginInstallationJobMonitorThread();
@@ -46,10 +49,16 @@
bool AssignProcessToJob(HANDLE process_handle);
protected:
+ // Installs a task on our thread to call WaitForJobThread(). We
+ // can't call it directly since we would deadlock (thread which
+ // creates me blocks until Start() returns, and Start() doesn't
+ // return until Init() does).
+ virtual void Init();
+
// Blocks on the plugin installation job completion port by invoking the
// GetQueuedCompletionStatus API.
// We return from this function when the job monitoring thread is stopped.
- virtual void Init();
+ virtual void WaitForJobThread();
private:
// The install job completion port. Created in Init.

Powered by Google App Engine
This is Rietveld 408576698