| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 ProtoString dump_buffer; | 591 ProtoString dump_buffer; |
| 592 while ((bytes_read = dump_file->Read(tmp_buffer, sizeof(tmp_buffer))) > 0) { | 592 while ((bytes_read = dump_file->Read(tmp_buffer, sizeof(tmp_buffer))) > 0) { |
| 593 dump_buffer.append(tmp_buffer, bytes_read); | 593 dump_buffer.append(tmp_buffer, bytes_read); |
| 594 } | 594 } |
| 595 dump_file->CloseFile(); | 595 dump_file->CloseFile(); |
| 596 return result->ParseFromString(dump_buffer); | 596 return result->ParseFromString(dump_buffer); |
| 597 } | 597 } |
| 598 | 598 |
| 599 #endif // ENABLE_RTC_EVENT_LOG | 599 #endif // ENABLE_RTC_EVENT_LOG |
| 600 | 600 |
| 601 bool RtcEventLogNullImpl::StartLogging(rtc::PlatformFile platform_file, | |
| 602 int64_t max_size_bytes) { | |
| 603 // The platform_file is open and needs to be closed. | |
| 604 if (!rtc::ClosePlatformFile(platform_file)) { | |
| 605 LOG(LS_ERROR) << "Can't close file."; | |
| 606 } | |
| 607 return false; | |
| 608 } | |
| 609 | |
| 610 // RtcEventLog member functions. | 601 // RtcEventLog member functions. |
| 611 std::unique_ptr<RtcEventLog> RtcEventLog::Create() { | 602 std::unique_ptr<RtcEventLog> RtcEventLog::Create() { |
| 612 #ifdef ENABLE_RTC_EVENT_LOG | 603 #ifdef ENABLE_RTC_EVENT_LOG |
| 613 return std::unique_ptr<RtcEventLog>(new RtcEventLogImpl()); | 604 return std::unique_ptr<RtcEventLog>(new RtcEventLogImpl()); |
| 614 #else | 605 #else |
| 615 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); | 606 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); |
| 616 #endif // ENABLE_RTC_EVENT_LOG | 607 #endif // ENABLE_RTC_EVENT_LOG |
| 617 } | 608 } |
| 618 | 609 |
| 619 std::unique_ptr<RtcEventLog> RtcEventLog::CreateNull() { | 610 std::unique_ptr<RtcEventLog> RtcEventLog::CreateNull() { |
| 620 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); | 611 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); |
| 621 } | 612 } |
| 622 | 613 |
| 623 } // namespace webrtc | 614 } // namespace webrtc |
| OLD | NEW |