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

Side by Side Diff: chrome/browser/chromeos/login/signin/token_handle_util.h

Issue 1128923006: Do not invalidate OAuth token status user when token handle is invalid. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_TOKEN_HANDLE_UTIL_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_TOKEN_HANDLE_UTIL_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_TOKEN_HANDLE_UTIL_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_TOKEN_HANDLE_UTIL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 22 matching lines...) Expand all
33 33
34 enum TokenHandleStatus { VALID, INVALID, UNKNOWN }; 34 enum TokenHandleStatus { VALID, INVALID, UNKNOWN };
35 35
36 typedef base::Callback<void(const user_manager::UserID&, TokenHandleStatus)> 36 typedef base::Callback<void(const user_manager::UserID&, TokenHandleStatus)>
37 TokenValidationCallback; 37 TokenValidationCallback;
38 38
39 // Returns true if UserManager has token handle associated with |user_id|. 39 // Returns true if UserManager has token handle associated with |user_id|.
40 bool HasToken(const user_manager::UserID& user_id); 40 bool HasToken(const user_manager::UserID& user_id);
41 41
42 // Removes token handle for |user_id| from UserManager storage. 42 // Removes token handle for |user_id| from UserManager storage.
43 void DeleteToken(const user_manager::UserID& user_id); 43 void DeleteHandle(const user_manager::UserID& user_id);
44
45 //
Nikita (slow) 2015/05/12 17:45:57 nit: comment is missing?
46 void MarkHandleInvalid(const user_manager::UserID& user_id);
47
48 bool ShouldObtainHandle(const user_manager::UserID& user_id);
Nikita (slow) 2015/05/12 17:45:57 nit: same here
44 49
45 // Performs token handle check for |user_id|. Will call |callback| with 50 // Performs token handle check for |user_id|. Will call |callback| with
46 // corresponding result. 51 // corresponding result.
47 void CheckToken(const user_manager::UserID& user_id, 52 void CheckToken(const user_manager::UserID& user_id,
48 const TokenValidationCallback& callback); 53 const TokenValidationCallback& callback);
49 54
50 // Given the OAuth |access_token| attempt to obtain token handle and store it 55 // Given the OAuth |access_token| attempt to obtain token handle and store it
51 // for |user_id|. 56 // for |user_id|.
52 void GetTokenHandle(const user_manager::UserID& user_id, 57 void GetTokenHandle(const user_manager::UserID& user_id,
53 const std::string& access_token, 58 const std::string& access_token,
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 102
98 // Instance of GAIA Client. 103 // Instance of GAIA Client.
99 scoped_ptr<gaia::GaiaOAuthClient> gaia_client_; 104 scoped_ptr<gaia::GaiaOAuthClient> gaia_client_;
100 105
101 base::WeakPtrFactory<TokenHandleUtil> weak_factory_; 106 base::WeakPtrFactory<TokenHandleUtil> weak_factory_;
102 107
103 DISALLOW_COPY_AND_ASSIGN(TokenHandleUtil); 108 DISALLOW_COPY_AND_ASSIGN(TokenHandleUtil);
104 }; 109 };
105 110
106 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_TOKEN_HANDLE_UTIL_H_ 111 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SIGNIN_TOKEN_HANDLE_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698