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 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 ProtoString dump_buffer; | 573 ProtoString dump_buffer; |
574 while ((bytes_read = dump_file->Read(tmp_buffer, sizeof(tmp_buffer))) > 0) { | 574 while ((bytes_read = dump_file->Read(tmp_buffer, sizeof(tmp_buffer))) > 0) { |
575 dump_buffer.append(tmp_buffer, bytes_read); | 575 dump_buffer.append(tmp_buffer, bytes_read); |
576 } | 576 } |
577 dump_file->CloseFile(); | 577 dump_file->CloseFile(); |
578 return result->ParseFromString(dump_buffer); | 578 return result->ParseFromString(dump_buffer); |
579 } | 579 } |
580 | 580 |
581 #endif // ENABLE_RTC_EVENT_LOG | 581 #endif // ENABLE_RTC_EVENT_LOG |
582 | 582 |
583 bool RtcEventLogNullImpl::StartLogging(rtc::PlatformFile platform_file, | |
584 int64_t max_size_bytes) { | |
585 // The platform_file is open and needs to be closed. | |
586 if (!rtc::ClosePlatformFile(platform_file)) { | |
587 LOG(LS_ERROR) << "Can't close file."; | |
588 } | |
589 return false; | |
590 } | |
591 | |
592 // RtcEventLog member functions. | 583 // RtcEventLog member functions. |
593 std::unique_ptr<RtcEventLog> RtcEventLog::Create() { | 584 std::unique_ptr<RtcEventLog> RtcEventLog::Create() { |
594 #ifdef ENABLE_RTC_EVENT_LOG | 585 #ifdef ENABLE_RTC_EVENT_LOG |
595 return std::unique_ptr<RtcEventLog>(new RtcEventLogImpl()); | 586 return std::unique_ptr<RtcEventLog>(new RtcEventLogImpl()); |
596 #else | 587 #else |
597 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); | 588 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); |
598 #endif // ENABLE_RTC_EVENT_LOG | 589 #endif // ENABLE_RTC_EVENT_LOG |
599 } | 590 } |
600 | 591 |
601 std::unique_ptr<RtcEventLog> RtcEventLog::CreateNull() { | 592 std::unique_ptr<RtcEventLog> RtcEventLog::CreateNull() { |
602 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); | 593 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); |
603 } | 594 } |
604 | 595 |
605 } // namespace webrtc | 596 } // namespace webrtc |
OLD | NEW |