| Index: webrtc/p2p/client/basicportallocator.h
|
| diff --git a/webrtc/p2p/client/basicportallocator.h b/webrtc/p2p/client/basicportallocator.h
|
| index 8ea66c431e76d560a6299c2831d77a1a83dfeb06..0d27bdd22fdcbc202e6ce637dafe89c0f6ae5dfd 100644
|
| --- a/webrtc/p2p/client/basicportallocator.h
|
| +++ b/webrtc/p2p/client/basicportallocator.h
|
| @@ -47,7 +47,7 @@ class BasicPortAllocator : public PortAllocator {
|
|
|
| int network_ignore_mask() const { return network_ignore_mask_; }
|
|
|
| - rtc::NetworkManager* network_manager() { return network_manager_; }
|
| + rtc::NetworkManager* network_manager() const { return network_manager_; }
|
|
|
| // If socket_factory() is set to NULL each PortAllocatorSession
|
| // creates its own socket factory.
|
| @@ -97,6 +97,7 @@ class BasicPortAllocatorSession : public PortAllocatorSession,
|
| std::vector<PortInterface*> ReadyPorts() const override;
|
| std::vector<Candidate> ReadyCandidates() const override;
|
| bool CandidatesAllocationDone() const override;
|
| + void RegatherOnFailedNetworks() override;
|
|
|
| protected:
|
| void UpdateIceParametersInternal() override;
|
| @@ -170,7 +171,8 @@ class BasicPortAllocatorSession : public PortAllocatorSession,
|
| void MaybeSignalCandidatesAllocationDone();
|
| void OnPortAllocationComplete(AllocationSequence* seq);
|
| PortData* FindPort(Port* port);
|
| - void GetNetworks(std::vector<rtc::Network*>* networks);
|
| + std::vector<rtc::Network*> GetNetworks();
|
| + std::vector<rtc::Network*> GetFailedNetworks();
|
|
|
| bool CheckCandidateFilter(const Candidate& c) const;
|
| bool CandidatePairable(const Candidate& c, const Port* port) const;
|
| @@ -178,6 +180,13 @@ class BasicPortAllocatorSession : public PortAllocatorSession,
|
| // in order to avoid leaking any information.
|
| Candidate SanitizeRelatedAddress(const Candidate& c) const;
|
|
|
| + // Removes the ports and candidates on given networks.
|
| + void RemovePortsAndCandidates(const std::vector<rtc::Network*>& networks);
|
| + // Gets filtered and sanitized candidates generated from a port and
|
| + // append to |candidates|.
|
| + void GetCandidatesFromPort(const PortData& data,
|
| + std::vector<Candidate>* candidates) const;
|
| +
|
| BasicPortAllocator* allocator_;
|
| rtc::Thread* network_thread_;
|
| std::unique_ptr<rtc::PacketSocketFactory> owned_socket_factory_;
|
| @@ -255,11 +264,13 @@ class AllocationSequence : public rtc::MessageHandler,
|
| ~AllocationSequence();
|
| bool Init();
|
| void Clear();
|
| - void OnNetworkRemoved();
|
| + void OnNetworkFailed();
|
|
|
| State state() const { return state_; }
|
| - const rtc::Network* network() const { return network_; }
|
| - bool network_removed() const { return network_removed_; }
|
| + rtc::Network* network() const { return network_; }
|
| +
|
| + bool network_failed() const { return network_failed_; }
|
| + void set_network_failed() { network_failed_ = true; }
|
|
|
| // Disables the phases for a new sequence that this one already covers for an
|
| // equivalent network setup.
|
| @@ -309,7 +320,7 @@ class AllocationSequence : public rtc::MessageHandler,
|
| void OnPortDestroyed(PortInterface* port);
|
|
|
| BasicPortAllocatorSession* session_;
|
| - bool network_removed_ = false;
|
| + bool network_failed_ = false;
|
| rtc::Network* network_;
|
| rtc::IPAddress ip_;
|
| PortConfiguration* config_;
|
|
|