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

Unified Diff: chrome/browser/profiles/profile_impl.cc

Issue 937713003: Add several new TRACE call and UMA metrics for GetProfile() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typo Created 5 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
Index: chrome/browser/profiles/profile_impl.cc
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index 4fcb7e476868d7a0b1bcfdf970ca424aa082f8fc..0144d4f025f72fea60cc7220d3aca56fc3c244b8 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -15,6 +15,7 @@
#include "base/files/file_util.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
+#include "base/metrics/histogram_macros.h"
#include "base/path_service.h"
#include "base/prefs/json_pref_store.h"
#include "base/prefs/scoped_user_pref_update.h"
@@ -266,10 +267,10 @@ PrefStore* CreateExtensionPrefStore(Profile* profile,
Profile* Profile::CreateProfile(const base::FilePath& path,
Delegate* delegate,
CreateMode create_mode) {
- TRACE_EVENT_BEGIN1("browser",
- "Profile::CreateProfile",
- "profile_path",
- path.value().c_str());
+ TRACE_EVENT1("browser,startup",
+ "Profile::CreateProfile",
+ "profile_path",
+ path.MaybeAsASCII());
// Get sequenced task runner for making sure that file operations of
// this profile (defined by |path|) are executed in expected order
@@ -282,8 +283,8 @@ Profile* Profile::CreateProfile(const base::FilePath& path,
CreateProfileDirectory(sequenced_task_runner.get(), path);
} else if (create_mode == CREATE_MODE_SYNCHRONOUS) {
if (!base::PathExists(path)) {
- // TODO(tc): http://b/1094718 Bad things happen if we can't write to the
- // profile directory. We should eventually be able to run in this
+ // TODO(): http://crbug/160553 - Bad things happen if we can't write to
Alexei Svitkine (slow) 2015/02/18 21:48:03 TODO()'s should always have a name. I suggest putt
rkaplow 2015/02/19 00:18:57 putting rogerta because I'm a bad person.
+ // the profile directory. We should eventually be able to run in this
// situation.
if (!base::CreateDirectory(path))
return NULL;
@@ -411,7 +412,7 @@ ProfileImpl::ProfileImpl(
start_time_(Time::Now()),
delegate_(delegate),
predictor_(NULL) {
- TRACE_EVENT0("browser", "ProfileImpl::ctor")
+ TRACE_EVENT0("browser,startup", "ProfileImpl::ctor")
DCHECK(!path.empty()) << "Using an empty path will attempt to write " <<
"profile files to the root directory!";
@@ -666,12 +667,6 @@ void ProfileImpl::DoFinalInit() {
// as a URLDataSource early.
RegisterDomDistillerViewerSource(this);
- // Creation has been finished.
- TRACE_EVENT_END1("browser",
- "Profile::CreateProfile",
- "profile_path",
- path_.value().c_str());
-
#if defined(OS_CHROMEOS)
if (chromeos::UserSessionManager::GetInstance()
->RestartToApplyPerSessionFlagsIfNeed(this, true)) {
@@ -848,7 +843,8 @@ ExtensionSpecialStoragePolicy*
}
void ProfileImpl::OnPrefsLoaded(bool success) {
- TRACE_EVENT0("browser", "ProfileImpl::OnPrefsLoaded")
+ TRACE_EVENT0("browser", "ProfileImpl::OnPrefsLoaded");
+ SCOPED_UMA_HISTOGRAM_TIMER("Profile.OnPrefsLoadedTime");
if (!success) {
if (delegate_)
delegate_->OnProfileCreated(this, false, false);

Powered by Google App Engine
This is Rietveld 408576698