Chromium Code Reviews| Index: webrtc/call/rtc_event_log.cc |
| diff --git a/webrtc/call/rtc_event_log.cc b/webrtc/call/rtc_event_log.cc |
| index 6dd02c808ebb5421405c1512c45c4db96f49502d..f09acc4a189c79ebf5900fe17c3fd998dedd9076 100644 |
| --- a/webrtc/call/rtc_event_log.cc |
| +++ b/webrtc/call/rtc_event_log.cc |
| @@ -49,6 +49,10 @@ class RtcEventLogNullImpl final : public RtcEventLog { |
| } |
| bool StartLogging(rtc::PlatformFile platform_file, |
| int64_t max_size_bytes) override { |
| + // The platform_file is open and needs to be closed. |
| + if (!rtc::ClosePlatformFile(platform_file)) { |
| + LOG(LS_WARNING) << "Can't close file."; |
| + } |
| return false; |
| } |
| void StopLogging() override {} |
| @@ -190,6 +194,7 @@ bool RtcEventLogImpl::StartLogging(const std::string& file_name, |
| message.stop_time = std::numeric_limits<int64_t>::max(); |
| message.file.reset(FileWrapper::Create()); |
| if (message.file->OpenFile(file_name.c_str(), false) != 0) { |
| + LOG(LS_WARNING) << "Can't open file. Logging not started."; |
|
ivoc
2016/05/26 08:56:58
"Logging" sounds a bit vague to me, how about some
pbos-webrtc
2016/05/26 12:05:18
All of these are errors and should log on LS_ERROR
terelius
2016/05/26 14:54:42
Done.
terelius
2016/05/26 14:54:42
Done.
|
| return false; |
| } |
| if (!message_queue_.Insert(&message)) { |
| @@ -212,9 +217,16 @@ bool RtcEventLogImpl::StartLogging(rtc::PlatformFile platform_file, |
| message.file.reset(FileWrapper::Create()); |
| FILE* file_handle = rtc::FdopenPlatformFileForWriting(platform_file); |
| if (!file_handle) { |
| + LOG(LS_WARNING) << "Can't open file. Logging not started."; |
|
ivoc
2016/05/26 08:56:59
Same here.
terelius
2016/05/26 14:54:42
Done.
|
| + // Even though we failed to open a FILE*, the platform_file is still open |
| + // and needs to be closed. |
| + if (!rtc::ClosePlatformFile(platform_file)) { |
| + LOG(LS_WARNING) << "Can't close file."; |
| + } |
| return false; |
| } |
| if (message.file->OpenFromFileHandle(file_handle, true, false) != 0) { |
| + LOG(LS_WARNING) << "Can't open file. Logging not started."; |
|
ivoc
2016/05/26 08:56:59
Same here.
terelius
2016/05/26 14:54:42
Done.
|
| return false; |
| } |
| if (!message_queue_.Insert(&message)) { |