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

Side by Side Diff: content/common/mojo/mojo_shell_connection_impl.h

Issue 2398783002: Rename a bunch of Mojo Application stuff to reference Services. (Closed)
Patch Set: . Created 4 years, 2 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
(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 CONTENT_COMMON_MOJO_SHELL_CONNECTION_IMPL_H_
6 #define CONTENT_COMMON_MOJO_SHELL_CONNECTION_IMPL_H_
7
8 #include <memory>
9
10 #include "base/macros.h"
11 #include "base/memory/ref_counted.h"
12 #include "base/memory/weak_ptr.h"
13 #include "base/sequenced_task_runner.h"
14 #include "content/public/common/mojo_shell_connection.h"
15 #include "mojo/public/cpp/bindings/string.h"
16 #include "mojo/public/cpp/system/message_pipe.h"
17 #include "services/shell/public/cpp/identity.h"
18 #include "services/shell/public/interfaces/service.mojom.h"
19
20 namespace shell {
21 class Connector;
22 }
23
24 namespace content {
25
26 class EmbeddedApplicationRunner;
27
28 class MojoShellConnectionImpl : public MojoShellConnection {
29 public:
30 explicit MojoShellConnectionImpl(
31 shell::mojom::ServiceRequest request,
32 scoped_refptr<base::SequencedTaskRunner> io_task_runner);
33 ~MojoShellConnectionImpl() override;
34
35 private:
36 class IOThreadContext;
37
38 // MojoShellConnection:
39 void Start() override;
40 void SetInitializeHandler(const base::Closure& handler) override;
41 shell::Connector* GetConnector() override;
42 const shell::Identity& GetIdentity() const override;
43 void SetConnectionLostClosure(const base::Closure& closure) override;
44 void SetupInterfaceRequestProxies(
45 shell::InterfaceRegistry* registry,
46 shell::InterfaceProvider* provider) override;
47 int AddConnectionFilter(std::unique_ptr<ConnectionFilter> filter) override;
48 void RemoveConnectionFilter(int filter_id) override;
49 void AddEmbeddedService(const std::string& name,
50 const MojoApplicationInfo& info) override;
51 void AddServiceRequestHandler(
52 const std::string& name,
53 const ServiceRequestHandler& handler) override;
54
55 void OnContextInitialized(const shell::Identity& identity);
56 void OnConnectionLost();
57 void CreateService(shell::mojom::ServiceRequest request,
58 const std::string& name);
59 void GetInterface(shell::mojom::InterfaceProvider* provider,
60 const std::string& interface_name,
61 mojo::ScopedMessagePipeHandle request_handle);
62
63 shell::Identity identity_;
64
65 std::unique_ptr<shell::Connector> connector_;
66 scoped_refptr<IOThreadContext> context_;
67
68 base::Closure initialize_handler_;
69 base::Closure connection_lost_handler_;
70
71 std::unordered_map<std::string, std::unique_ptr<EmbeddedApplicationRunner>>
72 embedded_apps_;
73 std::unordered_map<std::string, ServiceRequestHandler> request_handlers_;
74
75 base::WeakPtrFactory<MojoShellConnectionImpl> weak_factory_;
76
77 DISALLOW_COPY_AND_ASSIGN(MojoShellConnectionImpl);
78 };
79
80 } // namespace content
81
82 #endif // CONTENT_COMMON_MOJO_SHELL_CONNECTION_IMPL_H_
OLDNEW
« no previous file with comments | « content/common/mojo/mojo_child_connection.cc ('k') | content/common/mojo/mojo_shell_connection_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698