Chromium Code Reviews| Index: chrome/browser/profiles/profile_impl.cc |
| diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc |
| index a3bcd2e1527a70942a00605cf7cfd6a5af998c0f..10db09ae55f922199a0516ba7668e3a770f0672d 100644 |
| --- a/chrome/browser/profiles/profile_impl.cc |
| +++ b/chrome/browser/profiles/profile_impl.cc |
| @@ -17,6 +17,7 @@ |
| #include "base/environment.h" |
| #include "base/files/file_path.h" |
| #include "base/files/file_util.h" |
| +#include "base/logging.h" |
| #include "base/memory/ptr_util.h" |
| #include "base/memory/weak_ptr.h" |
| #include "base/metrics/histogram_macros.h" |
| @@ -131,9 +132,14 @@ |
| #if defined(OS_CHROMEOS) |
| #include "chrome/browser/chromeos/locale_change_guard.h" |
| +#include "chrome/browser/chromeos/login/session/user_session_manager.h" |
| +#include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" |
| +#include "chrome/browser/chromeos/policy/user_policy_manager_factory_chromeos.h" |
| #include "chrome/browser/chromeos/preferences.h" |
| #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| #include "chrome/browser/chromeos/settings/device_settings_service.h" |
| +#include "components/session_manager/core/session_manager.h" |
| +#include "components/user_manager/user.h" |
| #include "components/user_manager/user_manager.h" |
| #endif |
| @@ -141,11 +147,7 @@ |
| #include "chrome/browser/background/background_mode_manager.h" |
| #endif |
| -#if defined(OS_CHROMEOS) |
| -#include "chrome/browser/chromeos/login/session/user_session_manager.h" |
| -#include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" |
| -#include "chrome/browser/chromeos/policy/user_policy_manager_factory_chromeos.h" |
| -#else |
| +#if !defined(OS_CHROMEOS) |
| #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" |
| #include "components/policy/core/common/cloud/user_cloud_policy_manager.h" |
| #endif |
| @@ -424,6 +426,20 @@ ProfileImpl::ProfileImpl( |
| DCHECK(!path.empty()) << "Using an empty path will attempt to write " << |
| "profile files to the root directory!"; |
| +#if defined(OS_CHROMEOS) |
| + if (!chromeos::ProfileHelper::IsSigninProfile(this)) { |
| + const user_manager::User* user = |
| + chromeos::ProfileHelper::Get()->GetUserByProfile(this); |
| + // A |User| instance should always exist for a profile which is not the |
| + // initial or the sign-in profile. |
| + CHECK(user); |
| + CHECK(session_manager::SessionManager::Get()->HasSessionForAccountId( |
|
xiyuan
2017/05/09 16:30:52
nit: CHECK -> LOG_IF(FATAL, ...)
CHECK crashes wi
emaxx
2017/05/09 17:11:46
Done.
|
| + user->GetAccountId())) |
| + << "Attempting to construct the profile before starting the user " |
| + "session"; |
| + } |
| +#endif |
| + |
| #if BUILDFLAG(ENABLE_SESSION_SERVICE) |
| create_session_service_timer_.Start(FROM_HERE, |
| TimeDelta::FromMilliseconds(kCreateSessionServiceDelayMS), this, |