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_) |
| 272 return true; |
| 273 |
271 client_task_runner_->PostTask( | 274 client_task_runner_->PostTask( |
272 FROM_HERE, | 275 FROM_HERE, |
273 base::Bind(base::IgnoreResult( | 276 base::Bind( |
274 &UtilityProcessHostClient::OnMessageReceived), client_.get(), | 277 base::IgnoreResult(&UtilityProcessHostClient::OnMessageReceived), |
| 278 client_.get(), |
275 message)); | 279 message)); |
| 280 |
276 return true; | 281 return true; |
277 } | 282 } |
278 | 283 |
279 void UtilityProcessHostImpl::OnProcessLaunchFailed() { | 284 void UtilityProcessHostImpl::OnProcessLaunchFailed() { |
| 285 if (!client_) |
| 286 return; |
| 287 |
280 client_task_runner_->PostTask( | 288 client_task_runner_->PostTask( |
281 FROM_HERE, | 289 FROM_HERE, |
282 base::Bind(&UtilityProcessHostClient::OnProcessLaunchFailed, | 290 base::Bind(&UtilityProcessHostClient::OnProcessLaunchFailed, |
283 client_.get())); | 291 client_.get())); |
284 } | 292 } |
285 | 293 |
286 void UtilityProcessHostImpl::OnProcessCrashed(int exit_code) { | 294 void UtilityProcessHostImpl::OnProcessCrashed(int exit_code) { |
| 295 if (!client_) |
| 296 return; |
| 297 |
287 client_task_runner_->PostTask( | 298 client_task_runner_->PostTask( |
288 FROM_HERE, | 299 FROM_HERE, |
289 base::Bind(&UtilityProcessHostClient::OnProcessCrashed, client_.get(), | 300 base::Bind(&UtilityProcessHostClient::OnProcessCrashed, client_.get(), |
290 exit_code)); | 301 exit_code)); |
291 } | 302 } |
292 | 303 |
293 } // namespace content | 304 } // namespace content |
OLD | NEW |