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

Side by Side Diff: webrtc/base/logging.cc

Issue 1981463002: Change initial DTLS retransmission timer from 1 second to 50ms. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixing typo in comment. Created 4 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 unified diff | Download patch
« no previous file with comments | « webrtc/base/gunit.h ('k') | webrtc/base/opensslstreamadapter.h » ('j') | 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 bool LogMessage::thread_, LogMessage::timestamp_; 117 bool LogMessage::thread_, LogMessage::timestamp_;
118 118
119 LogMessage::LogMessage(const char* file, 119 LogMessage::LogMessage(const char* file,
120 int line, 120 int line,
121 LoggingSeverity sev, 121 LoggingSeverity sev,
122 LogErrorContext err_ctx, 122 LogErrorContext err_ctx,
123 int err, 123 int err,
124 const char* module) 124 const char* module)
125 : severity_(sev), tag_(kLibjingle) { 125 : severity_(sev), tag_(kLibjingle) {
126 if (timestamp_) { 126 if (timestamp_) {
127 int64_t time = TimeSince(LogStartTime()); 127 // Use SystemTimeMillis so that even if tests use fake clocks, the timestamp
128 // in log messages represents the real system time.
129 int64_t time = TimeDiff(SystemTimeMillis(), LogStartTime());
128 // Also ensure WallClockStartTime is initialized, so that it matches 130 // Also ensure WallClockStartTime is initialized, so that it matches
129 // LogStartTime. 131 // LogStartTime.
130 WallClockStartTime(); 132 WallClockStartTime();
131 print_stream_ << "[" << std::setfill('0') << std::setw(3) << (time / 1000) 133 print_stream_ << "[" << std::setfill('0') << std::setw(3) << (time / 1000)
132 << ":" << std::setw(3) << (time % 1000) << std::setfill(' ') 134 << ":" << std::setw(3) << (time % 1000) << std::setfill(' ')
133 << "] "; 135 << "] ";
134 } 136 }
135 137
136 if (thread_) { 138 if (thread_) {
137 PlatformThreadId id = CurrentThreadId(); 139 PlatformThreadId id = CurrentThreadId();
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 205
204 CritScope cs(&g_log_crit); 206 CritScope cs(&g_log_crit);
205 for (auto& kv : streams_) { 207 for (auto& kv : streams_) {
206 if (severity_ >= kv.second) { 208 if (severity_ >= kv.second) {
207 kv.first->OnLogMessage(str); 209 kv.first->OnLogMessage(str);
208 } 210 }
209 } 211 }
210 } 212 }
211 213
212 int64_t LogMessage::LogStartTime() { 214 int64_t LogMessage::LogStartTime() {
213 static const int64_t g_start = TimeMillis(); 215 static const int64_t g_start = SystemTimeMillis();
214 return g_start; 216 return g_start;
215 } 217 }
216 218
217 uint32_t LogMessage::WallClockStartTime() { 219 uint32_t LogMessage::WallClockStartTime() {
218 static const uint32_t g_start_wallclock = time(NULL); 220 static const uint32_t g_start_wallclock = time(NULL);
219 return g_start_wallclock; 221 return g_start_wallclock;
220 } 222 }
221 223
222 void LogMessage::LogThreads(bool on) { 224 void LogMessage::LogThreads(bool on) {
223 thread_ = on; 225 thread_ = on;
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 } 548 }
547 549
548 if (state) { 550 if (state) {
549 state->unprintable_count_[input] = consecutive_unprintable; 551 state->unprintable_count_[input] = consecutive_unprintable;
550 } 552 }
551 } 553 }
552 554
553 ////////////////////////////////////////////////////////////////////// 555 //////////////////////////////////////////////////////////////////////
554 556
555 } // namespace rtc 557 } // namespace rtc
OLDNEW
« no previous file with comments | « webrtc/base/gunit.h ('k') | webrtc/base/opensslstreamadapter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698