Index: chrome/browser/supervised_user/permission_request_creator_apiary.h |
diff --git a/chrome/browser/supervised_user/permission_request_creator_apiary.h b/chrome/browser/supervised_user/permission_request_creator_apiary.h |
index ee1ecdb529cbb120527b4c0242a66429ebfee658..8d12cb3a5db332b2cd74cc6aeb4c4bc66fb51c91 100644 |
--- a/chrome/browser/supervised_user/permission_request_creator_apiary.h |
+++ b/chrome/browser/supervised_user/permission_request_creator_apiary.h |
@@ -8,6 +8,7 @@ |
#include <string> |
#include "base/memory/scoped_ptr.h" |
+#include "base/memory/scoped_vector.h" |
#include "chrome/browser/supervised_user/permission_request_creator.h" |
#include "google_apis/gaia/oauth2_token_service.h" |
#include "net/url_request/url_fetcher_delegate.h" |
@@ -43,6 +44,19 @@ class PermissionRequestCreatorApiary : public PermissionRequestCreator, |
const base::Closure& callback) OVERRIDE; |
private: |
+ struct Request { |
+ Request(const GURL& url_requested, const base::Closure& callback); |
+ ~Request(); |
+ |
+ GURL url_requested; |
+ base::Closure callback; |
+ scoped_ptr<OAuth2TokenService::Request> access_token_request; |
+ std::string access_token; |
Bernhard Bauer
2014/09/23 10:17:01
It's a bit weird that we store the access token pe
Marc Treib
2014/09/23 10:31:02
It's my understanding that access tokens are usual
Bernhard Bauer
2014/09/23 11:01:59
Well, short-lived means half an hour or so, I thin
Marc Treib
2014/09/23 11:08:43
Yeah, we could probably avoid explicitly storing t
|
+ bool access_token_expired; |
+ scoped_ptr<net::URLFetcher> url_fetcher; |
+ }; |
+ typedef ScopedVector<Request>::iterator RequestIterator; |
+ |
// OAuth2TokenService::Consumer implementation: |
virtual void OnGetTokenSuccess(const OAuth2TokenService::Request* request, |
const std::string& access_token, |
@@ -57,20 +71,17 @@ class PermissionRequestCreatorApiary : public PermissionRequestCreator, |
// Requests an access token, which is the first thing we need. This is where |
// we restart when the returned access token has expired. |
- void StartFetching(); |
+ void StartFetching(Request* request); |
- void DispatchNetworkError(int error_code); |
- void DispatchGoogleServiceAuthError(const GoogleServiceAuthError& error); |
+ void DispatchNetworkError(RequestIterator it, int error_code); |
+ void DispatchGoogleServiceAuthError(RequestIterator it, |
+ const GoogleServiceAuthError& error); |
OAuth2TokenService* oauth2_token_service_; |
scoped_ptr<SupervisedUserSigninManagerWrapper> signin_wrapper_; |
- base::Closure callback_; |
net::URLRequestContextGetter* context_; |
- GURL url_requested_; |
- scoped_ptr<OAuth2TokenService::Request> access_token_request_; |
- std::string access_token_; |
- bool access_token_expired_; |
- scoped_ptr<net::URLFetcher> url_fetcher_; |
+ |
+ ScopedVector<Request> requests_; |
}; |
#endif // CHROME_BROWSER_SUPERVISED_USER_PERMISSION_REQUEST_CREATOR_APIARY_H_ |