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

Unified Diff: webrtc/p2p/stunprober/stunprober.h

Issue 1161463011: Non functional change: Move Requester to cc file (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/p2p/stunprober/stunprober.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/stunprober/stunprober.h
diff --git a/webrtc/p2p/stunprober/stunprober.h b/webrtc/p2p/stunprober/stunprober.h
index e49b5f7378b2ed22630413bf87bbe5d12e454d9a..9352e36dbc574f2346046381b73484939c792a30 100644
--- a/webrtc/p2p/stunprober/stunprober.h
+++ b/webrtc/p2p/stunprober/stunprober.h
@@ -192,80 +192,9 @@ class StunProber {
private:
// A requester tracks the requests and responses from a single socket to many
- // STUN servers
- class Requester {
- public:
- // Each Request maps to a request and response.
- struct Request {
- // Actual time the STUN bind request was sent.
- int64 sent_time_ms = 0;
- // Time the response was received.
- int64 received_time_ms = 0;
+ // STUN servers.
+ class Requester;
- // See whether the observed address returned matches the
- // local address as in StunProber.local_addr_.
- bool behind_nat = false;
-
- // Server reflexive address from STUN response for this given request.
- rtc::SocketAddress srflx_addr;
-
- rtc::IPAddress server_addr;
-
- int64 rtt() { return received_time_ms - sent_time_ms; }
- void ProcessResponse(rtc::ByteBuffer* message,
- int buf_len,
- const rtc::IPAddress& local_addr);
- };
-
- // StunProber provides |server_ips| for Requester to probe. For shared
- // socket mode, it'll be all the resolved IP addresses. For non-shared mode,
- // it'll just be a single address.
- Requester(StunProber* prober,
- ServerSocketInterface* socket,
- const std::vector<rtc::SocketAddress>& server_ips);
- virtual ~Requester();
-
- // There is no callback for SendStunRequest as the underneath socket send is
- // expected to be completed immediately. Otherwise, it'll skip this request
- // and move to the next one.
- void SendStunRequest();
-
- void ReadStunResponse();
-
- // |result| is the positive return value from RecvFrom when data is
- // available.
- void OnStunResponseReceived(int result);
-
- const std::vector<Request*>& requests() { return requests_; }
-
- // Whether this Requester has completed all requests.
- bool Done() {
- return static_cast<size_t>(num_request_sent_) == server_ips_.size();
- }
-
- private:
- Request* GetRequestByAddress(const rtc::IPAddress& ip);
-
- StunProber* prober_;
-
- // The socket for this session.
- rtc::scoped_ptr<ServerSocketInterface> socket_;
-
- // Temporary SocketAddress and buffer for RecvFrom.
- rtc::SocketAddress addr_;
- rtc::scoped_ptr<rtc::ByteBuffer> response_packet_;
-
- std::vector<Request*> requests_;
- std::vector<rtc::SocketAddress> server_ips_;
- int16 num_request_sent_ = 0;
- int16 num_response_received_ = 0;
-
- rtc::ThreadChecker& thread_checker_;
-
- DISALLOW_COPY_AND_ASSIGN(Requester);
- };
-
- private:
void OnServerResolved(int index, int result);
bool Done() {
« no previous file with comments | « no previous file | webrtc/p2p/stunprober/stunprober.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698