Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Side by Side Diff: webrtc/logging/rtc_event_log/rtc_event_log.cc

Issue 2786363002: Revert of Loosening the coupling between WebRTC and //third_party/protobuf (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/logging/BUILD.gn ('k') | webrtc/logging/rtc_event_log/rtc_event_log_helper_thread.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
11 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" 11 #include "webrtc/logging/rtc_event_log/rtc_event_log.h"
12 12
13 #include <limits> 13 #include <limits>
14 #include <vector> 14 #include <vector>
15 15
16 #include "webrtc/base/checks.h" 16 #include "webrtc/base/checks.h"
17 #include "webrtc/base/constructormagic.h" 17 #include "webrtc/base/constructormagic.h"
18 #include "webrtc/base/event.h" 18 #include "webrtc/base/event.h"
19 #include "webrtc/base/protobuf_utils.h"
20 #include "webrtc/base/swap_queue.h" 19 #include "webrtc/base/swap_queue.h"
21 #include "webrtc/base/thread_checker.h" 20 #include "webrtc/base/thread_checker.h"
22 #include "webrtc/base/timeutils.h" 21 #include "webrtc/base/timeutils.h"
23 #include "webrtc/call/call.h" 22 #include "webrtc/call/call.h"
24 #include "webrtc/logging/rtc_event_log/rtc_event_log_helper_thread.h" 23 #include "webrtc/logging/rtc_event_log/rtc_event_log_helper_thread.h"
25 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" 24 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
26 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" 25 #include "webrtc/modules/rtp_rtcp/source/byte_io.h"
27 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/app.h" 26 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/app.h"
28 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/bye.h" 27 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/bye.h"
29 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/common_header.h" 28 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/common_header.h"
30 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/extended_jitter_report.h" 29 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/extended_jitter_report.h"
31 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/extended_reports.h" 30 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/extended_reports.h"
32 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/receiver_report.h" 31 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/receiver_report.h"
33 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/psfb.h" 32 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/psfb.h"
34 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/rtpfb.h" 33 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/rtpfb.h"
35 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sdes.h" 34 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sdes.h"
36 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sender_report.h" 35 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sender_report.h"
37 #include "webrtc/system_wrappers/include/file_wrapper.h" 36 #include "webrtc/system_wrappers/include/file_wrapper.h"
38 #include "webrtc/system_wrappers/include/logging.h" 37 #include "webrtc/system_wrappers/include/logging.h"
39 38
40 #ifdef ENABLE_RTC_EVENT_LOG 39 #ifdef ENABLE_RTC_EVENT_LOG
41 // *.pb.h files are generated at build-time by the protobuf compiler. 40 // Files generated at build-time by the protobuf compiler.
42 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD 41 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD
43 #include "external/webrtc/webrtc/logging/rtc_event_log/rtc_event_log.pb.h" 42 #include "external/webrtc/webrtc/logging/rtc_event_log/rtc_event_log.pb.h"
44 #else 43 #else
45 #include "webrtc/logging/rtc_event_log/rtc_event_log.pb.h" 44 #include "webrtc/logging/rtc_event_log/rtc_event_log.pb.h"
46 #endif 45 #endif
47 #endif 46 #endif
48 47
49 namespace webrtc { 48 namespace webrtc {
50 49
51 #ifdef ENABLE_RTC_EVENT_LOG 50 #ifdef ENABLE_RTC_EVENT_LOG
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 } 576 }
578 577
579 bool RtcEventLog::ParseRtcEventLog(const std::string& file_name, 578 bool RtcEventLog::ParseRtcEventLog(const std::string& file_name,
580 rtclog::EventStream* result) { 579 rtclog::EventStream* result) {
581 char tmp_buffer[1024]; 580 char tmp_buffer[1024];
582 int bytes_read = 0; 581 int bytes_read = 0;
583 std::unique_ptr<FileWrapper> dump_file(FileWrapper::Create()); 582 std::unique_ptr<FileWrapper> dump_file(FileWrapper::Create());
584 if (!dump_file->OpenFile(file_name.c_str(), true)) { 583 if (!dump_file->OpenFile(file_name.c_str(), true)) {
585 return false; 584 return false;
586 } 585 }
587 ProtoString dump_buffer; 586 std::string dump_buffer;
588 while ((bytes_read = dump_file->Read(tmp_buffer, sizeof(tmp_buffer))) > 0) { 587 while ((bytes_read = dump_file->Read(tmp_buffer, sizeof(tmp_buffer))) > 0) {
589 dump_buffer.append(tmp_buffer, bytes_read); 588 dump_buffer.append(tmp_buffer, bytes_read);
590 } 589 }
591 dump_file->CloseFile(); 590 dump_file->CloseFile();
592 return result->ParseFromString(dump_buffer); 591 return result->ParseFromString(dump_buffer);
593 } 592 }
594 593
595 #endif // ENABLE_RTC_EVENT_LOG 594 #endif // ENABLE_RTC_EVENT_LOG
596 595
597 bool RtcEventLogNullImpl::StartLogging(rtc::PlatformFile platform_file, 596 bool RtcEventLogNullImpl::StartLogging(rtc::PlatformFile platform_file,
(...skipping 12 matching lines...) Expand all
610 #else 609 #else
611 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); 610 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl());
612 #endif // ENABLE_RTC_EVENT_LOG 611 #endif // ENABLE_RTC_EVENT_LOG
613 } 612 }
614 613
615 std::unique_ptr<RtcEventLog> RtcEventLog::CreateNull() { 614 std::unique_ptr<RtcEventLog> RtcEventLog::CreateNull() {
616 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); 615 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl());
617 } 616 }
618 617
619 } // namespace webrtc 618 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/logging/BUILD.gn ('k') | webrtc/logging/rtc_event_log/rtc_event_log_helper_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698