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

Unified Diff: components/autofill/core/browser/wallet/real_pan_wallet_client.h

Issue 966943004: getrealpan - Handle 401 Unauthorized (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: also remove accept-encoding header Created 5 years, 10 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
« no previous file with comments | « no previous file | components/autofill/core/browser/wallet/real_pan_wallet_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/wallet/real_pan_wallet_client.h
diff --git a/components/autofill/core/browser/wallet/real_pan_wallet_client.h b/components/autofill/core/browser/wallet/real_pan_wallet_client.h
index 4331d8cc508237f12edf609a05394eb06d7859b6..82dc0b72d0664d3add9d23e9c63f41bb2892433d 100644
--- a/components/autofill/core/browser/wallet/real_pan_wallet_client.h
+++ b/components/autofill/core/browser/wallet/real_pan_wallet_client.h
@@ -8,6 +8,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "components/autofill/core/browser/card_unmask_delegate.h"
+#include "components/autofill/core/browser/credit_card.h"
#include "google_apis/gaia/oauth2_token_service.h"
#include "net/url_request/url_fetcher_delegate.h"
@@ -20,8 +21,6 @@ class URLRequestContextGetter;
namespace autofill {
-class CreditCard;
-
namespace wallet {
// RealPanWalletClient is modelled on WalletClient. Whereas the latter is used
@@ -70,8 +69,11 @@ class RealPanWalletClient : public net::URLFetcherDelegate,
void OnGetTokenFailure(const OAuth2TokenService::Request* request,
const GoogleServiceAuthError& error) override;
+ // Creates |request_| from |card_| and |response_|.
+ void CreateRequest();
+
// Initiates a new OAuth2 token request.
- void StartTokenFetch();
+ void StartTokenFetch(bool invalidate_old);
// Adds the token to |request_| and starts the request.
void SetOAuth2TokenAndStartRequest();
@@ -83,6 +85,10 @@ class RealPanWalletClient : public net::URLFetcherDelegate,
// of a request to Online Wallet.
Delegate* const delegate_; // must outlive |this|.
+ // The card and response for the latest unmask request.
+ CreditCard card_;
+ CardUnmaskDelegate::UnmaskResponse response_;
+
// The current Wallet request object.
scoped_ptr<net::URLFetcher> request_;
@@ -92,6 +98,9 @@ class RealPanWalletClient : public net::URLFetcherDelegate,
// The OAuth2 token, or empty if not fetched.
std::string access_token_;
+ // True if |this| has already retried due to a 401 response from the server.
+ bool has_retried_authorization_;
+
base::WeakPtrFactory<RealPanWalletClient> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(RealPanWalletClient);
« no previous file with comments | « no previous file | components/autofill/core/browser/wallet/real_pan_wallet_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698