| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 #if defined(OS_LINUX) | 161 #if defined(OS_LINUX) |
| 162 child_flags_(ChildProcessHost::CHILD_ALLOW_SELF), | 162 child_flags_(ChildProcessHost::CHILD_ALLOW_SELF), |
| 163 #else | 163 #else |
| 164 child_flags_(ChildProcessHost::CHILD_NORMAL), | 164 child_flags_(ChildProcessHost::CHILD_NORMAL), |
| 165 #endif | 165 #endif |
| 166 started_(false), | 166 started_(false), |
| 167 name_(base::ASCIIToUTF16("utility process")), | 167 name_(base::ASCIIToUTF16("utility process")), |
| 168 child_token_(mojo::edk::GenerateRandomToken()), | 168 child_token_(mojo::edk::GenerateRandomToken()), |
| 169 weak_ptr_factory_(this) { | 169 weak_ptr_factory_(this) { |
| 170 process_.reset(new BrowserChildProcessHostImpl(PROCESS_TYPE_UTILITY, this, | 170 process_.reset(new BrowserChildProcessHostImpl(PROCESS_TYPE_UTILITY, this, |
| 171 child_token_)); | 171 child_token_, 0, nullptr)); |
| 172 mojo_child_connection_.reset(new MojoChildConnection( | 172 mojo_child_connection_.reset(new MojoChildConnection( |
| 173 kUtilityMojoApplicationName, | 173 kUtilityMojoApplicationName, |
| 174 base::StringPrintf("%d_0", process_->GetData().id), child_token_, | 174 base::StringPrintf("%d_0", process_->GetData().id), child_token_, |
| 175 MojoShellContext::GetConnectorForIOThread(), | 175 MojoShellContext::GetConnectorForIOThread(), |
| 176 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO))); | 176 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO))); |
| 177 } | 177 } |
| 178 | 178 |
| 179 UtilityProcessHostImpl::~UtilityProcessHostImpl() { | 179 UtilityProcessHostImpl::~UtilityProcessHostImpl() { |
| 180 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 180 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 181 if (is_batch_mode_) | 181 if (is_batch_mode_) |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 base::WeakPtr<UtilityProcessHostImpl> host, | 419 base::WeakPtr<UtilityProcessHostImpl> host, |
| 420 int error_code) { | 420 int error_code) { |
| 421 if (!host) | 421 if (!host) |
| 422 return; | 422 return; |
| 423 | 423 |
| 424 host->OnProcessLaunchFailed(error_code); | 424 host->OnProcessLaunchFailed(error_code); |
| 425 delete host.get(); | 425 delete host.get(); |
| 426 } | 426 } |
| 427 | 427 |
| 428 } // namespace content | 428 } // namespace content |
| OLD | NEW |