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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 ~CastSocket() override {} | 63 ~CastSocket() override {} |
64 | 64 |
65 // Used by BrowserContextKeyedAPIFactory. | 65 // Used by BrowserContextKeyedAPIFactory. |
66 static const char* service_name() { return "CastSocketImplManager"; } | 66 static const char* service_name() { return "CastSocketImplManager"; } |
67 | 67 |
68 // Connects the channel to the peer. If successful, the channel will be in | 68 // Connects the channel to the peer. If successful, the channel will be in |
69 // READY_STATE_OPEN. DO NOT delete the CastSocket object in |callback|. | 69 // READY_STATE_OPEN. DO NOT delete the CastSocket object in |callback|. |
70 // Instead use Close(). | 70 // Instead use Close(). |
71 // |callback| will be invoked with any ChannelError that occurred, or | 71 // |callback| will be invoked with any ChannelError that occurred, or |
72 // CHANNEL_ERROR_NONE if successful. | 72 // CHANNEL_ERROR_NONE if successful. |
| 73 // If the CastSocket is destroyed while the connection is pending, |callback| |
| 74 // will be invoked with CHANNEL_ERROR_UNKNOWN. In this case, invoking |
| 75 // |callback| must not result in any re-entrancy behavior. |
73 // |delegate| receives message receipt and error events. | 76 // |delegate| receives message receipt and error events. |
74 // Ownership of |delegate| is transferred to this CastSocket. | 77 // Ownership of |delegate| is transferred to this CastSocket. |
75 virtual void Connect(std::unique_ptr<CastTransport::Delegate> delegate, | 78 virtual void Connect(std::unique_ptr<CastTransport::Delegate> delegate, |
76 base::Callback<void(ChannelError)> callback) = 0; | 79 base::Callback<void(ChannelError)> callback) = 0; |
77 | 80 |
78 // Closes the channel if not already closed. On completion, the channel will | 81 // Closes the channel if not already closed. On completion, the channel will |
79 // be in READY_STATE_CLOSED. | 82 // be in READY_STATE_CLOSED. |
80 // | 83 // |
81 // It is fine to delete this object in |callback|. | 84 // It is fine to delete this object in |callback|. |
82 virtual void Close(const net::CompletionCallback& callback) = 0; | 85 virtual void Close(const net::CompletionCallback& callback) = 0; |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 // information. | 381 // information. |
379 AuthTransportDelegate* auth_delegate_; | 382 AuthTransportDelegate* auth_delegate_; |
380 | 383 |
381 DISALLOW_COPY_AND_ASSIGN(CastSocketImpl); | 384 DISALLOW_COPY_AND_ASSIGN(CastSocketImpl); |
382 }; | 385 }; |
383 } // namespace cast_channel | 386 } // namespace cast_channel |
384 } // namespace api | 387 } // namespace api |
385 } // namespace extensions | 388 } // namespace extensions |
386 | 389 |
387 #endif // EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_SOCKET_H_ | 390 #endif // EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_SOCKET_H_ |
OLD | NEW |