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 |
42 rtc::scoped_refptr<webrtc::DataChannelInterface> channel_; | 46 rtc::scoped_refptr<webrtc::DataChannelInterface> channel_; |
43 | 47 |
44 EventHandler* event_handler_ = nullptr; | 48 EventHandler* event_handler_ = nullptr; |
45 | 49 |
46 State state_ = State::CONNECTING; | 50 State state_ = State::CONNECTING; |
47 | 51 |
48 DISALLOW_COPY_AND_ASSIGN(WebrtcDataStreamAdapter); | 52 DISALLOW_COPY_AND_ASSIGN(WebrtcDataStreamAdapter); |
49 }; | 53 }; |
50 | 54 |
51 } // namespace protocol | 55 } // namespace protocol |
52 } // namespace remoting | 56 } // namespace remoting |
53 | 57 |
54 #endif // REMOTING_PROTOCOL_WEBRTC_DATA_STREAM_ADAPTER_H_ | 58 #endif // REMOTING_PROTOCOL_WEBRTC_DATA_STREAM_ADAPTER_H_ |
OLD | NEW |