| 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_thread.h" | 5 #include "content/common/child_thread.h" |
| 6 | 6 |
| 7 #include "base/allocator/allocator_extension.h" | 7 #include "base/allocator/allocator_extension.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/process.h" | 10 #include "base/process.h" |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 channel_connected_factory_.InvalidateWeakPtrs(); | 159 channel_connected_factory_.InvalidateWeakPtrs(); |
| 160 } | 160 } |
| 161 | 161 |
| 162 void ChildThread::OnChannelError() { | 162 void ChildThread::OnChannelError() { |
| 163 set_on_channel_error_called(true); | 163 set_on_channel_error_called(true); |
| 164 MessageLoop::current()->Quit(); | 164 MessageLoop::current()->Quit(); |
| 165 } | 165 } |
| 166 | 166 |
| 167 bool ChildThread::Send(IPC::Message* msg) { | 167 bool ChildThread::Send(IPC::Message* msg) { |
| 168 DCHECK(MessageLoop::current() == message_loop()); | 168 DCHECK(MessageLoop::current() == message_loop()); |
| 169 if (!channel_.get()) { | 169 if (!channel_) { |
| 170 delete msg; | 170 delete msg; |
| 171 return false; | 171 return false; |
| 172 } | 172 } |
| 173 | 173 |
| 174 return channel_->Send(msg); | 174 return channel_->Send(msg); |
| 175 } | 175 } |
| 176 | 176 |
| 177 void ChildThread::AddRoute(int32 routing_id, IPC::Listener* listener) { | 177 void ChildThread::AddRoute(int32 routing_id, IPC::Listener* listener) { |
| 178 DCHECK(MessageLoop::current() == message_loop()); | 178 DCHECK(MessageLoop::current() == message_loop()); |
| 179 | 179 |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 // inflight that would addref it. | 351 // inflight that would addref it. |
| 352 Send(new ChildProcessHostMsg_ShutdownRequest); | 352 Send(new ChildProcessHostMsg_ShutdownRequest); |
| 353 } | 353 } |
| 354 | 354 |
| 355 void ChildThread::EnsureConnected() { | 355 void ChildThread::EnsureConnected() { |
| 356 LOG(INFO) << "ChildThread::EnsureConnected()"; | 356 LOG(INFO) << "ChildThread::EnsureConnected()"; |
| 357 base::KillProcess(base::GetCurrentProcessHandle(), 0, false); | 357 base::KillProcess(base::GetCurrentProcessHandle(), 0, false); |
| 358 } | 358 } |
| 359 | 359 |
| 360 } // namespace content | 360 } // namespace content |
| OLD | NEW |