Commit a549c5a8 authored by Siddhartha S's avatar Siddhartha S Committed by Commit Bot

Add trace event in BrowserPolicyConnector

Helps to measure why BrowserPolicyConnector::IsNonEnterpriseUser()
sometimes takes too long to run on main thread.

BUG=891476

Change-Id: I5dd76dfb22a3334dc1015cf6d6c1f23c7e6f2da0
Reviewed-on: https://chromium-review.googlesource.com/c/1280550Reviewed-by: default avatarMaksim Ivanov <emaxx@chromium.org>
Commit-Queue: Siddhartha S <ssid@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599726}
parent d04ab44a
......@@ -17,6 +17,7 @@
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/trace_event/trace_event.h"
#include "components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h"
#include "components/policy/core/common/cloud/device_management_service.h"
#include "components/policy/core/common/configuration_policy_provider.h"
......@@ -133,6 +134,7 @@ void BrowserPolicyConnector::ScheduleServiceInitialization(
// static
bool BrowserPolicyConnector::IsNonEnterpriseUser(const std::string& username) {
TRACE_EVENT0("browser", "BrowserPolicyConnector::IsNonEnterpriseUser");
if (username.empty() || username.find('@') == std::string::npos) {
// An empty username means incognito user in case of ChromiumOS and
// no logged-in user in case of Chromium (SigninService). Many tests use
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment