| 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/browser/utility_process_host_impl.h" | 5 #include "content/browser/utility_process_host_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 run_elevated_(false), | 103 run_elevated_(false), |
| 104 #if defined(OS_LINUX) | 104 #if defined(OS_LINUX) |
| 105 child_flags_(ChildProcessHost::CHILD_ALLOW_SELF), | 105 child_flags_(ChildProcessHost::CHILD_ALLOW_SELF), |
| 106 #else | 106 #else |
| 107 child_flags_(ChildProcessHost::CHILD_NORMAL), | 107 child_flags_(ChildProcessHost::CHILD_NORMAL), |
| 108 #endif | 108 #endif |
| 109 started_(false) { | 109 started_(false) { |
| 110 } | 110 } |
| 111 | 111 |
| 112 UtilityProcessHostImpl::~UtilityProcessHostImpl() { | 112 UtilityProcessHostImpl::~UtilityProcessHostImpl() { |
| 113 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 113 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 114 if (is_batch_mode_) | 114 if (is_batch_mode_) |
| 115 EndBatchMode(); | 115 EndBatchMode(); |
| 116 | 116 |
| 117 // We could be destroyed as a result of Chrome shutdown. When that happens, | 117 // We could be destroyed as a result of Chrome shutdown. When that happens, |
| 118 // the Mojo channel doesn't get the opportunity to shut down cleanly because | 118 // the Mojo channel doesn't get the opportunity to shut down cleanly because |
| 119 // it posts to the IO thread (the current thread) which is being destroyed. | 119 // it posts to the IO thread (the current thread) which is being destroyed. |
| 120 // To guarantee proper shutdown of the Mojo channel, do it explicitly here. | 120 // To guarantee proper shutdown of the Mojo channel, do it explicitly here. |
| 121 if (mojo_application_host_) | 121 if (mojo_application_host_) |
| 122 mojo_application_host_->ShutdownOnIOThread(); | 122 mojo_application_host_->ShutdownOnIOThread(); |
| 123 } | 123 } |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 if (RenderProcessHost::run_renderer_in_process()) | 322 if (RenderProcessHost::run_renderer_in_process()) |
| 323 handle = base::GetCurrentProcessHandle(); | 323 handle = base::GetCurrentProcessHandle(); |
| 324 else | 324 else |
| 325 handle = process_->GetData().handle; | 325 handle = process_->GetData().handle; |
| 326 | 326 |
| 327 mojo_application_host_->Activate(this, handle); | 327 mojo_application_host_->Activate(this, handle); |
| 328 } | 328 } |
| 329 } | 329 } |
| 330 | 330 |
| 331 } // namespace content | 331 } // namespace content |
| OLD | NEW |