Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Side by Side Diff: mojo/shell/background/background_shell.h

Issue 1877753003: Move mojo\shell to services\shell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@62scan
Patch Set: . Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/shell/background/DEPS ('k') | mojo/shell/background/background_shell.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef MOJO_SHELL_BACKGROUND_BACKGROUND_SHELL_H_
6 #define MOJO_SHELL_BACKGROUND_BACKGROUND_SHELL_H_
7
8 #include <vector>
9
10 #include "base/macros.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "mojo/public/cpp/bindings/interface_request.h"
13 #include "mojo/services/catalog/store.h"
14 #include "mojo/shell/public/interfaces/shell_client.mojom.h"
15
16 namespace catalog {
17 class Store;
18 }
19
20 namespace mojo {
21 namespace shell {
22
23 class NativeRunnerDelegate;
24 class Shell;
25
26 // BackgroundShell starts up the mojo shell on a background thread, and
27 // destroys the thread in the destructor. Once created use CreateApplication()
28 // to obtain an InterfaceRequest for the Application. The InterfaceRequest can
29 // then be bound to an ApplicationImpl.
30 class BackgroundShell {
31 public:
32 struct InitParams {
33 InitParams();
34 ~InitParams();
35
36 NativeRunnerDelegate* native_runner_delegate = nullptr;
37 scoped_ptr<catalog::Store> catalog_store;
38 // If true the edk is initialized.
39 bool init_edk = true;
40 };
41
42 BackgroundShell();
43 ~BackgroundShell();
44
45 // Starts the background shell. |command_line_switches| are additional
46 // switches applied to any processes spawned by this call.
47 void Init(scoped_ptr<InitParams> init_params);
48
49 // Obtains an InterfaceRequest for the specified name.
50 mojom::ShellClientRequest CreateShellClientRequest(
51 const std::string& name);
52
53 // Use to do processing on the thread running the shell. The callback is
54 // supplied a pointer to the Shell. The callback does *not* own the Shell.
55 using ShellThreadCallback = base::Callback<void(Shell*)>;
56 void ExecuteOnShellThread(const ShellThreadCallback& callback);
57
58 private:
59 class MojoThread;
60
61 scoped_ptr<MojoThread> thread_;
62
63 DISALLOW_COPY_AND_ASSIGN(BackgroundShell);
64 };
65
66 } // namespace shell
67 } // namespace mojo
68
69 #endif // MOJO_SHELL_BACKGROUND_BACKGROUND_SHELL_H_
OLDNEW
« no previous file with comments | « mojo/shell/background/DEPS ('k') | mojo/shell/background/background_shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698