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

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

Issue 322533002: Restart Chrome on ChromeOS as early as possible to speed up restart. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix win build. Created 6 years, 6 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 08e532fd9b5373da1aae1a8f12b0f8342c8f2abc..3b9bfe0c224e9487507107f10723c99f395d23a9 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -128,6 +128,7 @@
#include "chrome/browser/policy/schema_registry_service_factory.h"
#include "components/policy/core/browser/browser_policy_connector.h"
#if defined(OS_CHROMEOS)
+#include "chrome/browser/chromeos/login/login_utils.h"
#include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h"
#include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.h"
#else
@@ -270,7 +271,11 @@ void RegisterDomDistillerViewerSource(Profile* profile) {
Profile* Profile::CreateProfile(const base::FilePath& path,
Delegate* delegate,
CreateMode create_mode) {
- TRACE_EVENT0("browser", "Profile::CreateProfile")
+ TRACE_EVENT_BEGIN1("browser",
+ "Profile::CreateProfile",
+ "profile_path",
+ path.value().c_str());
+
// Get sequenced task runner for making sure that file operations of
// this profile (defined by |path|) are executed in expected order
// (what was previously assured by the FILE thread).
@@ -630,6 +635,18 @@ void ProfileImpl::DoFinalInit() {
RegisterDomDistillerViewerSource(this);
// Creation has been finished.
+ TRACE_EVENT_END1("browser",
+ "Profile::CreateProfile",
+ "profile_path",
+ path_.value().c_str());
+
+#if defined(OS_CHROMEOS)
+ if (chromeos::LoginUtils::Get()->RestartToApplyPerSessionFlagsIfNeed(this,
+ true)) {
+ return;
+ }
+#endif
+
if (delegate_) {
TRACE_EVENT0("browser", "ProfileImpl::DoFileInit:DelegateOnProfileCreated")
delegate_->OnProfileCreated(this, true, IsNewProfile());

Powered by Google App Engine
This is Rietveld 408576698