Index: chrome/browser/profiles/profile_impl.cc |
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc |
index ed645b7e33d2f630a43fce3490ba5c6d0ce81cfc..803d2be5714d35baa1bee71f0fb0461c5c504398 100644 |
--- a/chrome/browser/profiles/profile_impl.cc |
+++ b/chrome/browser/profiles/profile_impl.cc |
@@ -124,6 +124,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 |
@@ -283,7 +284,9 @@ 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()); |
+ |
// 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). |
@@ -644,6 +647,16 @@ void ProfileImpl::DoFinalInit() { |
RegisterDomDistillerViewerSource(this); |
// Creation has been finished. |
+ TRACE_EVENT_END1( |
+ "browser", "Profile::CreateProfile", "profile_path", path_.value()); |
+ |
+#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()); |