OLD | NEW |
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 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 // Block the calling thread until the Initialize() method is called by the | 53 // Block the calling thread until the Initialize() method is called by the |
54 // shell. | 54 // shell. |
55 void WaitForInitialize(); | 55 void WaitForInitialize(); |
56 | 56 |
57 Connector* connector() { return connector_.get(); } | 57 Connector* connector() { return connector_.get(); } |
58 | 58 |
59 private: | 59 private: |
60 // shell::mojom::ShellClient: | 60 // shell::mojom::ShellClient: |
61 void Initialize(shell::mojom::ConnectorPtr connector, | 61 void Initialize(shell::mojom::ConnectorPtr connector, |
62 const String& name, | 62 shell::mojom::IdentityPtr identity, |
63 const String& user_id, | |
64 uint32_t id) override; | 63 uint32_t id) override; |
65 void AcceptConnection( | 64 void AcceptConnection( |
66 const String& requestor_name, | 65 shell::mojom::IdentityPtr source, |
67 const String& requestor_user_id, | 66 uint32_t source_id, |
68 uint32_t requestor_id, | |
69 shell::mojom::InterfaceProviderRequest remote_interfaces, | 67 shell::mojom::InterfaceProviderRequest remote_interfaces, |
70 shell::mojom::InterfaceProviderPtr local_interfaces, | 68 shell::mojom::InterfaceProviderPtr local_interfaces, |
71 Array<String> allowed_interfaces, | 69 Array<String> allowed_interfaces, |
72 const String& name) override; | 70 const String& name) override; |
73 | 71 |
74 void OnConnectionError(); | 72 void OnConnectionError(); |
75 | 73 |
76 // We track the lifetime of incoming connection registries as it more | 74 // We track the lifetime of incoming connection registries as it more |
77 // convenient for the client. | 75 // convenient for the client. |
78 ScopedVector<Connection> incoming_connections_; | 76 ScopedVector<Connection> incoming_connections_; |
79 mojo::ShellClient* client_; | 77 mojo::ShellClient* client_; |
80 Binding<shell::mojom::ShellClient> binding_; | 78 Binding<shell::mojom::ShellClient> binding_; |
81 scoped_ptr<Connector> connector_; | 79 scoped_ptr<Connector> connector_; |
82 base::WeakPtrFactory<ShellConnection> weak_factory_; | 80 base::WeakPtrFactory<ShellConnection> weak_factory_; |
83 | 81 |
84 DISALLOW_COPY_AND_ASSIGN(ShellConnection); | 82 DISALLOW_COPY_AND_ASSIGN(ShellConnection); |
85 }; | 83 }; |
86 | 84 |
87 } // namespace mojo | 85 } // namespace mojo |
88 | 86 |
89 #endif // MOJO_SHELL_PUBLIC_CPP_SHELL_CONNECTION_H_ | 87 #endif // MOJO_SHELL_PUBLIC_CPP_SHELL_CONNECTION_H_ |
OLD | NEW |