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/frame_host/frame_mojo_shell.h

Issue 1736663003: Eliminate Quit() from Shell, and roll Shell & Connector together. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@14cf
Patch Set: . Created 4 years, 9 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 | « no previous file | content/browser/frame_host/frame_mojo_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
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_FRAME_HOST_FRAME_MOJO_SHELL_H_ 5 #ifndef CONTENT_BROWSER_FRAME_HOST_FRAME_MOJO_SHELL_H_
6 #define CONTENT_BROWSER_FRAME_HOST_FRAME_MOJO_SHELL_H_ 6 #define CONTENT_BROWSER_FRAME_HOST_FRAME_MOJO_SHELL_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "mojo/public/cpp/bindings/binding_set.h" 10 #include "mojo/public/cpp/bindings/binding_set.h"
11 #include "mojo/public/cpp/bindings/interface_request.h" 11 #include "mojo/public/cpp/bindings/interface_request.h"
12 #include "mojo/shell/public/interfaces/shell.mojom.h" 12 #include "mojo/shell/public/interfaces/shell.mojom.h"
13 13
14 namespace content { 14 namespace content {
15 15
16 class RenderFrameHost; 16 class RenderFrameHost;
17 class ServiceRegistryImpl; 17 class ServiceRegistryImpl;
18 18
19 // This provides the |mojo::shell::mojom::Shell| service interface to each 19 // This provides the |mojo::shell::mojom::Shell| service interface to each
20 // frame's ServiceRegistry, giving frames the ability to connect to Mojo 20 // frame's ServiceRegistry, giving frames the ability to connect to Mojo
21 // applications. 21 // applications.
22 class FrameMojoShell : public mojo::shell::mojom::Shell, 22 class FrameMojoShell : public mojo::shell::mojom::Connector {
23 public mojo::shell::mojom::Connector {
24 public: 23 public:
25 explicit FrameMojoShell(RenderFrameHost* frame_host); 24 explicit FrameMojoShell(RenderFrameHost* frame_host);
26 ~FrameMojoShell() override; 25 ~FrameMojoShell() override;
27 26
28 void BindRequest( 27 void BindRequest(mojo::shell::mojom::ConnectorRequest request);
29 mojo::InterfaceRequest<mojo::shell::mojom::Shell> shell_request);
30 28
31 private: 29 private:
32 // mojo::Shell:
33 void GetConnector(mojo::shell::mojom::ConnectorRequest request) override;
34 void QuitApplication() override;
35
36 // mojo::Connector: 30 // mojo::Connector:
37 void Connect( 31 void Connect(
38 const mojo::String& application_url, 32 const mojo::String& application_url,
39 uint32_t user_id, 33 uint32_t user_id,
40 mojo::shell::mojom::InterfaceProviderRequest services, 34 mojo::shell::mojom::InterfaceProviderRequest services,
41 mojo::shell::mojom::InterfaceProviderPtr exposed_services, 35 mojo::shell::mojom::InterfaceProviderPtr exposed_services,
42 const mojo::shell::mojom::Connector::ConnectCallback& callback) override; 36 const mojo::shell::mojom::Connector::ConnectCallback& callback) override;
43 void Clone(mojo::shell::mojom::ConnectorRequest request) override; 37 void Clone(mojo::shell::mojom::ConnectorRequest request) override;
44 38
45 ServiceRegistryImpl* GetServiceRegistry(); 39 ServiceRegistryImpl* GetServiceRegistry();
46 40
47 RenderFrameHost* frame_host_; 41 RenderFrameHost* frame_host_;
48 mojo::BindingSet<mojo::shell::mojom::Shell> bindings_;
49 mojo::BindingSet<mojo::shell::mojom::Connector> connectors_; 42 mojo::BindingSet<mojo::shell::mojom::Connector> connectors_;
50 43
51 // ServiceRegistry providing browser services to connected applications. 44 // ServiceRegistry providing browser services to connected applications.
52 scoped_ptr<ServiceRegistryImpl> service_registry_; 45 scoped_ptr<ServiceRegistryImpl> service_registry_;
53 mojo::BindingSet<mojo::shell::mojom::InterfaceProvider> 46 mojo::BindingSet<mojo::shell::mojom::InterfaceProvider>
54 service_provider_bindings_; 47 service_provider_bindings_;
55 48
56 DISALLOW_COPY_AND_ASSIGN(FrameMojoShell); 49 DISALLOW_COPY_AND_ASSIGN(FrameMojoShell);
57 }; 50 };
58 51
59 } // namespace content 52 } // namespace content
60 53
61 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_MOJO_SHELL_H_ 54 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_MOJO_SHELL_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/frame_mojo_shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698