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

Unified Diff: content/common/child_process.cc

Issue 15403002: Remving global statics from the headers, so we can split-link. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: adding export Created 7 years, 7 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 | « content/common/child_process.h ('k') | ppapi/shared_impl/ppapi_globals.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/child_process.cc
diff --git a/content/common/child_process.cc b/content/common/child_process.cc
index 95bc331e077a7670d7edbf5f27243a2fadf98b39..8686356287047c677d976bc6b04589b45c2af8eb 100644
--- a/content/common/child_process.cc
+++ b/content/common/child_process.cc
@@ -27,8 +27,8 @@ static void SigUSR1Handler(int signal) { }
#endif
namespace content {
-
-ChildProcess* ChildProcess::child_process_;
+// The singleton instance for this process.
+ChildProcess* child_process = NULL;
#if defined(OS_ANDROID)
// TODO(epenner): Move thread priorities to base. (crbug.com/170549)
@@ -44,8 +44,8 @@ ChildProcess::ChildProcess()
: ref_count_(0),
shutdown_event_(true, false),
io_thread_("Chrome_ChildIOThread") {
- DCHECK(!child_process_);
- child_process_ = this;
+ DCHECK(!child_process);
+ child_process = this;
base::StatisticsRecorder::Initialize();
@@ -61,7 +61,7 @@ ChildProcess::ChildProcess()
}
ChildProcess::~ChildProcess() {
- DCHECK(child_process_ == this);
+ DCHECK(child_process == this);
// Signal this event before destroying the child process. That way all
// background threads can cleanup.
@@ -69,14 +69,14 @@ ChildProcess::~ChildProcess() {
// notice shutdown before the render process begins waiting for them to exit.
shutdown_event_.Signal();
- // Kill the main thread object before nulling child_process_, since
+ // Kill the main thread object before nulling child_process, since
// destruction code might depend on it.
if (main_thread_) { // null in unittests.
main_thread_->Shutdown();
main_thread_.reset();
}
- child_process_ = NULL;
+ child_process = NULL;
}
ChildThread* ChildProcess::main_thread() {
@@ -97,7 +97,7 @@ void ChildProcess::ReleaseProcess() {
DCHECK(!main_thread_.get() || // null in unittests.
base::MessageLoop::current() == main_thread_->message_loop());
DCHECK(ref_count_);
- DCHECK(child_process_);
+ DCHECK(child_process);
if (--ref_count_)
return;
@@ -105,9 +105,13 @@ void ChildProcess::ReleaseProcess() {
main_thread_->OnProcessFinalRelease();
}
+ChildProcess* ChildProcess::current() {
+ return child_process;
+}
+
base::WaitableEvent* ChildProcess::GetShutDownEvent() {
- DCHECK(child_process_);
- return &child_process_->shutdown_event_;
+ DCHECK(child_process);
+ return &child_process->shutdown_event_;
}
void ChildProcess::WaitForDebugger(const std::string& label) {
« no previous file with comments | « content/common/child_process.h ('k') | ppapi/shared_impl/ppapi_globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698