| 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/child/child_thread.h" | 5 #include "content/child/child_thread.h" |
| 6 | 6 |
| 7 #include <signal.h> | 7 #include <signal.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 159 |
| 160 // A lock protects g_child_thread. | 160 // A lock protects g_child_thread. |
| 161 base::LazyInstance<base::Lock> g_lazy_child_thread_lock = | 161 base::LazyInstance<base::Lock> g_lazy_child_thread_lock = |
| 162 LAZY_INSTANCE_INITIALIZER; | 162 LAZY_INSTANCE_INITIALIZER; |
| 163 | 163 |
| 164 // base::ConditionVariable has an explicit constructor that takes | 164 // base::ConditionVariable has an explicit constructor that takes |
| 165 // a base::Lock pointer as parameter. The base::DefaultLazyInstanceTraits | 165 // a base::Lock pointer as parameter. The base::DefaultLazyInstanceTraits |
| 166 // doesn't handle the case. Thus, we need our own class here. | 166 // doesn't handle the case. Thus, we need our own class here. |
| 167 struct CondVarLazyInstanceTraits { | 167 struct CondVarLazyInstanceTraits { |
| 168 static const bool kRegisterOnExit = true; | 168 static const bool kRegisterOnExit = true; |
| 169 static const bool kAllowedToAccessOnNonjoinableThread ALLOW_UNUSED = false; | 169 #ifndef NDEBUG |
| 170 static const bool kAllowedToAccessOnNonjoinableThread = false; |
| 171 #endif |
| 172 |
| 170 static base::ConditionVariable* New(void* instance) { | 173 static base::ConditionVariable* New(void* instance) { |
| 171 return new (instance) base::ConditionVariable( | 174 return new (instance) base::ConditionVariable( |
| 172 g_lazy_child_thread_lock.Pointer()); | 175 g_lazy_child_thread_lock.Pointer()); |
| 173 } | 176 } |
| 174 static void Delete(base::ConditionVariable* instance) { | 177 static void Delete(base::ConditionVariable* instance) { |
| 175 instance->~ConditionVariable(); | 178 instance->~ConditionVariable(); |
| 176 } | 179 } |
| 177 }; | 180 }; |
| 178 | 181 |
| 179 // A condition variable that synchronize threads initializing and waiting | 182 // A condition variable that synchronize threads initializing and waiting |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 // inflight that would addref it. | 532 // inflight that would addref it. |
| 530 Send(new ChildProcessHostMsg_ShutdownRequest); | 533 Send(new ChildProcessHostMsg_ShutdownRequest); |
| 531 } | 534 } |
| 532 | 535 |
| 533 void ChildThread::EnsureConnected() { | 536 void ChildThread::EnsureConnected() { |
| 534 VLOG(0) << "ChildThread::EnsureConnected()"; | 537 VLOG(0) << "ChildThread::EnsureConnected()"; |
| 535 base::KillProcess(base::GetCurrentProcessHandle(), 0, false); | 538 base::KillProcess(base::GetCurrentProcessHandle(), 0, false); |
| 536 } | 539 } |
| 537 | 540 |
| 538 } // namespace content | 541 } // namespace content |
| OLD | NEW |