Chromium Code Reviews| Index: webrtc/call/rtc_event_log_helper_thread.cc |
| diff --git a/webrtc/call/rtc_event_log_helper_thread.cc b/webrtc/call/rtc_event_log_helper_thread.cc |
| index a9aa85144f03da4b825308f618f50e6d0d08e612..502391c64543e50ffe02840142ffaf92606b7cf2 100644 |
| --- a/webrtc/call/rtc_event_log_helper_thread.cc |
| +++ b/webrtc/call/rtc_event_log_helper_thread.cc |
| @@ -143,7 +143,13 @@ void RtcEventLogHelperThread::StartLogFile() { |
| } |
| // Write to file. |
| - file_->Write(output_string_.data(), output_string_.size()); |
| + bool success = file_->Write(output_string_.data(), output_string_.size()); |
| + if (!success) { |
| + LOG(LS_WARNING) << "FileWrapper failed to write WebRtcEventLog file."; |
|
pbos-webrtc
2016/05/23 11:59:11
LS_ERROR
|
| + // The current FileWrapper implementation closes the file on error. |
| + RTC_DCHECK(!file_->Open()); |
| + return; |
| + } |
| written_bytes_ += output_string_.size(); |
| // Free the allocated memory since we probably won't need this amount of |
| @@ -181,12 +187,14 @@ void RtcEventLogHelperThread::LogToFile() { |
| } |
| // Write string to file. |
| - file_->Write(output_string_.data(), output_string_.size()); |
| - written_bytes_ += output_string_.size(); |
| - |
| - if (!file_->Open()) { |
| - LOG(LS_WARNING) << "WebRTC event log file closed by FileWrapper."; |
| + bool success = file_->Write(output_string_.data(), output_string_.size()); |
|
pbos-webrtc
2016/05/23 11:59:11
remove temporary bool
|
| + if (!success) { |
| + LOG(LS_WARNING) << "FileWrapper failed to write WebRtcEventLog file."; |
|
pbos-webrtc
2016/05/23 11:59:11
LS_ERROR
|
| + // The current FileWrapper implementation closes the file on error. |
| + RTC_DCHECK(!file_->Open()); |
| + return; |
| } |
| + written_bytes_ += output_string_.size(); |
| // We want to stop logging if we have reached the file size limit. We also |
| // want to stop logging if the remaining events are more recent than the |
| @@ -210,7 +218,12 @@ void RtcEventLogHelperThread::StopLogFile() { |
| if (written_bytes_ + static_cast<int64_t>(output_string_.size()) <= |
| max_size_bytes_) { |
| - file_->Write(output_string_.data(), output_string_.size()); |
| + bool success = file_->Write(output_string_.data(), output_string_.size()); |
|
pbos-webrtc
2016/05/23 11:59:11
remove bool here and everywhere it's not used afte
|
| + if (!success) { |
| + LOG(LS_WARNING) << "FileWrapper failed to write WebRtcEventLog file."; |
|
pbos-webrtc
2016/05/23 11:59:11
LS_ERROR
|
| + // The current FileWrapper implementation closes the file on error. |
| + RTC_DCHECK(!file_->Open()); |
| + } |
| written_bytes_ += output_string_.size(); |
| } |