summaryrefslogtreecommitdiffstats
path: root/chrome/common/child_process.h
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-27 20:45:59 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-27 20:45:59 +0000
commit51d70e07bd5d991420bc0f14ff05f1a9b72d02db (patch)
tree718c0b24680c1b14eb4570403cc15b8d09b4002d /chrome/common/child_process.h
parent70ac249f04337f0040ad63a72ced111d87fdc73a (diff)
downloadchromium_src-51d70e07bd5d991420bc0f14ff05f1a9b72d02db.zip
chromium_src-51d70e07bd5d991420bc0f14ff05f1a9b72d02db.tar.gz
chromium_src-51d70e07bd5d991420bc0f14ff05f1a9b72d02db.tar.bz2
Refactor plugin process code which checks with the browser process before shutdown, to avoid races in which the browser process thinks the process is fine to use while it's shutting down. I also removed PluginProcess/WorkerProcess since they didn't have any code in them now.
I removed the plugin process code which waits 10 seconds before shutting itself down. That was a premature optimization, since testing with/without this didn't show any difference (see http://www/~jabdelmalek/chrome/test/plugins/processes.html). In both cases, the plugin on a page would get recreated in less than 100ms, even with reusing or starting a plugin process from scratch. We already spawn new renderer processes on back and forth if it's a different origin, and the plugin will be in the cache anyways. Review URL: http://codereview.chromium.org/53091 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12703 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/child_process.h')
-rw-r--r--chrome/common/child_process.h18
1 files changed, 2 insertions, 16 deletions
diff --git a/chrome/common/child_process.h b/chrome/common/child_process.h
index 5844b5b..23bfad8 100644
--- a/chrome/common/child_process.h
+++ b/chrome/common/child_process.h
@@ -7,7 +7,6 @@
#include <string>
#include <vector>
-#include "base/atomic_ref_count.h"
#include "base/basictypes.h"
#include "base/message_loop.h"
#include "base/scoped_ptr.h"
@@ -40,34 +39,21 @@ class ChildProcess {
base::WaitableEvent* GetShutDownEvent();
// These are used for ref-counting the child process. The process shuts
- // itself down when the ref count reaches 0. These functions may be called
- // on any thread.
+ // itself down when the ref count reaches 0.
// For example, in the renderer process, generally each tab managed by this
// process will hold a reference to the process, and release when closed.
void AddRefProcess();
void ReleaseProcess();
- protected:
- friend class ChildThread;
-
// Getter for the one ChildProcess object for this process.
static ChildProcess* current() { return child_process_; }
- protected:
- bool ProcessRefCountIsZero();
-
- // Derived classes can override this to alter the behavior when the ref count
- // reaches 0. The default implementation calls Quit on the main message loop
- // which causes the process to shutdown. Note, this can be called on any
- // thread. (See ReleaseProcess)
- virtual void OnFinalRelease();
-
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_;
- base::AtomicRefCount ref_count_;
+ int ref_count_;
// An event that will be signalled when we shutdown.
base::WaitableEvent shutdown_event_;