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