| 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 run_elevated_, | 261 run_elevated_, |
| 262 no_sandbox_, env_, | 262 no_sandbox_, env_, |
| 263 process_->GetHost()), | 263 process_->GetHost()), |
| 264 cmd_line); | 264 cmd_line); |
| 265 } | 265 } |
| 266 | 266 |
| 267 return true; | 267 return true; |
| 268 } | 268 } |
| 269 | 269 |
| 270 bool UtilityProcessHostImpl::OnMessageReceived(const IPC::Message& message) { | 270 bool UtilityProcessHostImpl::OnMessageReceived(const IPC::Message& message) { |
| 271 if (!client_) | 271 if (!client_.get()) |
| 272 return true; | 272 return true; |
| 273 | 273 |
| 274 client_task_runner_->PostTask( | 274 client_task_runner_->PostTask( |
| 275 FROM_HERE, | 275 FROM_HERE, |
| 276 base::Bind( | 276 base::Bind( |
| 277 base::IgnoreResult(&UtilityProcessHostClient::OnMessageReceived), | 277 base::IgnoreResult(&UtilityProcessHostClient::OnMessageReceived), |
| 278 client_.get(), | 278 client_.get(), |
| 279 message)); | 279 message)); |
| 280 | 280 |
| 281 return true; | 281 return true; |
| 282 } | 282 } |
| 283 | 283 |
| 284 void UtilityProcessHostImpl::OnProcessLaunchFailed() { | 284 void UtilityProcessHostImpl::OnProcessLaunchFailed() { |
| 285 if (!client_) | 285 if (!client_.get()) |
| 286 return; | 286 return; |
| 287 | 287 |
| 288 client_task_runner_->PostTask( | 288 client_task_runner_->PostTask( |
| 289 FROM_HERE, | 289 FROM_HERE, |
| 290 base::Bind(&UtilityProcessHostClient::OnProcessLaunchFailed, | 290 base::Bind(&UtilityProcessHostClient::OnProcessLaunchFailed, |
| 291 client_.get())); | 291 client_.get())); |
| 292 } | 292 } |
| 293 | 293 |
| 294 void UtilityProcessHostImpl::OnProcessCrashed(int exit_code) { | 294 void UtilityProcessHostImpl::OnProcessCrashed(int exit_code) { |
| 295 if (!client_) | 295 if (!client_.get()) |
| 296 return; | 296 return; |
| 297 | 297 |
| 298 client_task_runner_->PostTask( | 298 client_task_runner_->PostTask( |
| 299 FROM_HERE, | 299 FROM_HERE, |
| 300 base::Bind(&UtilityProcessHostClient::OnProcessCrashed, client_.get(), | 300 base::Bind(&UtilityProcessHostClient::OnProcessCrashed, client_.get(), |
| 301 exit_code)); | 301 exit_code)); |
| 302 } | 302 } |
| 303 | 303 |
| 304 } // namespace content | 304 } // namespace content |
| OLD | NEW |