From 80c829f25382f98e97b30a5803322552f350f983 Mon Sep 17 00:00:00 2001 From: ehmaldonado Date: Tue, 18 Jul 2017 07:35:19 -0700 Subject: [PATCH] Enable tracing on rtcstats_integrationtest.cc BUG=chromium:653087 Review-Url: https://codereview.webrtc.org/2979203002 Cr-Commit-Position: refs/heads/master@{#19076} --- webrtc/pc/rtcstats_integrationtest.cc | 19 +++++++++++++++++++ webrtc/pc/rtcstatscollector.cc | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/webrtc/pc/rtcstats_integrationtest.cc b/webrtc/pc/rtcstats_integrationtest.cc index a385d6c2f9..47fa0e3b0f 100644 --- a/webrtc/pc/rtcstats_integrationtest.cc +++ b/webrtc/pc/rtcstats_integrationtest.cc @@ -20,6 +20,7 @@ #include "webrtc/pc/test/peerconnectiontestwrapper.h" #include "webrtc/pc/test/rtcstatsobtainer.h" #include "webrtc/rtc_base/checks.h" +#include "webrtc/rtc_base/event_tracer.h" #include "webrtc/rtc_base/gunit.h" #include "webrtc/rtc_base/refcountedobject.h" #include "webrtc/rtc_base/scoped_ref_ptr.h" @@ -31,11 +32,29 @@ namespace { const int64_t kGetStatsTimeoutMs = 10000; +const unsigned char* GetCategoryEnabledHandler(const char* name) { + return reinterpret_cast("webrtc_stats"); +} + +void AddTraceEventHandler(char phase, + const unsigned char* category_enabled, + const char* name, + unsigned long long id, + int num_args, + const char** arg_names, + const unsigned char* arg_types, + const unsigned long long* arg_values, + unsigned char flags) { + // Do nothing +} + class RTCStatsIntegrationTest : public testing::Test { public: RTCStatsIntegrationTest() : network_thread_(new rtc::Thread(&virtual_socket_server_)), worker_thread_(rtc::Thread::Create()) { + SetupEventTracer(&GetCategoryEnabledHandler, &AddTraceEventHandler); + RTC_CHECK(network_thread_->Start()); RTC_CHECK(worker_thread_->Start()); diff --git a/webrtc/pc/rtcstatscollector.cc b/webrtc/pc/rtcstatscollector.cc index 281e4f6c9b..4952012648 100644 --- a/webrtc/pc/rtcstatscollector.cc +++ b/webrtc/pc/rtcstatscollector.cc @@ -32,7 +32,7 @@ namespace webrtc { namespace { -const int kStatTypeMemberNameAndIdMaxLen = 512; +const int kStatTypeMemberNameAndIdMaxLen = 1024; std::string GetStatTypeMemberNameAndId(const RTCStats& stats, const RTCStatsMemberInterface* member) {