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

Unified Diff: chrome/common/child_process.h

Issue 155876: Revert r21117 as it caused reliability failures.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 5 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 | « chrome/browser/renderer_host/browser_render_process_host.cc ('k') | chrome/common/child_process.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/child_process.h
===================================================================
--- chrome/common/child_process.h (revision 21215)
+++ chrome/common/child_process.h (working copy)
@@ -7,24 +7,22 @@
#include "base/basictypes.h"
#include "base/scoped_ptr.h"
-#include "base/thread.h"
#include "base/waitable_event.h"
-#include "chrome/common/child_thread.h"
+class ChildThread;
+
// Base class for child processes of the browser process (i.e. renderer and
// plugin host). This is a singleton object for each child process.
class ChildProcess {
public:
- // Child processes should have an object that derives from this class.
- ChildProcess();
+ // Child processes should have an object that derives from this class. The
+ // constructor will return once ChildThread has started.
+ ChildProcess(ChildThread* child_thread);
virtual ~ChildProcess();
- // Getter for the child process' main thread.
- ChildThread* main_thread() { return main_thread_.get(); }
- void set_main_thread(ChildThread* thread) { main_thread_.reset(thread); }
+ // Getter for this process' main thread.
+ ChildThread* child_thread() { return child_thread_.get(); }
- MessageLoop* io_message_loop() { return io_thread_.message_loop(); }
-
// A global event object that is signalled when the main thread's message
// loop exits. This gives background threads a way to observe the main
// thread shutting down. This can be useful when a background thread is
@@ -47,19 +45,15 @@
static ChildProcess* current() { return child_process_; }
private:
+ // NOTE: make sure that child_thread_ is listed before shutdown_event_, since
+ // it depends on it (indirectly through IPC::SyncChannel).
+ scoped_ptr<ChildThread> child_thread_;
+
int ref_count_;
// An event that will be signalled when we shutdown.
base::WaitableEvent shutdown_event_;
- // The thread that handles IO events.
- base::Thread io_thread_;
-
- // NOTE: make sure that main_thread_ is listed after shutdown_event_, since
- // it depends on it (indirectly through IPC::SyncChannel). Same for
- // io_thread_.
- scoped_ptr<ChildThread> main_thread_;
-
// The singleton instance for this process.
static ChildProcess* child_process_;
« no previous file with comments | « chrome/browser/renderer_host/browser_render_process_host.cc ('k') | chrome/common/child_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698