| 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 #ifndef MOJO_SHELL_RUNNER_HOST_OUT_OF_PROCESS_NATIVE_RUNNER_H_ | 5 #ifndef MOJO_SHELL_RUNNER_HOST_OUT_OF_PROCESS_NATIVE_RUNNER_H_ |
| 6 #define MOJO_SHELL_RUNNER_HOST_OUT_OF_PROCESS_NATIVE_RUNNER_H_ | 6 #define MOJO_SHELL_RUNNER_HOST_OUT_OF_PROCESS_NATIVE_RUNNER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 InterfaceRequest<Application> application_request, | 36 InterfaceRequest<Application> application_request, |
| 37 const base::Callback<void(base::ProcessId)>& pid_available_callback, | 37 const base::Callback<void(base::ProcessId)>& pid_available_callback, |
| 38 const base::Closure& app_completed_callback) override; | 38 const base::Closure& app_completed_callback) override; |
| 39 void InitHost(ScopedHandle channel, | 39 void InitHost(ScopedHandle channel, |
| 40 InterfaceRequest<Application> application_request) override; | 40 InterfaceRequest<Application> application_request) override; |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 // |ChildController::StartApp()| callback: | 43 // |ChildController::StartApp()| callback: |
| 44 void AppCompleted(int32_t result); | 44 void AppCompleted(int32_t result); |
| 45 | 45 |
| 46 // Callback run when the child process has launched. |
| 47 void OnProcessLaunched( |
| 48 InterfaceRequest<Application> application_request, |
| 49 const base::Callback<void(base::ProcessId)>& pid_available_callback, |
| 50 base::ProcessId pid); |
| 51 |
| 46 base::TaskRunner* const launch_process_runner_; | 52 base::TaskRunner* const launch_process_runner_; |
| 47 | 53 |
| 48 base::FilePath app_path_; | 54 base::FilePath app_path_; |
| 49 base::Closure app_completed_callback_; | 55 base::Closure app_completed_callback_; |
| 50 | 56 |
| 51 scoped_ptr<ChildProcessHost> child_process_host_; | 57 scoped_ptr<ChildProcessHost> child_process_host_; |
| 52 | 58 |
| 53 DISALLOW_COPY_AND_ASSIGN(OutOfProcessNativeRunner); | 59 DISALLOW_COPY_AND_ASSIGN(OutOfProcessNativeRunner); |
| 54 }; | 60 }; |
| 55 | 61 |
| 56 class OutOfProcessNativeRunnerFactory : public NativeRunnerFactory { | 62 class OutOfProcessNativeRunnerFactory : public NativeRunnerFactory { |
| 57 public: | 63 public: |
| 58 explicit OutOfProcessNativeRunnerFactory( | 64 explicit OutOfProcessNativeRunnerFactory( |
| 59 base::TaskRunner* launch_process_runner) | 65 base::TaskRunner* launch_process_runner) |
| 60 : launch_process_runner_(launch_process_runner) {} | 66 : launch_process_runner_(launch_process_runner) {} |
| 61 ~OutOfProcessNativeRunnerFactory() override {} | 67 ~OutOfProcessNativeRunnerFactory() override {} |
| 62 | 68 |
| 63 scoped_ptr<NativeRunner> Create(const base::FilePath& app_path) override; | 69 scoped_ptr<NativeRunner> Create(const base::FilePath& app_path) override; |
| 64 | 70 |
| 65 private: | 71 private: |
| 66 base::TaskRunner* const launch_process_runner_; | 72 base::TaskRunner* const launch_process_runner_; |
| 67 | 73 |
| 68 DISALLOW_COPY_AND_ASSIGN(OutOfProcessNativeRunnerFactory); | 74 DISALLOW_COPY_AND_ASSIGN(OutOfProcessNativeRunnerFactory); |
| 69 }; | 75 }; |
| 70 | 76 |
| 71 } // namespace shell | 77 } // namespace shell |
| 72 } // namespace mojo | 78 } // namespace mojo |
| 73 | 79 |
| 74 #endif // MOJO_SHELL_RUNNER_HOST_OUT_OF_PROCESS_NATIVE_RUNNER_H_ | 80 #endif // MOJO_SHELL_RUNNER_HOST_OUT_OF_PROCESS_NATIVE_RUNNER_H_ |
| OLD | NEW |