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

Side by Side Diff: components/signin/core/browser/account_reconcilor.h

Issue 309843002: Improve UMA tests; improve no-op reconcilor; new reconcilor test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments, consts and other nits 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_RECONCILOR_H_ 4 #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_RECONCILOR_H_
5 #define COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_RECONCILOR_H_ 5 #define COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_RECONCILOR_H_
6 6
7 #include <deque> 7 #include <deque>
8 #include <functional> 8 #include <functional>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 FRIEND_TEST_ALL_PREFIXES(AccountReconcilorTest, GetAccountsFromCookieFailure); 109 FRIEND_TEST_ALL_PREFIXES(AccountReconcilorTest, GetAccountsFromCookieFailure);
110 FRIEND_TEST_ALL_PREFIXES(AccountReconcilorTest, ValidateAccountsFromTokens); 110 FRIEND_TEST_ALL_PREFIXES(AccountReconcilorTest, ValidateAccountsFromTokens);
111 FRIEND_TEST_ALL_PREFIXES(AccountReconcilorTest, 111 FRIEND_TEST_ALL_PREFIXES(AccountReconcilorTest,
112 ValidateAccountsFromTokensFailedUserInfo); 112 ValidateAccountsFromTokensFailedUserInfo);
113 FRIEND_TEST_ALL_PREFIXES(AccountReconcilorTest, 113 FRIEND_TEST_ALL_PREFIXES(AccountReconcilorTest,
114 ValidateAccountsFromTokensFailedTokenRequest); 114 ValidateAccountsFromTokensFailedTokenRequest);
115 FRIEND_TEST_ALL_PREFIXES(AccountReconcilorTest, StartReconcileNoop); 115 FRIEND_TEST_ALL_PREFIXES(AccountReconcilorTest, StartReconcileNoop);
116 FRIEND_TEST_ALL_PREFIXES(AccountReconcilorTest, StartReconcileNoopWithDots); 116 FRIEND_TEST_ALL_PREFIXES(AccountReconcilorTest, StartReconcileNoopWithDots);
117 FRIEND_TEST_ALL_PREFIXES(AccountReconcilorTest, StartReconcileNoopMultiple); 117 FRIEND_TEST_ALL_PREFIXES(AccountReconcilorTest, StartReconcileNoopMultiple);
118 FRIEND_TEST_ALL_PREFIXES(AccountReconcilorTest, StartReconcileAddToCookie); 118 FRIEND_TEST_ALL_PREFIXES(AccountReconcilorTest, StartReconcileAddToCookie);
119 FRIEND_TEST_ALL_PREFIXES(AccountReconcilorTest,
120 StartReconcileAddToCookieTwice);
119 FRIEND_TEST_ALL_PREFIXES(AccountReconcilorTest, StartReconcileAddToChrome); 121 FRIEND_TEST_ALL_PREFIXES(AccountReconcilorTest, StartReconcileAddToChrome);
120 FRIEND_TEST_ALL_PREFIXES(AccountReconcilorTest, StartReconcileBadPrimary); 122 FRIEND_TEST_ALL_PREFIXES(AccountReconcilorTest, StartReconcileBadPrimary);
121 FRIEND_TEST_ALL_PREFIXES(AccountReconcilorTest, StartReconcileOnlyOnce); 123 FRIEND_TEST_ALL_PREFIXES(AccountReconcilorTest, StartReconcileOnlyOnce);
122 FRIEND_TEST_ALL_PREFIXES(AccountReconcilorTest, 124 FRIEND_TEST_ALL_PREFIXES(AccountReconcilorTest,
123 StartReconcileWithSessionInfoExpiredDefault); 125 StartReconcileWithSessionInfoExpiredDefault);
124 126
125 // Register and unregister with dependent services. 127 // Register and unregister with dependent services.
126 void RegisterForCookieChanges(); 128 void RegisterForCookieChanges();
127 void UnregisterForCookieChanges(); 129 void UnregisterForCookieChanges();
128 void RegisterWithSigninManager(); 130 void RegisterWithSigninManager();
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 void HandleSuccessfulAccountIdCheck(const std::string& account_id); 162 void HandleSuccessfulAccountIdCheck(const std::string& account_id);
161 void HandleFailedAccountIdCheck(const std::string& account_id); 163 void HandleFailedAccountIdCheck(const std::string& account_id);
162 void HandleRefreshTokenFetched(const std::string& account_id, 164 void HandleRefreshTokenFetched(const std::string& account_id,
163 const std::string& refresh_token); 165 const std::string& refresh_token);
164 166
165 void GetAccountsFromCookie(GetAccountsFromCookieCallback callback); 167 void GetAccountsFromCookie(GetAccountsFromCookieCallback callback);
166 void ContinueReconcileActionAfterGetGaiaAccounts( 168 void ContinueReconcileActionAfterGetGaiaAccounts(
167 const GoogleServiceAuthError& error, 169 const GoogleServiceAuthError& error,
168 const std::vector<std::pair<std::string, bool> >& accounts); 170 const std::vector<std::pair<std::string, bool> >& accounts);
169 void ValidateAccountsFromTokenService(); 171 void ValidateAccountsFromTokenService();
172 // Note internally that this |account_id| is added to the cookie jar.
173 void MarkAccountAsAddedToCookie(const std::string& account_id);
174 // Note internally that this |account_id| is added to the token service.
175 void MarkAccountAsAddedToChrome(const std::string& account_id);
170 176
171 void OnCookieChanged(const net::CanonicalCookie* cookie); 177 void OnCookieChanged(const net::CanonicalCookie* cookie);
172 178
173 // Overriden from GaiaAuthConsumer. 179 // Overriden from GaiaAuthConsumer.
174 virtual void OnListAccountsSuccess(const std::string& data) OVERRIDE; 180 virtual void OnListAccountsSuccess(const std::string& data) OVERRIDE;
175 virtual void OnListAccountsFailure(const GoogleServiceAuthError& error) 181 virtual void OnListAccountsFailure(const GoogleServiceAuthError& error)
176 OVERRIDE; 182 OVERRIDE;
177 183
178 // Overriden from MergeSessionHelper::Observer. 184 // Overriden from MergeSessionHelper::Observer.
179 virtual void MergeSessionCompleted(const std::string& account_id, 185 virtual void MergeSessionCompleted(const std::string& account_id,
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 EmailSet invalid_chrome_accounts_; 245 EmailSet invalid_chrome_accounts_;
240 std::vector<std::string> add_to_cookie_; 246 std::vector<std::string> add_to_cookie_;
241 std::vector<std::pair<std::string, int> > add_to_chrome_; 247 std::vector<std::pair<std::string, int> > add_to_chrome_;
242 248
243 std::deque<GetAccountsFromCookieCallback> get_gaia_accounts_callbacks_; 249 std::deque<GetAccountsFromCookieCallback> get_gaia_accounts_callbacks_;
244 250
245 DISALLOW_COPY_AND_ASSIGN(AccountReconcilor); 251 DISALLOW_COPY_AND_ASSIGN(AccountReconcilor);
246 }; 252 };
247 253
248 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_RECONCILOR_H_ 254 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_RECONCILOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698