| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "shell/child_process_host.h" | 5 #include "shell/child_process_host.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 void ChildProcessHost::Start() { | 35 void ChildProcessHost::Start() { |
| 36 DCHECK(!child_process_.IsValid()); | 36 DCHECK(!child_process_.IsValid()); |
| 37 | 37 |
| 38 mojo::ScopedMessagePipeHandle handle(mojo::embedder::CreateChannel( | 38 mojo::ScopedMessagePipeHandle handle(mojo::embedder::CreateChannel( |
| 39 platform_channel_pair_.PassServerHandle(), | 39 platform_channel_pair_.PassServerHandle(), |
| 40 context_->task_runners()->io_runner(), | 40 context_->task_runners()->io_runner(), |
| 41 base::Bind(&ChildProcessHost::DidCreateChannel, base::Unretained(this)), | 41 base::Bind(&ChildProcessHost::DidCreateChannel, base::Unretained(this)), |
| 42 base::MessageLoop::current()->message_loop_proxy())); | 42 base::MessageLoop::current()->message_loop_proxy())); |
| 43 | 43 |
| 44 controller_.Bind(handle.Pass()); | 44 controller_.Bind(mojo::InterfacePtrInfo<ChildController>(handle.Pass(), 0u)); |
| 45 controller_.set_error_handler(this); | 45 controller_.set_error_handler(this); |
| 46 | 46 |
| 47 CHECK(base::PostTaskAndReplyWithResult( | 47 CHECK(base::PostTaskAndReplyWithResult( |
| 48 context_->task_runners()->blocking_pool(), FROM_HERE, | 48 context_->task_runners()->blocking_pool(), FROM_HERE, |
| 49 base::Bind(&ChildProcessHost::DoLaunch, base::Unretained(this)), | 49 base::Bind(&ChildProcessHost::DoLaunch, base::Unretained(this)), |
| 50 base::Bind(&ChildProcessHost::DidStart, base::Unretained(this)))); | 50 base::Bind(&ChildProcessHost::DidStart, base::Unretained(this)))); |
| 51 } | 51 } |
| 52 | 52 |
| 53 int ChildProcessHost::Join() { | 53 int ChildProcessHost::Join() { |
| 54 DCHECK(child_process_.IsValid()); | 54 DCHECK(child_process_.IsValid()); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 on_app_complete_.reset(); | 130 on_app_complete_.reset(); |
| 131 on_app_complete.Run(result); | 131 on_app_complete.Run(result); |
| 132 } | 132 } |
| 133 } | 133 } |
| 134 | 134 |
| 135 void ChildProcessHost::OnConnectionError() { | 135 void ChildProcessHost::OnConnectionError() { |
| 136 AppCompleted(MOJO_RESULT_UNKNOWN); | 136 AppCompleted(MOJO_RESULT_UNKNOWN); |
| 137 } | 137 } |
| 138 | 138 |
| 139 } // namespace shell | 139 } // namespace shell |
| OLD | NEW |