| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/common/child_process.h" | 5 #include "content/common/child_process.h" |
| 6 | 6 |
| 7 #if defined(OS_POSIX) && !defined(OS_ANDROID) | 7 #if defined(OS_POSIX) && !defined(OS_ANDROID) |
| 8 #include <signal.h> // For SigUSR1Handler below. | 8 #include <signal.h> // For SigUSR1Handler below. |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 } | 91 } |
| 92 | 92 |
| 93 void ChildProcess::ReleaseProcess() { | 93 void ChildProcess::ReleaseProcess() { |
| 94 DCHECK(!main_thread_.get() || // null in unittests. | 94 DCHECK(!main_thread_.get() || // null in unittests. |
| 95 MessageLoop::current() == main_thread_->message_loop()); | 95 MessageLoop::current() == main_thread_->message_loop()); |
| 96 DCHECK(ref_count_); | 96 DCHECK(ref_count_); |
| 97 DCHECK(child_process_); | 97 DCHECK(child_process_); |
| 98 if (--ref_count_) | 98 if (--ref_count_) |
| 99 return; | 99 return; |
| 100 | 100 |
| 101 if (main_thread_.get()) // null in unittests. | 101 if (main_thread_) // null in unittests. |
| 102 main_thread_->OnProcessFinalRelease(); | 102 main_thread_->OnProcessFinalRelease(); |
| 103 } | 103 } |
| 104 | 104 |
| 105 base::WaitableEvent* ChildProcess::GetShutDownEvent() { | 105 base::WaitableEvent* ChildProcess::GetShutDownEvent() { |
| 106 DCHECK(child_process_); | 106 DCHECK(child_process_); |
| 107 return &child_process_->shutdown_event_; | 107 return &child_process_->shutdown_event_; |
| 108 } | 108 } |
| 109 | 109 |
| 110 void ChildProcess::WaitForDebugger(const std::string& label) { | 110 void ChildProcess::WaitForDebugger(const std::string& label) { |
| 111 #if defined(OS_WIN) | 111 #if defined(OS_WIN) |
| (...skipping 28 matching lines...) Expand all Loading... |
| 140 memset(&sa, 0, sizeof(sa)); | 140 memset(&sa, 0, sizeof(sa)); |
| 141 sa.sa_handler = SigUSR1Handler; | 141 sa.sa_handler = SigUSR1Handler; |
| 142 sigaction(SIGUSR1, &sa, NULL); | 142 sigaction(SIGUSR1, &sa, NULL); |
| 143 | 143 |
| 144 pause(); | 144 pause(); |
| 145 #endif // defined(OS_ANDROID) | 145 #endif // defined(OS_ANDROID) |
| 146 #endif // defined(OS_POSIX) | 146 #endif // defined(OS_POSIX) |
| 147 } | 147 } |
| 148 | 148 |
| 149 } // namespace content | 149 } // namespace content |
| OLD | NEW |