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 mojo::String& name, | 62 const String& name, |
63 uint32_t id, | 63 const String& user_id, |
64 uint32_t user_id) override; | 64 uint32_t id) override; |
65 void AcceptConnection( | 65 void AcceptConnection( |
66 const String& requestor_name, | 66 const String& requestor_name, |
| 67 const String& requestor_user_id, |
67 uint32_t requestor_id, | 68 uint32_t requestor_id, |
68 uint32_t requestor_user_id, | |
69 shell::mojom::InterfaceProviderRequest remote_interfaces, | 69 shell::mojom::InterfaceProviderRequest remote_interfaces, |
70 shell::mojom::InterfaceProviderPtr local_interfaces, | 70 shell::mojom::InterfaceProviderPtr local_interfaces, |
71 Array<String> allowed_interfaces, | 71 Array<String> allowed_interfaces, |
72 const String& name) override; | 72 const String& name) override; |
73 | 73 |
74 void OnConnectionError(); | 74 void OnConnectionError(); |
75 | 75 |
76 // We track the lifetime of incoming connection registries as it more | 76 // We track the lifetime of incoming connection registries as it more |
77 // convenient for the client. | 77 // convenient for the client. |
78 ScopedVector<Connection> incoming_connections_; | 78 ScopedVector<Connection> incoming_connections_; |
79 mojo::ShellClient* client_; | 79 mojo::ShellClient* client_; |
80 Binding<shell::mojom::ShellClient> binding_; | 80 Binding<shell::mojom::ShellClient> binding_; |
81 scoped_ptr<Connector> connector_; | 81 scoped_ptr<Connector> connector_; |
82 base::WeakPtrFactory<ShellConnection> weak_factory_; | 82 base::WeakPtrFactory<ShellConnection> weak_factory_; |
83 | 83 |
84 DISALLOW_COPY_AND_ASSIGN(ShellConnection); | 84 DISALLOW_COPY_AND_ASSIGN(ShellConnection); |
85 }; | 85 }; |
86 | 86 |
87 } // namespace mojo | 87 } // namespace mojo |
88 | 88 |
89 #endif // MOJO_SHELL_PUBLIC_CPP_SHELL_CONNECTION_H_ | 89 #endif // MOJO_SHELL_PUBLIC_CPP_SHELL_CONNECTION_H_ |
OLD | NEW |