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

Side by Side Diff: mojo/shell/public/cpp/shell_connection.h

Issue 1797153002: Reinstate wait-for-Initialize when Chrome is run in Mash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shell-client
Patch Set: fix views_mus_unittests too 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 | « mojo/shell/public/cpp/lib/shell_connection.cc ('k') | ui/views/mus/platform_test_helper_mus.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 MOJO_SHELL_PUBLIC_CPP_SHELL_CONNECTION_H_ 5 #ifndef MOJO_SHELL_PUBLIC_CPP_SHELL_CONNECTION_H_
6 #define MOJO_SHELL_PUBLIC_CPP_SHELL_CONNECTION_H_ 6 #define MOJO_SHELL_PUBLIC_CPP_SHELL_CONNECTION_H_
7 7
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/callback.h"
11 #include "base/macros.h" 12 #include "base/macros.h"
12 #include "base/memory/scoped_vector.h" 13 #include "base/memory/scoped_vector.h"
13 #include "mojo/public/cpp/bindings/binding.h" 14 #include "mojo/public/cpp/bindings/binding.h"
14 #include "mojo/public/cpp/bindings/callback.h" 15 #include "mojo/public/cpp/bindings/callback.h"
15 #include "mojo/public/cpp/system/core.h" 16 #include "mojo/public/cpp/system/core.h"
16 #include "mojo/shell/public/cpp/shell_client.h" 17 #include "mojo/shell/public/cpp/shell_client.h"
17 #include "mojo/shell/public/interfaces/connector.mojom.h" 18 #include "mojo/shell/public/interfaces/connector.mojom.h"
18 #include "mojo/shell/public/interfaces/shell_client.mojom.h" 19 #include "mojo/shell/public/interfaces/shell_client.mojom.h"
19 20
20 namespace mojo { 21 namespace mojo {
(...skipping 26 matching lines...) Expand all
47 // used immediately to make outgoing connections via connector(). Does not 48 // used immediately to make outgoing connections via connector(). Does not
48 // take ownership of |client|, which must remain valid for the lifetime of 49 // take ownership of |client|, which must remain valid for the lifetime of
49 // ShellConnection. 50 // ShellConnection.
50 ShellConnection(mojo::ShellClient* client, 51 ShellConnection(mojo::ShellClient* client,
51 shell::mojom::ShellClientRequest request); 52 shell::mojom::ShellClientRequest request);
52 53
53 ~ShellConnection() override; 54 ~ShellConnection() override;
54 55
55 Connector* connector() { return connector_.get(); } 56 Connector* connector() { return connector_.get(); }
56 57
58 // TODO(rockot): Remove this. http://crbug.com/594852.
59 void set_initialize_handler(const base::Closure& callback);
60
57 // TODO(rockot): Remove this once we get rid of app tests. 61 // TODO(rockot): Remove this once we get rid of app tests.
58 void SetAppTestConnectorForTesting(shell::mojom::ConnectorPtr connector); 62 void SetAppTestConnectorForTesting(shell::mojom::ConnectorPtr connector);
59 63
60 private: 64 private:
61 // shell::mojom::ShellClient: 65 // shell::mojom::ShellClient:
62 void Initialize(shell::mojom::IdentityPtr identity, 66 void Initialize(shell::mojom::IdentityPtr identity,
63 uint32_t id, 67 uint32_t id,
64 const InitializeCallback& callback) override; 68 const InitializeCallback& callback) override;
65 void AcceptConnection( 69 void AcceptConnection(
66 shell::mojom::IdentityPtr source, 70 shell::mojom::IdentityPtr source,
67 uint32_t source_id, 71 uint32_t source_id,
68 shell::mojom::InterfaceProviderRequest remote_interfaces, 72 shell::mojom::InterfaceProviderRequest remote_interfaces,
69 shell::mojom::InterfaceProviderPtr local_interfaces, 73 shell::mojom::InterfaceProviderPtr local_interfaces,
70 shell::mojom::CapabilityRequestPtr allowed_capabilities, 74 shell::mojom::CapabilityRequestPtr allowed_capabilities,
71 const String& name) override; 75 const String& name) override;
72 76
73 void OnConnectionError(); 77 void OnConnectionError();
74 78
79 // A callback called when Initialize() is run.
80 base::Closure initialize_handler_;
81
75 // We track the lifetime of incoming connection registries as it more 82 // We track the lifetime of incoming connection registries as it more
76 // convenient for the client. 83 // convenient for the client.
77 ScopedVector<Connection> incoming_connections_; 84 ScopedVector<Connection> incoming_connections_;
78 85
79 // A pending Connector request which will eventually be passed to the shell. 86 // A pending Connector request which will eventually be passed to the shell.
80 shell::mojom::ConnectorRequest pending_connector_request_; 87 shell::mojom::ConnectorRequest pending_connector_request_;
81 88
82 mojo::ShellClient* client_; 89 mojo::ShellClient* client_;
83 Binding<shell::mojom::ShellClient> binding_; 90 Binding<shell::mojom::ShellClient> binding_;
84 scoped_ptr<Connector> connector_; 91 scoped_ptr<Connector> connector_;
85 92
86 DISALLOW_COPY_AND_ASSIGN(ShellConnection); 93 DISALLOW_COPY_AND_ASSIGN(ShellConnection);
87 }; 94 };
88 95
89 } // namespace mojo 96 } // namespace mojo
90 97
91 #endif // MOJO_SHELL_PUBLIC_CPP_SHELL_CONNECTION_H_ 98 #endif // MOJO_SHELL_PUBLIC_CPP_SHELL_CONNECTION_H_
OLDNEW
« no previous file with comments | « mojo/shell/public/cpp/lib/shell_connection.cc ('k') | ui/views/mus/platform_test_helper_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698