Chromium Code Reviews| Index: webrtc/p2p/base/portallocator.h |
| diff --git a/webrtc/p2p/base/portallocator.h b/webrtc/p2p/base/portallocator.h |
| index 8befbadcc73981375d22ba23b321c417fbb2cd21..747b0dd3ab528bcb28d3babf3f00b3bfeab6b733 100644 |
| --- a/webrtc/p2p/base/portallocator.h |
| +++ b/webrtc/p2p/base/portallocator.h |
| @@ -23,6 +23,10 @@ |
| #include "webrtc/base/sigslot.h" |
| #include "webrtc/base/thread.h" |
| +namespace webrtc { |
| +class MetricsObserverInterface; |
| +} |
| + |
| namespace cricket { |
| // PortAllocator is responsible for allocating Port types for a given |
| @@ -72,6 +76,16 @@ enum { |
| PORTALLOCATOR_DISABLE_COSTLY_NETWORKS = 0x2000, |
| }; |
| +// Defines various reasons that have caused ICE regathering. |
| +enum class IceRegatheringReason { |
| + ICE_RESTART_WHEN_CONNECTED, |
| + ICE_RESTART_WHEN_CONNECTING, |
| + ICE_RESTART_WHEN_DISCONNECTED, |
|
pthatcher2
2016/10/04 06:03:17
Shouldn't these be "_WHILE_" rather than "_WHEN_"?
honghaiz3
2016/10/05 05:01:53
renamed class and variables as suggested in other
|
| + CONTINUAL_GATHERING_BY_NETWORK_CHANGE, |
| + CONTINUAL_GATHERING_BY_NETWORK_FAILURE, |
|
pthatcher2
2016/10/04 06:03:17
Shouldn't these be "_FOR_" rather than "_BY_"?
honghaiz3
2016/10/05 05:01:53
Renames this too.
|
| + MAX_VALUE |
| +}; |
| + |
| const uint32_t kDefaultPortAllocatorFlags = 0; |
| const uint32_t kDefaultStepDelay = 1000; // 1 sec step delay. |
| @@ -216,6 +230,8 @@ class PortAllocatorSession : public sigslot::has_slots<> { |
| SignalCandidatesRemoved; |
| sigslot::signal1<PortAllocatorSession*> SignalCandidatesAllocationDone; |
| + sigslot::signal1<IceRegatheringReason> SignalIceRegatheringReason; |
|
pthatcher2
2016/10/04 06:03:17
Would it make more sense to call this SignalIceReg
honghaiz3
2016/10/05 05:01:53
Done.
|
| + |
| virtual uint32_t generation() { return generation_; } |
| virtual void set_generation(uint32_t generation) { generation_ = generation; } |
| sigslot::signal1<PortAllocatorSession*> SignalDestroyed; |
| @@ -370,6 +386,12 @@ class PortAllocator : public sigslot::has_slots<> { |
| const std::string& origin() const { return origin_; } |
| void set_origin(const std::string& origin) { origin_ = origin; } |
| + virtual void ReportIceRegatheringReason(IceRegatheringReason reason) {} |
| + |
| + void set_metrics_observer(webrtc::MetricsObserverInterface* observer) { |
| + metrics_observer_ = observer; |
| + } |
| + |
| protected: |
| virtual PortAllocatorSession* CreateSessionInternal( |
| const std::string& content_name, |
| @@ -377,6 +399,10 @@ class PortAllocator : public sigslot::has_slots<> { |
| const std::string& ice_ufrag, |
| const std::string& ice_pwd) = 0; |
| + webrtc::MetricsObserverInterface* metrics_observer() { |
| + return metrics_observer_; |
| + } |
| + |
| uint32_t flags_; |
| std::string agent_; |
| rtc::ProxyInfo proxy_; |
| @@ -397,6 +423,8 @@ class PortAllocator : public sigslot::has_slots<> { |
| int allocated_pooled_session_count_ = 0; |
| std::deque<std::unique_ptr<PortAllocatorSession>> pooled_sessions_; |
| bool prune_turn_ports_ = false; |
| + |
| + webrtc::MetricsObserverInterface* metrics_observer_ = nullptr; |
| }; |
| } // namespace cricket |