| 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 SHELL_IN_PROCESS_NATIVE_RUNNER_H_ | 5 #ifndef SHELL_IN_PROCESS_NATIVE_RUNNER_H_ |
| 6 #define SHELL_IN_PROCESS_NATIVE_RUNNER_H_ | 6 #define SHELL_IN_PROCESS_NATIVE_RUNNER_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 // An implementation of |NativeRunner| that loads/runs the given app (from the | 21 // An implementation of |NativeRunner| that loads/runs the given app (from the |
| 22 // file system) on a separate thread (in the current process). | 22 // file system) on a separate thread (in the current process). |
| 23 class InProcessNativeRunner : public NativeRunner, | 23 class InProcessNativeRunner : public NativeRunner, |
| 24 public base::DelegateSimpleThread::Delegate { | 24 public base::DelegateSimpleThread::Delegate { |
| 25 public: | 25 public: |
| 26 explicit InProcessNativeRunner(Context* context); | 26 explicit InProcessNativeRunner(Context* context); |
| 27 ~InProcessNativeRunner() override; | 27 ~InProcessNativeRunner() override; |
| 28 | 28 |
| 29 // |NativeRunner| method: | 29 // |NativeRunner| method: |
| 30 void Start(const base::FilePath& app_path, | 30 void Start(const base::FilePath& app_path, |
| 31 NativeApplicationCleanup cleanup, | |
| 32 mojo::InterfaceRequest<mojo::Application> application_request, | 31 mojo::InterfaceRequest<mojo::Application> application_request, |
| 33 const base::Closure& app_completed_callback) override; | 32 const base::Closure& app_completed_callback) override; |
| 34 | 33 |
| 35 private: | 34 private: |
| 36 // |base::DelegateSimpleThread::Delegate| method: | 35 // |base::DelegateSimpleThread::Delegate| method: |
| 37 void Run() override; | 36 void Run() override; |
| 38 | 37 |
| 39 base::FilePath app_path_; | 38 base::FilePath app_path_; |
| 40 NativeApplicationCleanup cleanup_; | |
| 41 mojo::InterfaceRequest<mojo::Application> application_request_; | 39 mojo::InterfaceRequest<mojo::Application> application_request_; |
| 42 base::Callback<bool(void)> app_completed_callback_runner_; | 40 base::Callback<bool(void)> app_completed_callback_runner_; |
| 43 | 41 |
| 44 base::ScopedNativeLibrary app_library_; | 42 base::ScopedNativeLibrary app_library_; |
| 45 scoped_ptr<base::DelegateSimpleThread> thread_; | 43 scoped_ptr<base::DelegateSimpleThread> thread_; |
| 46 | 44 |
| 47 DISALLOW_COPY_AND_ASSIGN(InProcessNativeRunner); | 45 DISALLOW_COPY_AND_ASSIGN(InProcessNativeRunner); |
| 48 }; | 46 }; |
| 49 | 47 |
| 50 class InProcessNativeRunnerFactory : public NativeRunnerFactory { | 48 class InProcessNativeRunnerFactory : public NativeRunnerFactory { |
| 51 public: | 49 public: |
| 52 explicit InProcessNativeRunnerFactory(Context* context) : context_(context) {} | 50 explicit InProcessNativeRunnerFactory(Context* context) : context_(context) {} |
| 53 ~InProcessNativeRunnerFactory() override {} | 51 ~InProcessNativeRunnerFactory() override {} |
| 54 | 52 |
| 55 scoped_ptr<NativeRunner> Create(const Options& options) override; | 53 scoped_ptr<NativeRunner> Create(const Options& options) override; |
| 56 | 54 |
| 57 private: | 55 private: |
| 58 Context* const context_; | 56 Context* const context_; |
| 59 | 57 |
| 60 DISALLOW_COPY_AND_ASSIGN(InProcessNativeRunnerFactory); | 58 DISALLOW_COPY_AND_ASSIGN(InProcessNativeRunnerFactory); |
| 61 }; | 59 }; |
| 62 | 60 |
| 63 } // namespace shell | 61 } // namespace shell |
| 64 | 62 |
| 65 #endif // SHELL_IN_PROCESS_NATIVE_RUNNER_H_ | 63 #endif // SHELL_IN_PROCESS_NATIVE_RUNNER_H_ |
| OLD | NEW |