| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 SERVICES_SHELL_BACKGROUND_BACKGROUND_SHELL_H_ | 5 #ifndef SERVICES_SHELL_BACKGROUND_BACKGROUND_SHELL_H_ |
| 6 #define SERVICES_SHELL_BACKGROUND_BACKGROUND_SHELL_H_ | 6 #define SERVICES_SHELL_BACKGROUND_BACKGROUND_SHELL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "mojo/public/cpp/bindings/interface_request.h" | 12 #include "mojo/public/cpp/bindings/interface_request.h" |
| 13 #include "services/catalog/store.h" | 13 #include "services/catalog/store.h" |
| 14 #include "services/shell/public/interfaces/shell_client.mojom.h" | 14 #include "services/shell/public/interfaces/service.mojom.h" |
| 15 | 15 |
| 16 namespace catalog { | 16 namespace catalog { |
| 17 class Store; | 17 class Store; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace shell { | 20 namespace shell { |
| 21 | 21 |
| 22 class NativeRunnerDelegate; | 22 class NativeRunnerDelegate; |
| 23 class Shell; | 23 class Shell; |
| 24 | 24 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 BackgroundShell(); | 41 BackgroundShell(); |
| 42 ~BackgroundShell(); | 42 ~BackgroundShell(); |
| 43 | 43 |
| 44 // Starts the background shell. |command_line_switches| are additional | 44 // Starts the background shell. |command_line_switches| are additional |
| 45 // switches applied to any processes spawned by this call. | 45 // switches applied to any processes spawned by this call. |
| 46 void Init(std::unique_ptr<InitParams> init_params); | 46 void Init(std::unique_ptr<InitParams> init_params); |
| 47 | 47 |
| 48 // Obtains an InterfaceRequest for the specified name. | 48 // Obtains an InterfaceRequest for the specified name. |
| 49 mojom::ShellClientRequest CreateShellClientRequest( | 49 mojom::ServiceRequest CreateServiceRequest( |
| 50 const std::string& name); | 50 const std::string& name); |
| 51 | 51 |
| 52 // Use to do processing on the thread running the shell. The callback is | 52 // Use to do processing on the thread running the shell. The callback is |
| 53 // supplied a pointer to the Shell. The callback does *not* own the Shell. | 53 // supplied a pointer to the Shell. The callback does *not* own the Shell. |
| 54 using ShellThreadCallback = base::Callback<void(Shell*)>; | 54 using ShellThreadCallback = base::Callback<void(Shell*)>; |
| 55 void ExecuteOnShellThread(const ShellThreadCallback& callback); | 55 void ExecuteOnShellThread(const ShellThreadCallback& callback); |
| 56 | 56 |
| 57 private: | 57 private: |
| 58 class MojoThread; | 58 class MojoThread; |
| 59 | 59 |
| 60 std::unique_ptr<MojoThread> thread_; | 60 std::unique_ptr<MojoThread> thread_; |
| 61 | 61 |
| 62 DISALLOW_COPY_AND_ASSIGN(BackgroundShell); | 62 DISALLOW_COPY_AND_ASSIGN(BackgroundShell); |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 } // namespace shell | 65 } // namespace shell |
| 66 | 66 |
| 67 #endif // SERVICES_SHELL_BACKGROUND_BACKGROUND_SHELL_H_ | 67 #endif // SERVICES_SHELL_BACKGROUND_BACKGROUND_SHELL_H_ |
| OLD | NEW |