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

Unified Diff: webrtc/p2p/base/faketransportcontroller.h

Issue 2163683003: Relanding: Allow the DTLS fingerprint verification to occur after the handshake. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixing comment grammar. Created 4 years, 3 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 | « webrtc/p2p/base/dtlstransportchannel_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/faketransportcontroller.h
diff --git a/webrtc/p2p/base/faketransportcontroller.h b/webrtc/p2p/base/faketransportcontroller.h
index 153aa56790a9e443dacda6a317e93c5a62b9bc92..5d0ceb434d8ce3b5f254409ef71be23d2d11ad04 100644
--- a/webrtc/p2p/base/faketransportcontroller.h
+++ b/webrtc/p2p/base/faketransportcontroller.h
@@ -69,6 +69,7 @@ class FakeTransportChannel : public TransportChannelImpl,
// If async, will send packets by "Post"-ing to message queue instead of
// synchronously "Send"-ing.
void SetAsync(bool async) { async_ = async; }
+ void SetAsyncDelay(int delay_ms) { async_delay_ms_ = delay_ms; }
TransportChannelState GetState() const override {
if (connection_count_ == 0) {
@@ -200,7 +201,12 @@ class FakeTransportChannel : public TransportChannelImpl,
PacketMessageData* packet = new PacketMessageData(data, len);
if (async_) {
- rtc::Thread::Current()->Post(RTC_FROM_HERE, this, 0, packet);
+ if (async_delay_ms_) {
+ rtc::Thread::Current()->PostDelayed(RTC_FROM_HERE, async_delay_ms_,
+ this, 0, packet);
+ } else {
+ rtc::Thread::Current()->Post(RTC_FROM_HERE, this, 0, packet);
+ }
} else {
rtc::Thread::Current()->Send(RTC_FROM_HERE, this, 0, packet);
}
@@ -311,6 +317,7 @@ class FakeTransportChannel : public TransportChannelImpl,
FakeTransportChannel* dest_ = nullptr;
State state_ = STATE_INIT;
bool async_ = false;
+ int async_delay_ms_ = 0;
Candidates remote_candidates_;
rtc::scoped_refptr<rtc::RTCCertificate> local_cert_;
rtc::FakeSSLCertificate* remote_cert_ = nullptr;
@@ -354,6 +361,7 @@ class FakeTransport : public Transport {
// If async, will send packets by "Post"-ing to message queue instead of
// synchronously "Send"-ing.
void SetAsync(bool async) { async_ = async; }
+ void SetAsyncDelay(int delay_ms) { async_delay_ms_ = delay_ms; }
// If |asymmetric| is true, only set the destination for this transport, and
// not |dest|.
@@ -415,6 +423,7 @@ class FakeTransport : public Transport {
FakeTransportChannel* channel = new FakeTransportChannel(name(), component);
channel->set_ssl_max_protocol_version(ssl_max_version_);
channel->SetAsync(async_);
+ channel->SetAsyncDelay(async_delay_ms_);
SetChannelDestination(component, channel, false);
channels_[component] = channel;
return channel;
@@ -451,6 +460,7 @@ class FakeTransport : public Transport {
ChannelMap channels_;
FakeTransport* dest_ = nullptr;
bool async_ = false;
+ int async_delay_ms_ = 0;
rtc::scoped_refptr<rtc::RTCCertificate> certificate_;
rtc::SSLProtocolVersion ssl_max_version_ = rtc::SSL_PROTOCOL_DTLS_12;
};
« no previous file with comments | « webrtc/p2p/base/dtlstransportchannel_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698