| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 REMOTING_PROTOCOL_WEBRTC_DATA_STREAM_ADAPTER_H_ | 5 #ifndef REMOTING_PROTOCOL_WEBRTC_DATA_STREAM_ADAPTER_H_ |
| 6 #define REMOTING_PROTOCOL_WEBRTC_DATA_STREAM_ADAPTER_H_ | 6 #define REMOTING_PROTOCOL_WEBRTC_DATA_STREAM_ADAPTER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 void Send(google::protobuf::MessageLite* message, | 32 void Send(google::protobuf::MessageLite* message, |
| 33 const base::Closure& done) override; | 33 const base::Closure& done) override; |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 enum class State { CONNECTING, OPEN, CLOSED }; | 36 enum class State { CONNECTING, OPEN, CLOSED }; |
| 37 | 37 |
| 38 // webrtc::DataChannelObserver interface. | 38 // webrtc::DataChannelObserver interface. |
| 39 void OnStateChange() override; | 39 void OnStateChange() override; |
| 40 void OnMessage(const webrtc::DataBuffer& buffer) override; | 40 void OnMessage(const webrtc::DataBuffer& buffer) override; |
| 41 | 41 |
| 42 void OnConnected(); | |
| 43 | |
| 44 void OnClosed(); | |
| 45 | |
| 46 rtc::scoped_refptr<webrtc::DataChannelInterface> channel_; | 42 rtc::scoped_refptr<webrtc::DataChannelInterface> channel_; |
| 47 | 43 |
| 48 EventHandler* event_handler_ = nullptr; | 44 EventHandler* event_handler_ = nullptr; |
| 49 | 45 |
| 50 State state_ = State::CONNECTING; | 46 State state_ = State::CONNECTING; |
| 51 | 47 |
| 52 DISALLOW_COPY_AND_ASSIGN(WebrtcDataStreamAdapter); | 48 DISALLOW_COPY_AND_ASSIGN(WebrtcDataStreamAdapter); |
| 53 }; | 49 }; |
| 54 | 50 |
| 55 } // namespace protocol | 51 } // namespace protocol |
| 56 } // namespace remoting | 52 } // namespace remoting |
| 57 | 53 |
| 58 #endif // REMOTING_PROTOCOL_WEBRTC_DATA_STREAM_ADAPTER_H_ | 54 #endif // REMOTING_PROTOCOL_WEBRTC_DATA_STREAM_ADAPTER_H_ |
| OLD | NEW |