Replace proxy ScopedEvent with TRACE_EVENT
TRACE_EVENT is already scoped! #rtc_fixit Tested: Compiled the patch in Chromium and confirmed the Proxy events are still present. I can send the resulting trace to reviewers if desired. Bug: webrtc:15867 Change-Id: I5717a85c0ee25e8e20123afa08064c9b6666ba96 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/342920 Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> Commit-Queue: Evan Shrubsole <eshr@google.com> Cr-Commit-Position: refs/heads/main@{#41916}
This commit is contained in:
parent
ab9395924c
commit
a06e7eeec0
@ -38,12 +38,9 @@ group("pc") {
|
||||
deps = [ ":rtc_pc" ]
|
||||
}
|
||||
|
||||
rtc_library("proxy") {
|
||||
rtc_source_set("proxy") {
|
||||
visibility = [ ":*" ]
|
||||
sources = [
|
||||
"proxy.cc",
|
||||
"proxy.h",
|
||||
]
|
||||
sources = [ "proxy.h" ]
|
||||
deps = [
|
||||
"../api:scoped_refptr",
|
||||
"../api/task_queue",
|
||||
|
||||
25
pc/proxy.cc
25
pc/proxy.cc
@ -1,25 +0,0 @@
|
||||
/*
|
||||
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "pc/proxy.h"
|
||||
|
||||
#include "rtc_base/trace_event.h"
|
||||
|
||||
namespace webrtc {
|
||||
namespace proxy_internal {
|
||||
ScopedTrace::ScopedTrace(const char* class_and_method_name)
|
||||
: class_and_method_name_(class_and_method_name) {
|
||||
TRACE_EVENT_BEGIN0("webrtc", class_and_method_name_);
|
||||
}
|
||||
ScopedTrace::~ScopedTrace() {
|
||||
TRACE_EVENT_END0("webrtc", class_and_method_name_);
|
||||
}
|
||||
} // namespace proxy_internal
|
||||
} // namespace webrtc
|
||||
15
pc/proxy.h
15
pc/proxy.h
@ -70,24 +70,13 @@
|
||||
#include "rtc_base/string_utils.h"
|
||||
#include "rtc_base/system/rtc_export.h"
|
||||
#include "rtc_base/thread.h"
|
||||
#include "rtc_base/trace_event.h"
|
||||
|
||||
#if !defined(RTC_DISABLE_PROXY_TRACE_EVENTS) && !defined(WEBRTC_CHROMIUM_BUILD)
|
||||
#define RTC_DISABLE_PROXY_TRACE_EVENTS
|
||||
#endif
|
||||
|
||||
namespace webrtc {
|
||||
namespace proxy_internal {
|
||||
|
||||
// Class for tracing the lifetime of MethodCall::Marshal.
|
||||
class ScopedTrace {
|
||||
public:
|
||||
explicit ScopedTrace(const char* class_and_method_name);
|
||||
~ScopedTrace();
|
||||
|
||||
private:
|
||||
[[maybe_unused]] const char* const class_and_method_name_;
|
||||
};
|
||||
} // namespace proxy_internal
|
||||
|
||||
template <typename R>
|
||||
class ReturnType {
|
||||
@ -334,7 +323,7 @@ class ConstMethodCall {
|
||||
rtc::MakeCompileTimeString(proxy_name_) \
|
||||
.Concat(rtc::MakeCompileTimeString("::")) \
|
||||
.Concat(rtc::MakeCompileTimeString(#method)); \
|
||||
proxy_internal::ScopedTrace scoped_trace(class_and_method_name.string)
|
||||
TRACE_EVENT0("webrtc", class_and_method_name.string)
|
||||
|
||||
#endif // if defined(RTC_DISABLE_PROXY_TRACE_EVENTS)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user