| 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 <queue> | 8 #include <queue> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 69 |
| 70 // The IP endpoint for the destination of the channel. | 70 // The IP endpoint for the destination of the channel. |
| 71 virtual const net::IPEndPoint& ip_endpoint() const = 0; | 71 virtual const net::IPEndPoint& ip_endpoint() const = 0; |
| 72 | 72 |
| 73 // Channel id generated by the ApiResourceManager. | 73 // Channel id generated by the ApiResourceManager. |
| 74 virtual int id() const = 0; | 74 virtual int id() const = 0; |
| 75 | 75 |
| 76 // Sets the channel id generated by ApiResourceManager. | 76 // Sets the channel id generated by ApiResourceManager. |
| 77 virtual void set_id(int id) = 0; | 77 virtual void set_id(int id) = 0; |
| 78 | 78 |
| 79 // Sets whether this socket is for a channel to a device claiming a video out |
| 80 // capability. |
| 81 virtual void set_has_video_out(bool has_video_out) = 0; |
| 82 |
| 79 // The authentication level requested for the channel. | 83 // The authentication level requested for the channel. |
| 80 virtual ChannelAuthType channel_auth() const = 0; | 84 virtual ChannelAuthType channel_auth() const = 0; |
| 81 | 85 |
| 82 // Returns a cast:// or casts:// URL for the channel endpoint. | 86 // Returns a cast:// or casts:// URL for the channel endpoint. |
| 83 // For backwards compatibility. | 87 // For backwards compatibility. |
| 84 virtual std::string cast_url() const = 0; | 88 virtual std::string cast_url() const = 0; |
| 85 | 89 |
| 86 // The ready state of the channel. | 90 // The ready state of the channel. |
| 87 virtual ReadyState ready_state() const = 0; | 91 virtual ReadyState ready_state() const = 0; |
| 88 | 92 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 ~CastSocketImpl() override; | 135 ~CastSocketImpl() override; |
| 132 | 136 |
| 133 // CastSocket interface. | 137 // CastSocket interface. |
| 134 void Connect(scoped_ptr<CastTransport::Delegate> delegate, | 138 void Connect(scoped_ptr<CastTransport::Delegate> delegate, |
| 135 base::Callback<void(ChannelError)> callback) override; | 139 base::Callback<void(ChannelError)> callback) override; |
| 136 CastTransport* transport() const override; | 140 CastTransport* transport() const override; |
| 137 void Close(const net::CompletionCallback& callback) override; | 141 void Close(const net::CompletionCallback& callback) override; |
| 138 const net::IPEndPoint& ip_endpoint() const override; | 142 const net::IPEndPoint& ip_endpoint() const override; |
| 139 int id() const override; | 143 int id() const override; |
| 140 void set_id(int channel_id) override; | 144 void set_id(int channel_id) override; |
| 145 void set_has_video_out(bool has_video_out) override; |
| 141 ChannelAuthType channel_auth() const override; | 146 ChannelAuthType channel_auth() const override; |
| 142 std::string cast_url() const override; | 147 std::string cast_url() const override; |
| 143 ReadyState ready_state() const override; | 148 ReadyState ready_state() const override; |
| 144 ChannelError error_state() const override; | 149 ChannelError error_state() const override; |
| 145 | 150 |
| 146 // Required by ApiResourceManager. | 151 // Required by ApiResourceManager. |
| 147 static const char* service_name() { return "CastSocketManager"; } | 152 static const char* service_name() { return "CastSocketManager"; } |
| 148 | 153 |
| 149 protected: | 154 protected: |
| 150 // CastTransport::Delegate methods for receiving handshake messages. | 155 // CastTransport::Delegate methods for receiving handshake messages. |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 // Duration to wait before timing out. | 292 // Duration to wait before timing out. |
| 288 base::TimeDelta connect_timeout_; | 293 base::TimeDelta connect_timeout_; |
| 289 | 294 |
| 290 // Timer invoked when the connection has timed out. | 295 // Timer invoked when the connection has timed out. |
| 291 scoped_ptr<base::Timer> connect_timeout_timer_; | 296 scoped_ptr<base::Timer> connect_timeout_timer_; |
| 292 | 297 |
| 293 // Set when a timeout is triggered and the connection process has | 298 // Set when a timeout is triggered and the connection process has |
| 294 // canceled. | 299 // canceled. |
| 295 bool is_canceled_; | 300 bool is_canceled_; |
| 296 | 301 |
| 302 // Whether this socket is for a channel to a device claiming a video out |
| 303 // capability. |
| 304 bool has_video_out_; |
| 305 |
| 297 // Connection flow state machine state. | 306 // Connection flow state machine state. |
| 298 proto::ConnectionState connect_state_; | 307 proto::ConnectionState connect_state_; |
| 299 | 308 |
| 300 // Write flow state machine state. | 309 // Write flow state machine state. |
| 301 proto::WriteState write_state_; | 310 proto::WriteState write_state_; |
| 302 | 311 |
| 303 // Read flow state machine state. | 312 // Read flow state machine state. |
| 304 proto::ReadState read_state_; | 313 proto::ReadState read_state_; |
| 305 | 314 |
| 306 // The last error encountered by the channel. | 315 // The last error encountered by the channel. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 323 // Caller's message read and error handling delegate. | 332 // Caller's message read and error handling delegate. |
| 324 scoped_ptr<CastTransport::Delegate> read_delegate_; | 333 scoped_ptr<CastTransport::Delegate> read_delegate_; |
| 325 | 334 |
| 326 DISALLOW_COPY_AND_ASSIGN(CastSocketImpl); | 335 DISALLOW_COPY_AND_ASSIGN(CastSocketImpl); |
| 327 }; | 336 }; |
| 328 } // namespace cast_channel | 337 } // namespace cast_channel |
| 329 } // namespace core_api | 338 } // namespace core_api |
| 330 } // namespace extensions | 339 } // namespace extensions |
| 331 | 340 |
| 332 #endif // EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_SOCKET_H_ | 341 #endif // EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_SOCKET_H_ |
| OLD | NEW |