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

Side by Side Diff: chrome/browser/chromeos/login/signin/merge_session_throttling_utils.cc

Issue 2537263002: Prevent the pre-session-restore log spam (Closed)
Patch Set: Nit Created 4 years 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 unified diff | Download patch
OLDNEW
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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 177
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 bool IsSessionRestorePending(Profile* profile) {
188 if (!profile)
189 return false;
Wez 2016/12/08 18:33:26 Is |false| the correct value in this case? What do
190
191 chromeos::OAuth2LoginManager* login_manager =
192 chromeos::OAuth2LoginManagerFactory::GetInstance()->GetForProfile(
193 profile);
194 bool pending_session_restore = false;
195 if (login_manager) {
196 switch (login_manager->state()) {
Wez 2016/12/08 18:33:26 nit: This would be easier to read as an if(), rath
197 case chromeos::OAuth2LoginManager::SESSION_RESTORE_PREPARING:
198 case chromeos::OAuth2LoginManager::SESSION_RESTORE_IN_PROGRESS:
199 pending_session_restore = true;
200 break;
201
202 default:
203 break;
204 }
205 }
206
207 return pending_session_restore;
208 }
209
187 } // namespace merge_session_throttling_utils 210 } // namespace merge_session_throttling_utils
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/signin/merge_session_throttling_utils.h ('k') | chrome/browser/search/search.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698