0

Add trace events to TimeZoneMonitor

Currently, only TimeZoneMonitorWin has trace events to debug
power suspend/resume. This CL is adding trace events to the base class
to make them visible on every platforms.

R=gab@chromium.org, fdoray@chromium.org

Bug: 1074036
Change-Id: I01478cd8036a18dd9edf7755e28fb66358338634
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2583007
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Commit-Queue: Etienne Bergeron <etienneb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#841187}
This commit is contained in:
Etienne Bergeron
2021-01-07 21:14:00 +00:00
committed by Chromium LUCI CQ
parent 889e3e1d7a
commit 774acf699d
2 changed files with 4 additions and 0 deletions
base/trace_event
services/device/time_zone_monitor

@ -63,6 +63,7 @@
X("compositor") \
X("content") \
X("content_capture") \
X("device") \
X("devtools") \
X("devtools.timeline") \
X("devtools.timeline.async") \

@ -7,6 +7,7 @@
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/strings/string_piece.h"
#include "base/trace_event/trace_event.h"
#include "third_party/icu/source/common/unicode/unistr.h"
#include "third_party/icu/source/i18n/unicode/timezone.h"
@ -27,6 +28,7 @@ void TimeZoneMonitor::Bind(
void TimeZoneMonitor::NotifyClients(base::StringPiece zone_id_str) {
DCHECK(thread_checker_.CalledOnValidThread());
TRACE_EVENT0("device", "TimeZoneMonitor::NotifyClients");
VLOG(1) << "timezone reset to " << zone_id_str;
for (auto& client : clients_)
@ -36,6 +38,7 @@ void TimeZoneMonitor::NotifyClients(base::StringPiece zone_id_str) {
void TimeZoneMonitor::UpdateIcuAndNotifyClients(
std::unique_ptr<icu::TimeZone> new_zone) {
DCHECK(thread_checker_.CalledOnValidThread());
TRACE_EVENT0("device", "TimeZoneMonitor::UpdateIcuAndNotifyClients");
// Do not notify clients if the timezone didn't change.
if (*timezone_ == *new_zone) {