| 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 "mojo/shell/out_of_process_dynamic_service_runner.h" | 5 #include "shell/out_of_process_dynamic_service_runner.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/scoped_native_library.h" | 11 #include "base/scoped_native_library.h" |
| 12 | 12 |
| 13 namespace mojo { | 13 namespace mojo { |
| 14 namespace shell { | 14 namespace shell { |
| 15 | 15 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 35 app_path_ = app_path; | 35 app_path_ = app_path; |
| 36 | 36 |
| 37 DCHECK(app_completed_callback_.is_null()); | 37 DCHECK(app_completed_callback_.is_null()); |
| 38 app_completed_callback_ = app_completed_callback; | 38 app_completed_callback_ = app_completed_callback; |
| 39 | 39 |
| 40 app_child_process_host_.reset(new AppChildProcessHost(context_, this)); | 40 app_child_process_host_.reset(new AppChildProcessHost(context_, this)); |
| 41 app_child_process_host_->Start(); | 41 app_child_process_host_->Start(); |
| 42 | 42 |
| 43 // TODO(vtl): |app_path.AsUTF8Unsafe()| is unsafe. | 43 // TODO(vtl): |app_path.AsUTF8Unsafe()| is unsafe. |
| 44 app_child_process_host_->controller()->StartApp( | 44 app_child_process_host_->controller()->StartApp( |
| 45 app_path.AsUTF8Unsafe(), | 45 app_path.AsUTF8Unsafe(), ScopedMessagePipeHandle(MessagePipeHandle( |
| 46 ScopedMessagePipeHandle(MessagePipeHandle( | 46 service_handle.release().value()))); |
| 47 service_handle.release().value()))); | |
| 48 } | 47 } |
| 49 | 48 |
| 50 void OutOfProcessDynamicServiceRunner::AppCompleted(int32_t result) { | 49 void OutOfProcessDynamicServiceRunner::AppCompleted(int32_t result) { |
| 51 DVLOG(2) << "OutOfProcessDynamicServiceRunner::AppCompleted(" << result | 50 DVLOG(2) << "OutOfProcessDynamicServiceRunner::AppCompleted(" << result |
| 52 << ")"; | 51 << ")"; |
| 53 | 52 |
| 54 app_completed_callback_.Run(); | 53 app_completed_callback_.Run(); |
| 55 app_completed_callback_.Reset(); | 54 app_completed_callback_.Reset(); |
| 56 app_child_process_host_.reset(); | 55 app_child_process_host_.reset(); |
| 57 } | 56 } |
| 58 | 57 |
| 59 } // namespace shell | 58 } // namespace shell |
| 60 } // namespace mojo | 59 } // namespace mojo |
| OLD | NEW |