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