| 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 EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_SOCKET_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_SOCKET_H_ |
| 6 #define EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_SOCKET_H_ | 6 #define EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_SOCKET_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <queue> | 10 #include <queue> |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 // |channel_auth|. |owner_extension_id| is the id of the extension that opened | 138 // |channel_auth|. |owner_extension_id| is the id of the extension that opened |
| 139 // the socket. |channel_auth| must not be CHANNEL_AUTH_NONE. | 139 // the socket. |channel_auth| must not be CHANNEL_AUTH_NONE. |
| 140 // Parameters: | 140 // Parameters: |
| 141 // |owner_extension_id|: ID of the extension calling the API. | 141 // |owner_extension_id|: ID of the extension calling the API. |
| 142 // |ip_endpoint|: IP address of the remote host. | 142 // |ip_endpoint|: IP address of the remote host. |
| 143 // |channel_auth|: Authentication method used for connecting to a Cast | 143 // |channel_auth|: Authentication method used for connecting to a Cast |
| 144 // receiver. | 144 // receiver. |
| 145 // |net_log|: Log of socket events. | 145 // |net_log|: Log of socket events. |
| 146 // |connect_timeout|: Connection timeout interval. | 146 // |connect_timeout|: Connection timeout interval. |
| 147 // |logger|: Log of cast channel events. | 147 // |logger|: Log of cast channel events. |
| 148 // |nonce|: The nonce challenge. |
| 148 CastSocketImpl(const std::string& owner_extension_id, | 149 CastSocketImpl(const std::string& owner_extension_id, |
| 149 const net::IPEndPoint& ip_endpoint, | 150 const net::IPEndPoint& ip_endpoint, |
| 150 ChannelAuthType channel_auth, | 151 ChannelAuthType channel_auth, |
| 151 net::NetLog* net_log, | 152 net::NetLog* net_log, |
| 152 const base::TimeDelta& connect_timeout, | 153 const base::TimeDelta& connect_timeout, |
| 153 bool keep_alive, | 154 bool keep_alive, |
| 154 const scoped_refptr<Logger>& logger, | 155 const scoped_refptr<Logger>& logger, |
| 155 uint64_t device_capabilities); | 156 uint64_t device_capabilities, |
| 157 const std::string& nonce); |
| 156 | 158 |
| 157 // Ensures that the socket is closed. | 159 // Ensures that the socket is closed. |
| 158 ~CastSocketImpl() override; | 160 ~CastSocketImpl() override; |
| 159 | 161 |
| 160 // CastSocket interface. | 162 // CastSocket interface. |
| 161 void Connect(std::unique_ptr<CastTransport::Delegate> delegate, | 163 void Connect(std::unique_ptr<CastTransport::Delegate> delegate, |
| 162 base::Callback<void(ChannelError)> callback) override; | 164 base::Callback<void(ChannelError)> callback) override; |
| 163 CastTransport* transport() const override; | 165 CastTransport* transport() const override; |
| 164 void Close(const net::CompletionCallback& callback) override; | 166 void Close(const net::CompletionCallback& callback) override; |
| 165 const net::IPEndPoint& ip_endpoint() const override; | 167 const net::IPEndPoint& ip_endpoint() const override; |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 // Cast message formatting and parsing layer. | 374 // Cast message formatting and parsing layer. |
| 373 std::unique_ptr<CastTransport> transport_; | 375 std::unique_ptr<CastTransport> transport_; |
| 374 | 376 |
| 375 // Caller's message read and error handling delegate. | 377 // Caller's message read and error handling delegate. |
| 376 std::unique_ptr<CastTransport::Delegate> delegate_; | 378 std::unique_ptr<CastTransport::Delegate> delegate_; |
| 377 | 379 |
| 378 // Raw pointer to the auth handshake delegate. Used to get detailed error | 380 // Raw pointer to the auth handshake delegate. Used to get detailed error |
| 379 // information. | 381 // information. |
| 380 AuthTransportDelegate* auth_delegate_; | 382 AuthTransportDelegate* auth_delegate_; |
| 381 | 383 |
| 384 // The nonce challenge to send to the Cast receiver. |
| 385 std::string nonce_; |
| 386 |
| 382 DISALLOW_COPY_AND_ASSIGN(CastSocketImpl); | 387 DISALLOW_COPY_AND_ASSIGN(CastSocketImpl); |
| 383 }; | 388 }; |
| 384 } // namespace cast_channel | 389 } // namespace cast_channel |
| 385 } // namespace api | 390 } // namespace api |
| 386 } // namespace extensions | 391 } // namespace extensions |
| 387 | 392 |
| 388 #endif // EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_SOCKET_H_ | 393 #endif // EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_SOCKET_H_ |
| OLD | NEW |