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

Side by Side Diff: webrtc/p2p/base/port.cc

Issue 2442813002: Fix more swarming test failures by using fake clock. (Closed)
Patch Set: Advance the clock by 1 second to avoid test failure due to assumptions on non-zero actual time valu… Created 4 years, 1 month 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
« no previous file with comments | « webrtc/p2p/base/p2ptransportchannel_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 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
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after
918 WriteState old_value = write_state_; 918 WriteState old_value = write_state_;
919 write_state_ = value; 919 write_state_ = value;
920 if (value != old_value) { 920 if (value != old_value) {
921 LOG_J(LS_VERBOSE, this) << "set_write_state from: " << old_value << " to " 921 LOG_J(LS_VERBOSE, this) << "set_write_state from: " << old_value << " to "
922 << value; 922 << value;
923 SignalStateChange(this); 923 SignalStateChange(this);
924 } 924 }
925 } 925 }
926 926
927 void Connection::UpdateReceiving(int64_t now) { 927 void Connection::UpdateReceiving(int64_t now) {
928 bool receiving = now <= last_received() + receiving_timeout_; 928 bool receiving =
929 last_received() > 0 && now <= last_received() + receiving_timeout_;
929 if (receiving_ == receiving) { 930 if (receiving_ == receiving) {
930 return; 931 return;
931 } 932 }
932 LOG_J(LS_VERBOSE, this) << "set_receiving to " << receiving; 933 LOG_J(LS_VERBOSE, this) << "set_receiving to " << receiving;
933 receiving_ = receiving; 934 receiving_ = receiving;
934 receiving_unchanged_since_ = now; 935 receiving_unchanged_since_ = now;
935 SignalStateChange(this); 936 SignalStateChange(this);
936 } 937 }
937 938
938 void Connection::set_state(State state) { 939 void Connection::set_state(State state) {
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
1570 ASSERT(sent < 0); 1571 ASSERT(sent < 0);
1571 error_ = port_->GetError(); 1572 error_ = port_->GetError();
1572 stats_.sent_discarded_packets++; 1573 stats_.sent_discarded_packets++;
1573 } else { 1574 } else {
1574 send_rate_tracker_.AddSamples(sent); 1575 send_rate_tracker_.AddSamples(sent);
1575 } 1576 }
1576 return sent; 1577 return sent;
1577 } 1578 }
1578 1579
1579 } // namespace cricket 1580 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/p2p/base/p2ptransportchannel_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698