Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/login/signin/merge_session_throttling_utils.h" | 5 #include "chrome/browser/chromeos/login/signin/merge_session_throttling_utils.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 128 | 128 |
| 129 switch (login_manager->state()) { | 129 switch (login_manager->state()) { |
| 130 case chromeos::OAuth2LoginManager::SESSION_RESTORE_NOT_STARTED: | 130 case chromeos::OAuth2LoginManager::SESSION_RESTORE_NOT_STARTED: |
| 131 // The session restore for this profile hasn't even started yet. Don't | 131 // The session restore for this profile hasn't even started yet. Don't |
| 132 // block for now. | 132 // block for now. |
| 133 // In theory this should not happen since we should | 133 // In theory this should not happen since we should |
| 134 // kick off the session restore process for the newly added profile | 134 // kick off the session restore process for the newly added profile |
| 135 // before we attempt loading any page. | 135 // before we attempt loading any page. |
| 136 if (user_manager::UserManager::Get()->IsLoggedInAsUserWithGaiaAccount() && | 136 if (user_manager::UserManager::Get()->IsLoggedInAsUserWithGaiaAccount() && |
| 137 !user_manager::UserManager::Get()->IsLoggedInAsStub()) { | 137 !user_manager::UserManager::Get()->IsLoggedInAsStub()) { |
| 138 LOG(WARNING) << "Loading content for a profile without " | 138 DVLOG(1) << "Loading content for a profile without " |
|
sky
2016/11/02 03:05:14
Please ping the owner of this if they are ok with
Evan Stade
2016/11/02 12:58:36
+achuith@chromium.org, wdyt? I made this change be
| |
| 139 << "session restore?"; | 139 << "session restore?"; |
| 140 } | 140 } |
| 141 return false; | 141 return false; |
| 142 case chromeos::OAuth2LoginManager::SESSION_RESTORE_PREPARING: | 142 case chromeos::OAuth2LoginManager::SESSION_RESTORE_PREPARING: |
| 143 case chromeos::OAuth2LoginManager::SESSION_RESTORE_IN_PROGRESS: { | 143 case chromeos::OAuth2LoginManager::SESSION_RESTORE_IN_PROGRESS: { |
| 144 // Check if the session restore has been going on for a while already. | 144 // Check if the session restore has been going on for a while already. |
| 145 // If so, don't attempt to block page loading. | 145 // If so, don't attempt to block page loading. |
| 146 if ((base::Time::Now() - login_manager->session_restore_start()) | 146 if ((base::Time::Now() - login_manager->session_restore_start()) |
| 147 .InSeconds() > kMaxSessionRestoreTimeInSec) { | 147 .InSeconds() > kMaxSessionRestoreTimeInSec) { |
| 148 UnblockProfile(profile); | 148 UnblockProfile(profile); |
| 149 return false; | 149 return false; |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 178 bool ShouldDelayUrl(const GURL& url) { | 178 bool ShouldDelayUrl(const GURL& url) { |
| 179 // If we are loading google properties while merge session is in progress, | 179 // If we are loading google properties while merge session is in progress, |
| 180 // we will show delayed loading page instead. | 180 // we will show delayed loading page instead. |
| 181 return !net::NetworkChangeNotifier::IsOffline() && | 181 return !net::NetworkChangeNotifier::IsOffline() && |
| 182 !AreAllSessionMergedAlready() && | 182 !AreAllSessionMergedAlready() && |
| 183 google_util::IsGoogleHostname(url.host_piece(), | 183 google_util::IsGoogleHostname(url.host_piece(), |
| 184 google_util::ALLOW_SUBDOMAIN); | 184 google_util::ALLOW_SUBDOMAIN); |
| 185 } | 185 } |
| 186 | 186 |
| 187 } // namespace merge_session_throttling_utils | 187 } // namespace merge_session_throttling_utils |
| OLD | NEW |