Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(815)

Side by Side Diff: webrtc/p2p/base/icetransportinternal.h

Issue 2606123002: Remove the dependency of TransportChannel and TransportChannelImpl. (Closed)
Patch Set: Revert the change of stun_unittests Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #ifndef WEBRTC_P2P_BASE_ICETRANSPORTINTERNAL_H_ 11 #ifndef WEBRTC_P2P_BASE_ICETRANSPORTINTERNAL_H_
12 #define WEBRTC_P2P_BASE_ICETRANSPORTINTERNAL_H_ 12 #define WEBRTC_P2P_BASE_ICETRANSPORTINTERNAL_H_
13 13
14 #include "webrtc/p2p/base/transportchannelimpl.h"
15
16 namespace cricket {
17
18 typedef TransportChannel IceTransportInternal;
19 typedef TransportChannelImpl IceTransportInternal2;
20
21 } // namespace cricket
22
23 /*
24 #include <string> 14 #include <string>
25 15
26 #include "webrtc/p2p/base/candidate.h" 16 #include "webrtc/p2p/base/candidate.h"
27 #include "webrtc/p2p/base/candidatepairinterface.h" 17 #include "webrtc/p2p/base/candidatepairinterface.h"
28 #include "webrtc/p2p/base/jseptransport.h" 18 #include "webrtc/p2p/base/jseptransport.h"
29 #include "webrtc/p2p/base/packettransportinterface.h" 19 #include "webrtc/p2p/base/packettransportinterface.h"
30 #include "webrtc/p2p/base/transportdescription.h" 20 #include "webrtc/p2p/base/transportdescription.h"
31 21
32 namespace webrtc { 22 namespace webrtc {
33 class MetricsObserverInterface; 23 class MetricsObserverInterface;
34 } 24 }
35 25
36 namespace cricket { 26 namespace cricket {
37 27
38 enum class TransportState { 28 class IceTransportInternal;
29 typedef IceTransportInternal IceTransportInternal2;
pthatcher1 2017/01/13 22:41:16 IceTransportInternal2? What is that?
Taylor Brandstetter 2017/01/13 23:49:54 Long story. Basically it's part of what we decided
30
31 // TODO(zhihuang): replace it with PeerConnectionInterface::IceConnectionState.
pthatcher1 2017/01/13 22:41:16 "replace it" => "Replace this"
Zhi Huang 2017/01/16 10:38:24 Done.
32 enum class IceTransportState {
39 STATE_INIT, 33 STATE_INIT,
40 STATE_CONNECTING, // Will enter this state once a connection is created 34 STATE_CONNECTING, // Will enter this state once a connection is created
41 STATE_COMPLETED, 35 STATE_COMPLETED,
42 STATE_FAILEDs 36 STATE_FAILED
43 }; 37 };
44 38
45 // TODO(zhihuang): Remove this once it's no longer used in 39 // TODO(zhihuang): Remove this once it's no longer used in
46 // remoting/protocol/libjingle_transport_factory.cc 40 // remoting/protocol/libjingle_transport_factory.cc
47 enum IceProtocolType { 41 enum IceProtocolType {
48 ICEPROTO_RFC5245 // Standard RFC 5245 version of ICE. 42 ICEPROTO_RFC5245 // Standard RFC 5245 version of ICE.
49 }; 43 };
50 44
51 // IceTransportInternal is an internal abstract class that does ICE. 45 // IceTransportInternal is an internal abstract class that does ICE.
52 // Once the public interface is supported, 46 // Once the public interface is supported,
53 // (https://www.w3.org/TR/webrtc/#rtcicetransport-interface) 47 // (https://www.w3.org/TR/webrtc/#rtcicetransport-interface)
54 // the IceTransportInterface will be split from this class. 48 // the IceTransportInterface will be split from this class.
55 class IceTransportInternal : public rtc::PacketTransportInterface { 49 class IceTransportInternal : public rtc::PacketTransportInterface {
56 public: 50 public:
57 virtual ~IceTransportInternal(); 51 virtual ~IceTransportInternal(){};
58 52
59 virtual TransportState GetState() const = 0; 53 virtual IceTransportState GetState() const = 0;
60 54
61 virtual const std::string& transport_name() const = 0; 55 virtual const std::string& transport_name() const = 0;
62 56
63 virtual int component() const = 0; 57 virtual int component() const = 0;
64 58
65 virtual IceRole GetIceRole() const = 0; 59 virtual IceRole GetIceRole() const = 0;
66 60
67 virtual void SetIceRole(IceRole role) = 0; 61 virtual void SetIceRole(IceRole role) = 0;
68 62
69 virtual void SetIceTiebreaker(uint64_t tiebreaker) = 0; 63 virtual void SetIceTiebreaker(uint64_t tiebreaker) = 0;
(...skipping 28 matching lines...) Expand all
98 92
99 virtual void SetMetricsObserver( 93 virtual void SetMetricsObserver(
100 webrtc::MetricsObserverInterface* observer) = 0; 94 webrtc::MetricsObserverInterface* observer) = 0;
101 95
102 virtual void AddRemoteCandidate(const Candidate& candidate) = 0; 96 virtual void AddRemoteCandidate(const Candidate& candidate) = 0;
103 97
104 virtual void RemoveRemoteCandidate(const Candidate& candidate) = 0; 98 virtual void RemoveRemoteCandidate(const Candidate& candidate) = 0;
105 99
106 virtual IceGatheringState gathering_state() const = 0; 100 virtual IceGatheringState gathering_state() const = 0;
107 101
102 // Returns the current stats for this connection.
103 virtual bool GetStats(ConnectionInfos* infos) = 0;
104
108 sigslot::signal1<IceTransportInternal*> SignalGatheringState; 105 sigslot::signal1<IceTransportInternal*> SignalGatheringState;
109 106
110 // Handles sending and receiving of candidates. 107 // Handles sending and receiving of candidates.
111 sigslot::signal2<IceTransportInternal*, const Candidate&> 108 sigslot::signal2<IceTransportInternal*, const Candidate&>
112 SignalCandidateGathered; 109 SignalCandidateGathered;
113 110
114 sigslot::signal2<IceTransportInternal*, const Candidates&> 111 sigslot::signal2<IceTransportInternal*, const Candidates&>
115 SignalCandidatesRemoved; 112 SignalCandidatesRemoved;
116 113
117 // Deprecated by SignalSelectedCandidatePairChanged 114 // Deprecated by SignalSelectedCandidatePairChanged
118 // This signal occurs when there is a change in the way that packets are 115 // This signal occurs when there is a change in the way that packets are
119 // being routed, i.e. to a different remote location. The candidate 116 // being routed, i.e. to a different remote location. The candidate
120 // indicates where and how we are currently sending media. 117 // indicates where and how we are currently sending media.
121 sigslot::signal2<IceTransportInternal*, const Candidate&> SignalRouteChange; 118 sigslot::signal2<IceTransportInternal*, const Candidate&> SignalRouteChange;
122 119
123 // Signalled when the current selected candidate pair has changed. 120 // Signalled when the current selected candidate pair has changed.
124 // The first parameter is the transport that signals the event. 121 // The first parameter is the transport that signals the event.
125 // The second parameter is the new selected candidate pair. The third 122 // The second parameter is the new selected candidate pair. The third
126 // parameter is the last packet id sent on the previous candidate pair. 123 // parameter is the last packet id sent on the previous candidate pair.
127 // The fourth parameter is a boolean which is true if the Transport 124 // The fourth parameter is a boolean which is true if the Transport
128 // is ready to send with this candidate pair. 125 // is ready to send with this candidate pair.
129 sigslot::signal4<IceTransportInternal*, CandidatePairInterface*, int, bool> 126 sigslot::signal4<IceTransportInternal*, CandidatePairInterface*, int, bool>
130 SignalSelectedCandidatePairChanged; 127 SignalSelectedCandidatePairChanged;
131 128
129 // Invoked when there is conflict in the ICE role between local and remote
130 // agents.
131 sigslot::signal1<IceTransportInternal*> SignalRoleConflict;
132
133 // Emitted whenever the transport state changed.
134 sigslot::signal1<IceTransportInternal*> SignalStateChanged;
135
132 // Invoked when the transport is being destroyed. 136 // Invoked when the transport is being destroyed.
133 sigslot::signal1<IceTransportInternal*> SignalDestroyed; 137 sigslot::signal1<IceTransportInternal*> SignalDestroyed;
134 138
135 // Debugging description of this transport. 139 // Debugging description of this transport.
136 std::string ToString() const; 140 std::string debug_name() const override {
141 return transport_name() + " " + std::to_string(component());
142 }
137 }; 143 };
138 144
139 } // namespace cricket 145 } // namespace cricket
140 */ 146
141 #endif // WEBRTC_P2P_BASE_ICETRANSPORTINTERNAL_H_ 147 #endif // WEBRTC_P2P_BASE_ICETRANSPORTINTERNAL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698