| 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 SERVICES_SHELL_PUBLIC_CPP_LIB_CONNECTION_IMPL_H_ | 5 #ifndef SERVICES_SHELL_PUBLIC_CPP_LIB_CONNECTION_IMPL_H_ |
| 6 #define SERVICES_SHELL_PUBLIC_CPP_LIB_CONNECTION_IMPL_H_ | 6 #define SERVICES_SHELL_PUBLIC_CPP_LIB_CONNECTION_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/callback.h" | |
| 14 #include "mojo/public/cpp/bindings/binding.h" | 13 #include "mojo/public/cpp/bindings/binding.h" |
| 15 #include "services/shell/public/cpp/capabilities.h" | 14 #include "services/shell/public/cpp/capabilities.h" |
| 16 #include "services/shell/public/cpp/connection.h" | 15 #include "services/shell/public/cpp/connection.h" |
| 17 #include "services/shell/public/cpp/identity.h" | 16 #include "services/shell/public/cpp/identity.h" |
| 18 #include "services/shell/public/interfaces/connector.mojom.h" | 17 #include "services/shell/public/interfaces/connector.mojom.h" |
| 19 #include "services/shell/public/interfaces/interface_provider.mojom.h" | 18 #include "services/shell/public/interfaces/interface_provider.mojom.h" |
| 20 | 19 |
| 21 namespace shell { | 20 namespace shell { |
| 22 namespace internal { | 21 namespace internal { |
| 23 | 22 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 43 | 42 |
| 44 private: | 43 private: |
| 45 // Connection: | 44 // Connection: |
| 46 bool HasCapabilityClass(const std::string& class_name) const override; | 45 bool HasCapabilityClass(const std::string& class_name) const override; |
| 47 const std::string& GetConnectionName() override; | 46 const std::string& GetConnectionName() override; |
| 48 const Identity& GetRemoteIdentity() const override; | 47 const Identity& GetRemoteIdentity() const override; |
| 49 void SetConnectionLostClosure(const base::Closure& handler) override; | 48 void SetConnectionLostClosure(const base::Closure& handler) override; |
| 50 shell::mojom::ConnectResult GetResult() const override; | 49 shell::mojom::ConnectResult GetResult() const override; |
| 51 bool IsPending() const override; | 50 bool IsPending() const override; |
| 52 uint32_t GetRemoteInstanceID() const override; | 51 uint32_t GetRemoteInstanceID() const override; |
| 53 void AddConnectionCompletedClosure(const base::Closure& callback) override; | 52 void AddConnectionCompletedClosure(const mojo::Closure& callback) override; |
| 54 bool AllowsInterface(const std::string& interface_name) const override; | 53 bool AllowsInterface(const std::string& interface_name) const override; |
| 55 mojom::InterfaceProvider* GetRemoteInterfaceProvider() override; | 54 mojom::InterfaceProvider* GetRemoteInterfaceProvider() override; |
| 56 InterfaceRegistry* GetInterfaceRegistry() override; | 55 InterfaceRegistry* GetInterfaceRegistry() override; |
| 57 RemoteInterfaceRegistry* GetRemoteInterfaceRegistry() override; | 56 RemoteInterfaceRegistry* GetRemoteInterfaceRegistry() override; |
| 58 base::WeakPtr<Connection> GetWeakPtr() override; | 57 base::WeakPtr<Connection> GetWeakPtr() override; |
| 59 | 58 |
| 60 void OnConnectionCompleted(shell::mojom::ConnectResult result, | 59 void OnConnectionCompleted(shell::mojom::ConnectResult result, |
| 61 mojo::String target_user_id, | 60 mojo::String target_user_id, |
| 62 uint32_t target_application_id); | 61 uint32_t target_application_id); |
| 63 | 62 |
| 64 const std::string connection_name_; | 63 const std::string connection_name_; |
| 65 Identity remote_; | 64 Identity remote_; |
| 66 uint32_t remote_id_ = shell::mojom::kInvalidInstanceID; | 65 uint32_t remote_id_ = shell::mojom::kInvalidInstanceID; |
| 67 | 66 |
| 68 State state_; | 67 State state_; |
| 69 shell::mojom::ConnectResult result_ = shell::mojom::ConnectResult::SUCCEEDED; | 68 shell::mojom::ConnectResult result_ = shell::mojom::ConnectResult::SUCCEEDED; |
| 70 std::vector<base::Closure> connection_completed_callbacks_; | 69 std::vector<mojo::Closure> connection_completed_callbacks_; |
| 71 | 70 |
| 72 InterfaceRegistry interfaces_; | 71 InterfaceRegistry interfaces_; |
| 73 RemoteInterfaceRegistry remote_interfaces_; | 72 RemoteInterfaceRegistry remote_interfaces_; |
| 74 | 73 |
| 75 const CapabilityRequest capability_request_; | 74 const CapabilityRequest capability_request_; |
| 76 const bool allow_all_interfaces_; | 75 const bool allow_all_interfaces_; |
| 77 | 76 |
| 78 base::WeakPtrFactory<ConnectionImpl> weak_factory_; | 77 base::WeakPtrFactory<ConnectionImpl> weak_factory_; |
| 79 | 78 |
| 80 DISALLOW_COPY_AND_ASSIGN(ConnectionImpl); | 79 DISALLOW_COPY_AND_ASSIGN(ConnectionImpl); |
| 81 }; | 80 }; |
| 82 | 81 |
| 83 } // namespace internal | 82 } // namespace internal |
| 84 } // namespace shell | 83 } // namespace shell |
| 85 | 84 |
| 86 #endif // SERVICES_SHELL_PUBLIC_CPP_LIB_CONNECTION_IMPL_H_ | 85 #endif // SERVICES_SHELL_PUBLIC_CPP_LIB_CONNECTION_IMPL_H_ |
| OLD | NEW |