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 MOJO_SHELL_BACKGROUND_BACKGROUND_SHELL_H_ | 5 #ifndef MOJO_SHELL_BACKGROUND_BACKGROUND_SHELL_H_ |
6 #define MOJO_SHELL_BACKGROUND_BACKGROUND_SHELL_H_ | 6 #define MOJO_SHELL_BACKGROUND_BACKGROUND_SHELL_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "mojo/public/cpp/bindings/interface_request.h" | 12 #include "mojo/public/cpp/bindings/interface_request.h" |
13 #include "mojo/shell/public/interfaces/shell_client.mojom.h" | 13 #include "mojo/shell/public/interfaces/shell_client.mojom.h" |
14 | 14 |
15 class GURL; | 15 class GURL; |
16 | 16 |
17 namespace mojo { | 17 namespace mojo { |
18 namespace shell { | 18 namespace shell { |
19 | 19 |
20 struct CommandLineSwitch; | 20 class NativeRunnerDelegate; |
21 | 21 |
22 // BackgroundShell starts up the mojo shell on a background thread, and | 22 // BackgroundShell starts up the mojo shell on a background thread, and |
23 // destroys the thread in the destructor. Once created use CreateApplication() | 23 // destroys the thread in the destructor. Once created use CreateApplication() |
24 // to obtain an InterfaceRequest for the Application. The InterfaceRequest can | 24 // to obtain an InterfaceRequest for the Application. The InterfaceRequest can |
25 // then be bound to an ApplicationImpl. | 25 // then be bound to an ApplicationImpl. |
26 class BackgroundShell { | 26 class BackgroundShell { |
27 public: | 27 public: |
28 BackgroundShell(); | 28 BackgroundShell(); |
29 ~BackgroundShell(); | 29 ~BackgroundShell(); |
30 | 30 |
31 // Starts the background shell. |command_line_switches| are additional | 31 // Starts the background shell. |
32 // switches applied to any processes spawned by this call. | 32 void Init(NativeRunnerDelegate* native_runner_delegate); |
33 void Init(const std::vector<CommandLineSwitch>& command_line_switches); | |
34 | 33 |
35 // Obtains an InterfaceRequest for the specified url. | 34 // Obtains an InterfaceRequest for the specified url. |
36 InterfaceRequest<mojom::ShellClient> CreateShellClientRequest( | 35 InterfaceRequest<mojom::ShellClient> CreateShellClientRequest( |
37 const GURL& url); | 36 const GURL& url); |
38 | 37 |
39 private: | 38 private: |
40 class MojoThread; | 39 class MojoThread; |
41 | 40 |
42 scoped_ptr<MojoThread> thread_; | 41 scoped_ptr<MojoThread> thread_; |
43 | 42 |
44 DISALLOW_COPY_AND_ASSIGN(BackgroundShell); | 43 DISALLOW_COPY_AND_ASSIGN(BackgroundShell); |
45 }; | 44 }; |
46 | 45 |
47 } // namespace shell | 46 } // namespace shell |
48 } // namespace mojo | 47 } // namespace mojo |
49 | 48 |
50 #endif // MOJO_SHELL_BACKGROUND_BACKGROUND_SHELL_H_ | 49 #endif // MOJO_SHELL_BACKGROUND_BACKGROUND_SHELL_H_ |
OLD | NEW |