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

Unified Diff: webrtc/base/event_tracer.cc

Issue 2708723003: Introduce new constructor to PlatformThread. (Closed)
Patch Set: Disable RTC_DCHECK in channel_proxy + add TODO Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/base/platform_thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/event_tracer.cc
diff --git a/webrtc/base/event_tracer.cc b/webrtc/base/event_tracer.cc
index 4393bff2985884a746ad3a330d962294afc6e60f..cb7554a891f6db4dd566c6c3c4f4c92333adf652 100644
--- a/webrtc/base/event_tracer.cc
+++ b/webrtc/base/event_tracer.cc
@@ -80,7 +80,7 @@ namespace rtc {
namespace tracing {
namespace {
-static bool EventTracingThreadFunc(void* params);
+static void EventTracingThreadFunc(void* params);
// Atomic-int fast path for avoiding logging when disabled.
static volatile int g_event_logging_active = 0;
@@ -89,7 +89,10 @@ static volatile int g_event_logging_active = 0;
class EventLogger final {
public:
EventLogger()
- : logging_thread_(EventTracingThreadFunc, this, "EventTracingThread"),
+ : logging_thread_(EventTracingThreadFunc,
+ this,
+ "EventTracingThread",
+ kLowPriority),
shutdown_event_(false, false) {}
~EventLogger() { RTC_DCHECK(thread_checker_.CalledOnValidThread()); }
@@ -210,7 +213,6 @@ class EventLogger final {
// Finally start, everything should be set up now.
logging_thread_.Start();
TRACE_EVENT_INSTANT0("webrtc", "EventLogger::Start");
- logging_thread_.SetPriority(kLowPriority);
}
void Stop() {
@@ -326,11 +328,8 @@ class EventLogger final {
bool output_file_owned_ = false;
};
-static bool EventTracingThreadFunc(void* params) {
+static void EventTracingThreadFunc(void* params) {
static_cast<EventLogger*>(params)->Log();
- // False indicates that the thread function has done its job and doesn't need
- // to be restarted again. Log() runs its own internal loop.
- return false;
}
static EventLogger* volatile g_event_logger = nullptr;
« no previous file with comments | « no previous file | webrtc/base/platform_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698