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

Side by Side Diff: content/browser/mojo/mojo_shell_context.h

Issue 2163883005: WIP: Obtain Bootstrap from utility process Service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « content/browser/gpu/gpu_process_host.cc ('k') | content/browser/mojo/mojo_shell_context.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 2015 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 CONTENT_BROWSER_MOJO_MOJO_SHELL_CONTEXT_H_
6 #define CONTENT_BROWSER_MOJO_MOJO_SHELL_CONTEXT_H_
7
8 #include <map>
9 #include <memory>
10
11 #include "base/callback_forward.h"
12 #include "base/compiler_specific.h"
13 #include "base/lazy_instance.h"
14 #include "base/macros.h"
15 #include "content/common/content_export.h"
16 #include "services/shell/public/interfaces/connector.mojom.h"
17 #include "services/shell/service_manager.h"
18
19 namespace catalog {
20 class Catalog;
21 }
22
23 namespace content {
24
25 // MojoShellContext hosts the browser's ApplicationManager, coordinating
26 // app registration and interconnection.
27 class CONTENT_EXPORT MojoShellContext {
28 public:
29 MojoShellContext();
30 ~MojoShellContext();
31
32 // Connects an application at |name| and gets a handle to its exposed
33 // services. This is only intended for use in browser code that's not part of
34 // some Mojo application. May be called from any thread. |requestor_name| is
35 // given to the target application as the requestor's name upon connection.
36 static void ConnectToApplication(
37 const std::string& user_id,
38 const std::string& name,
39 const std::string& requestor_name,
40 shell::mojom::InterfaceProviderRequest request,
41 shell::mojom::InterfaceProviderPtr exposed_services,
42 const shell::mojom::Connector::ConnectCallback& callback);
43
44 // Returns a shell::Connector that can be used on the IO thread.
45 static shell::Connector* GetConnectorForIOThread();
46
47 private:
48 class BuiltinManifestProvider;
49 class Proxy;
50 friend class Proxy;
51
52 void ConnectToApplicationOnOwnThread(
53 const std::string& user_id,
54 const std::string& name,
55 const std::string& requestor_name,
56 shell::mojom::InterfaceProviderRequest request,
57 shell::mojom::InterfaceProviderPtr exposed_services,
58 const shell::mojom::Connector::ConnectCallback& callback);
59
60 static base::LazyInstance<std::unique_ptr<Proxy>> proxy_;
61
62 std::unique_ptr<BuiltinManifestProvider> manifest_provider_;
63 std::unique_ptr<catalog::Catalog> catalog_;
64 std::unique_ptr<shell::ServiceManager> service_manager_;
65
66 DISALLOW_COPY_AND_ASSIGN(MojoShellContext);
67 };
68
69 } // namespace content
70
71 #endif // CONTENT_BROWSER_MOJO_MOJO_SHELL_CONTEXT_H_
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_process_host.cc ('k') | content/browser/mojo/mojo_shell_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698