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/app_child_process_host.h" | 5 #include "shell/app_child_process_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "mojo/edk/embedder/embedder.h" | 10 #include "mojo/edk/embedder/embedder.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 on_app_complete_ = on_app_complete; | 33 on_app_complete_ = on_app_complete; |
34 controller_->StartApp( | 34 controller_->StartApp( |
35 app_path, clean_app_path, application_request.Pass(), | 35 app_path, clean_app_path, application_request.Pass(), |
36 base::Bind(&AppChildProcessHost::AppCompleted, base::Unretained(this))); | 36 base::Bind(&AppChildProcessHost::AppCompleted, base::Unretained(this))); |
37 } | 37 } |
38 | 38 |
39 void AppChildProcessHost::WillStart() { | 39 void AppChildProcessHost::WillStart() { |
40 DCHECK(platform_channel()->is_valid()); | 40 DCHECK(platform_channel()->is_valid()); |
41 | 41 |
42 mojo::ScopedMessagePipeHandle handle(embedder::CreateChannel( | 42 ScopedMessagePipeHandle handle(embedder::CreateChannel( |
43 platform_channel()->Pass(), context()->task_runners()->io_runner(), | 43 platform_channel()->Pass(), context()->task_runners()->io_runner(), |
44 base::Bind(&AppChildProcessHost::DidCreateChannel, | 44 base::Bind(&AppChildProcessHost::DidCreateChannel, |
45 base::Unretained(this)), | 45 base::Unretained(this)), |
46 base::MessageLoop::current()->message_loop_proxy())); | 46 base::MessageLoop::current()->message_loop_proxy())); |
47 | 47 |
48 controller_.Bind(handle.Pass()); | 48 controller_.Bind(handle.Pass()); |
49 } | 49 } |
50 | 50 |
51 void AppChildProcessHost::DidStart(bool success) { | 51 void AppChildProcessHost::DidStart(bool success) { |
52 DVLOG(2) << "AppChildProcessHost::DidStart()"; | 52 DVLOG(2) << "AppChildProcessHost::DidStart()"; |
(...skipping 17 matching lines...) Expand all Loading... |
70 void AppChildProcessHost::AppCompleted(int32_t result) { | 70 void AppChildProcessHost::AppCompleted(int32_t result) { |
71 if (!on_app_complete_.is_null()) { | 71 if (!on_app_complete_.is_null()) { |
72 auto on_app_complete = on_app_complete_; | 72 auto on_app_complete = on_app_complete_; |
73 on_app_complete_.reset(); | 73 on_app_complete_.reset(); |
74 on_app_complete.Run(result); | 74 on_app_complete.Run(result); |
75 } | 75 } |
76 } | 76 } |
77 | 77 |
78 } // namespace shell | 78 } // namespace shell |
79 } // namespace mojo | 79 } // namespace mojo |
OLD | NEW |