| 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 "base/allocator/allocator_extension.h" | 7 #include "base/allocator/allocator_extension.h" |
| 8 #include "base/base_switches.h" | 8 #include "base/base_switches.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 // NOTE: this also has the side-effect of not closing the main IPC channel to | 188 // NOTE: this also has the side-effect of not closing the main IPC channel to |
| 189 // the browser process. This is needed because this is the signal that the | 189 // the browser process. This is needed because this is the signal that the |
| 190 // browser uses to know that this process has died, so we need it to be alive | 190 // browser uses to know that this process has died, so we need it to be alive |
| 191 // until this process is shut down, and the OS closes the handle | 191 // until this process is shut down, and the OS closes the handle |
| 192 // automatically. We used to watch the object handle on Windows to do this, | 192 // automatically. We used to watch the object handle on Windows to do this, |
| 193 // but it wasn't possible to do so on POSIX. | 193 // but it wasn't possible to do so on POSIX. |
| 194 channel_->ClearIPCTaskRunner(); | 194 channel_->ClearIPCTaskRunner(); |
| 195 g_lazy_tls.Pointer()->Set(NULL); | 195 g_lazy_tls.Pointer()->Set(NULL); |
| 196 } | 196 } |
| 197 | 197 |
| 198 void ChildThread::Shutdown() { |
| 199 // Delete objects that hold references to blink so derived classes can |
| 200 // safely shutdown blink in their Shutdown implementation. |
| 201 file_system_dispatcher_.reset(); |
| 202 } |
| 203 |
| 198 void ChildThread::OnChannelConnected(int32 peer_pid) { | 204 void ChildThread::OnChannelConnected(int32 peer_pid) { |
| 199 channel_connected_factory_.InvalidateWeakPtrs(); | 205 channel_connected_factory_.InvalidateWeakPtrs(); |
| 200 } | 206 } |
| 201 | 207 |
| 202 void ChildThread::OnChannelError() { | 208 void ChildThread::OnChannelError() { |
| 203 set_on_channel_error_called(true); | 209 set_on_channel_error_called(true); |
| 204 base::MessageLoop::current()->Quit(); | 210 base::MessageLoop::current()->Quit(); |
| 205 } | 211 } |
| 206 | 212 |
| 207 bool ChildThread::Send(IPC::Message* msg) { | 213 bool ChildThread::Send(IPC::Message* msg) { |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 // inflight that would addref it. | 394 // inflight that would addref it. |
| 389 Send(new ChildProcessHostMsg_ShutdownRequest); | 395 Send(new ChildProcessHostMsg_ShutdownRequest); |
| 390 } | 396 } |
| 391 | 397 |
| 392 void ChildThread::EnsureConnected() { | 398 void ChildThread::EnsureConnected() { |
| 393 LOG(INFO) << "ChildThread::EnsureConnected()"; | 399 LOG(INFO) << "ChildThread::EnsureConnected()"; |
| 394 base::KillProcess(base::GetCurrentProcessHandle(), 0, false); | 400 base::KillProcess(base::GetCurrentProcessHandle(), 0, false); |
| 395 } | 401 } |
| 396 | 402 |
| 397 } // namespace content | 403 } // namespace content |
| OLD | NEW |