OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef COMPONENTS_DEVTOOLS_BRIDGE_ABSTRACT_PEER_CONNECTION_H_ | |
6 #define COMPONENTS_DEVTOOLS_BRIDGE_ABSTRACT_PEER_CONNECTION_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/memory/scoped_ptr.h" | |
11 | |
12 namespace devtools_bridge { | |
13 | |
14 class AbstractDataChannel; | |
15 | |
16 /** | |
17 * WebRTC PeerConnection adapter for DevTools bridge. | |
18 */ | |
19 class AbstractPeerConnection { | |
20 public: | |
21 /** | |
22 * Delegate is called on signaling thread. | |
23 */ | |
24 class Delegate { | |
25 public: | |
26 Delegate() {} | |
27 virtual ~Delegate() {} | |
28 | |
29 virtual void OnIceConnectionChange(bool connected) = 0; | |
30 virtual void OnIceCandidate( | |
31 const std::string& sdp_mid, | |
32 int sdp_mline_index, | |
33 const std::string& sdp) = 0; | |
34 virtual void OnLocalOfferCreatedAndSetSet( | |
35 const std::string& description) = 0; | |
36 virtual void OnLocalAnswerCreatedAndSetSet( | |
37 const std::string& description) = 0; | |
38 virtual void OnRemoteDescriptionSet() = 0; | |
39 virtual void OnFailure(const std::string& description) = 0; | |
40 | |
41 private: | |
42 DISALLOW_COPY_AND_ASSIGN(Delegate); | |
43 }; | |
44 | |
45 AbstractPeerConnection() {} | |
46 virtual ~AbstractPeerConnection() {} | |
47 | |
48 virtual void CreateAndSetLocalOffer() = 0; | |
49 virtual void CreateAndSetLocalAnswer() = 0; | |
50 virtual void SetRemoteOffer(const std::string& description) = 0; | |
51 virtual void SetRemoteAnswer(const std::string& description) = 0; | |
52 virtual void AddIceCandidate( | |
53 const std::string& sdp_mid, | |
54 int sdp_mline_index, | |
55 const std::string& sdp) = 0; | |
56 | |
57 virtual scoped_ptr<AbstractDataChannel> CreateDataChannel(int channelId) = 0; | |
58 | |
59 private: | |
60 DISALLOW_COPY_AND_ASSIGN(AbstractPeerConnection); | |
61 }; | |
62 | |
63 } // namespace devtools_bridge | |
64 | |
65 #endif // COMPONENTS_DEVTOOLS_BRIDGE_ABSTRACT_PEER_CONNECTION_H_ | |
OLD | NEW |