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

Unified Diff: webrtc/call/rtc_event_log.cc

Issue 1974453002: Add a parameter to set a maximum filesize when starting an RTC event log on the PeerConnectionFacto… (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Initial version Created 4 years, 7 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
Index: webrtc/call/rtc_event_log.cc
diff --git a/webrtc/call/rtc_event_log.cc b/webrtc/call/rtc_event_log.cc
index c929bc7e572f0335395e85a1c34b69875f63fc40..6dd02c808ebb5421405c1512c45c4db96f49502d 100644
--- a/webrtc/call/rtc_event_log.cc
+++ b/webrtc/call/rtc_event_log.cc
@@ -183,7 +183,9 @@ bool RtcEventLogImpl::StartLogging(const std::string& file_name,
RTC_DCHECK(thread_checker_.CalledOnValidThread());
RtcEventLogHelperThread::ControlMessage message;
message.message_type = RtcEventLogHelperThread::ControlMessage::START_FILE;
- message.max_size_bytes = max_size_bytes;
+ message.max_size_bytes = max_size_bytes <= 0
+ ? std::numeric_limits<int64_t>::max()
+ : max_size_bytes;
message.start_time = clock_->TimeInMicroseconds();
message.stop_time = std::numeric_limits<int64_t>::max();
message.file.reset(FileWrapper::Create());
@@ -202,7 +204,9 @@ bool RtcEventLogImpl::StartLogging(rtc::PlatformFile platform_file,
RTC_DCHECK(thread_checker_.CalledOnValidThread());
RtcEventLogHelperThread::ControlMessage message;
message.message_type = RtcEventLogHelperThread::ControlMessage::START_FILE;
- message.max_size_bytes = max_size_bytes;
+ message.max_size_bytes = max_size_bytes <= 0
+ ? std::numeric_limits<int64_t>::max()
+ : max_size_bytes;
message.start_time = clock_->TimeInMicroseconds();
message.stop_time = std::numeric_limits<int64_t>::max();
message.file.reset(FileWrapper::Create());

Powered by Google App Engine
This is Rietveld 408576698