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

Unified Diff: chrome/browser/supervised_user/permission_request_creator_apiary.h

Issue 592353002: PermissionRequestCreatorApiary: Support for multiple simultaneous requests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move struct into .cc Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
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..990b2f5606c57f245448d8140dc5309148ab937b 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,9 @@ class PermissionRequestCreatorApiary : public PermissionRequestCreator,
const base::Closure& callback) OVERRIDE;
private:
+ struct Request;
+ typedef ScopedVector<Request>::iterator RequestIterator;
+
// OAuth2TokenService::Consumer implementation:
virtual void OnGetTokenSuccess(const OAuth2TokenService::Request* request,
const std::string& access_token,
@@ -57,20 +61,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_

Powered by Google App Engine
This is Rietveld 408576698