| 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 "mojo/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/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // TODO(vtl): Race condition: If |AppChildProcessHost::DidStart()| hasn't | 24 // TODO(vtl): Race condition: If |AppChildProcessHost::DidStart()| hasn't |
| 25 // been called yet, we shouldn't call |Join()| here. (Until |DidStart()|, we | 25 // been called yet, we shouldn't call |Join()| here. (Until |DidStart()|, we |
| 26 // may not have a child process to wait on.) Probably we should fix | 26 // may not have a child process to wait on.) Probably we should fix |
| 27 // |Join()|. | 27 // |Join()|. |
| 28 app_child_process_host_->Join(); | 28 app_child_process_host_->Join(); |
| 29 } | 29 } |
| 30 } | 30 } |
| 31 | 31 |
| 32 void OutOfProcessDynamicServiceRunner::Start( | 32 void OutOfProcessDynamicServiceRunner::Start( |
| 33 const base::FilePath& app_path, | 33 const base::FilePath& app_path, |
| 34 ScopedShellHandle service_handle, | 34 ScopedMessagePipeHandle service_handle, |
| 35 const base::Closure& app_completed_callback) { | 35 const base::Closure& app_completed_callback) { |
| 36 app_path_ = app_path; | 36 app_path_ = app_path; |
| 37 | 37 |
| 38 DCHECK(!service_handle_.is_valid()); | 38 DCHECK(!service_handle_.is_valid()); |
| 39 service_handle_ = service_handle.Pass(); | 39 service_handle_ = service_handle.Pass(); |
| 40 | 40 |
| 41 DCHECK(app_completed_callback_.is_null()); | 41 DCHECK(app_completed_callback_.is_null()); |
| 42 app_completed_callback_ = app_completed_callback; | 42 app_completed_callback_ = app_completed_callback; |
| 43 | 43 |
| 44 app_child_process_host_.reset(new AppChildProcessHost(context_, this)); | 44 app_child_process_host_.reset(new AppChildProcessHost(context_, this)); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 57 DVLOG(2) << "OutOfProcessDynamicServiceRunner::AppCompleted(" << result | 57 DVLOG(2) << "OutOfProcessDynamicServiceRunner::AppCompleted(" << result |
| 58 << ")"; | 58 << ")"; |
| 59 | 59 |
| 60 app_completed_callback_.Run(); | 60 app_completed_callback_.Run(); |
| 61 app_completed_callback_.Reset(); | 61 app_completed_callback_.Reset(); |
| 62 app_child_process_host_.reset(); | 62 app_child_process_host_.reset(); |
| 63 } | 63 } |
| 64 | 64 |
| 65 } // namespace shell | 65 } // namespace shell |
| 66 } // namespace mojo | 66 } // namespace mojo |
| OLD | NEW |