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

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

Issue 1871223003: Use ShellClientFactory interface to load mojo:profile (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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 CONTENT_BROWSER_MOJO_MOJO_SHELL_CONTEXT_H_ 5 #ifndef CONTENT_BROWSER_MOJO_MOJO_SHELL_CONTEXT_H_
6 #define CONTENT_BROWSER_MOJO_MOJO_SHELL_CONTEXT_H_ 6 #define CONTENT_BROWSER_MOJO_MOJO_SHELL_CONTEXT_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 10
11 #include "base/callback_forward.h" 11 #include "base/callback_forward.h"
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/lazy_instance.h" 13 #include "base/lazy_instance.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/single_thread_task_runner.h"
16 #include "content/common/content_export.h" 15 #include "content/common/content_export.h"
17 #include "services/shell/public/interfaces/connector.mojom.h" 16 #include "services/shell/public/interfaces/connector.mojom.h"
18 #include "services/shell/shell.h" 17 #include "services/shell/shell.h"
19 18
20 namespace catalog { 19 namespace catalog {
21 class Factory; 20 class Factory;
22 } 21 }
23 22
24 namespace mojo { 23 namespace mojo {
25 class ShellClient; 24 class ShellClient;
26 } 25 }
27 26
28 namespace content { 27 namespace content {
29 28
30 // MojoShellContext hosts the browser's ApplicationManager, coordinating 29 // MojoShellContext hosts the browser's ApplicationManager, coordinating
31 // app registration and interconnection. 30 // app registration and interconnection.
32 class CONTENT_EXPORT MojoShellContext { 31 class CONTENT_EXPORT MojoShellContext {
33 public: 32 public:
34 using StaticApplicationMap = 33 using StaticApplicationMap =
35 std::map<std::string, 34 std::map<std::string,
36 base::Callback<std::unique_ptr<mojo::ShellClient>()>>; 35 base::Callback<std::unique_ptr<mojo::ShellClient>()>>;
37 36
38 MojoShellContext(scoped_refptr<base::SingleThreadTaskRunner> file_thread, 37 MojoShellContext();
39 scoped_refptr<base::SingleThreadTaskRunner> db_thread);
40 ~MojoShellContext(); 38 ~MojoShellContext();
41 39
42 // Connects an application at |name| and gets a handle to its exposed 40 // Connects an application at |name| and gets a handle to its exposed
43 // services. This is only intended for use in browser code that's not part of 41 // services. This is only intended for use in browser code that's not part of
44 // some Mojo application. May be called from any thread. |requestor_name| is 42 // some Mojo application. May be called from any thread. |requestor_name| is
45 // given to the target application as the requestor's name upon connection. 43 // given to the target application as the requestor's name upon connection.
46 static void ConnectToApplication( 44 static void ConnectToApplication(
47 const std::string& user_id, 45 const std::string& user_id,
48 const std::string& name, 46 const std::string& name,
49 const std::string& requestor_name, 47 const std::string& requestor_name,
(...skipping 21 matching lines...) Expand all
71 std::unique_ptr<BuiltinManifestProvider> manifest_provider_; 69 std::unique_ptr<BuiltinManifestProvider> manifest_provider_;
72 std::unique_ptr<catalog::Factory> catalog_; 70 std::unique_ptr<catalog::Factory> catalog_;
73 std::unique_ptr<mojo::shell::Shell> shell_; 71 std::unique_ptr<mojo::shell::Shell> shell_;
74 72
75 DISALLOW_COPY_AND_ASSIGN(MojoShellContext); 73 DISALLOW_COPY_AND_ASSIGN(MojoShellContext);
76 }; 74 };
77 75
78 } // namespace content 76 } // namespace content
79 77
80 #endif // CONTENT_BROWSER_MOJO_MOJO_SHELL_CONTEXT_H_ 78 #endif // CONTENT_BROWSER_MOJO_MOJO_SHELL_CONTEXT_H_
OLDNEW
« no previous file with comments | « content/browser/mojo/browser_shell_connection.cc ('k') | content/browser/mojo/mojo_shell_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698