summaryrefslogtreecommitdiffstats
path: root/google_apis/gaia
diff options
context:
space:
mode:
authorbzanotti <bzanotti@chromium.org>2015-06-05 07:43:53 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-05 14:44:35 +0000
commit6b49663d722eb516fbe96ae6f64d5bfc48a1dd57 (patch)
tree6529ac06cd56997a23820d716ceaeb02014897a3 /google_apis/gaia
parent83caea53296386c8cded579499ee433f6b46bfe3 (diff)
downloadchromium_src-6b49663d722eb516fbe96ae6f64d5bfc48a1dd57.zip
chromium_src-6b49663d722eb516fbe96ae6f64d5bfc48a1dd57.tar.gz
chromium_src-6b49663d722eb516fbe96ae6f64d5bfc48a1dd57.tar.bz2
Improve GaiaAuthFetcher's API for its subclasses.
As |GaiaAuthFetcher::CreateAndStartGaiaFetcher| can already be specialized by a subclass, |GaiaAuthFetcher::CancelRequest| should as well, to allow specialized fetchers to be cancelled. BUG=495597 Review URL: https://codereview.chromium.org/1153293004 Cr-Commit-Position: refs/heads/master@{#333045}
Diffstat (limited to 'google_apis/gaia')
-rw-r--r--google_apis/gaia/gaia_auth_fetcher.cc4
-rw-r--r--google_apis/gaia/gaia_auth_fetcher.h4
2 files changed, 7 insertions, 1 deletions
diff --git a/google_apis/gaia/gaia_auth_fetcher.cc b/google_apis/gaia/gaia_auth_fetcher.cc
index 42134bb..eaae715 100644
--- a/google_apis/gaia/gaia_auth_fetcher.cc
+++ b/google_apis/gaia/gaia_auth_fetcher.cc
@@ -224,6 +224,10 @@ bool GaiaAuthFetcher::HasPendingFetch() {
return fetch_pending_;
}
+void GaiaAuthFetcher::SetPendingFetch(bool pending_fetch) {
+ fetch_pending_ = pending_fetch;
+}
+
void GaiaAuthFetcher::CancelRequest() {
fetcher_.reset();
fetch_pending_ = false;
diff --git a/google_apis/gaia/gaia_auth_fetcher.h b/google_apis/gaia/gaia_auth_fetcher.h
index 8910cfd..163db74 100644
--- a/google_apis/gaia/gaia_auth_fetcher.h
+++ b/google_apis/gaia/gaia_auth_fetcher.h
@@ -224,7 +224,7 @@ class GaiaAuthFetcher : public net::URLFetcherDelegate {
bool HasPendingFetch();
// Stop any URL fetches in progress.
- void CancelRequest();
+ virtual void CancelRequest();
// From a URLFetcher result, generate an appropriate error.
// From the API documentation, both IssueAuthToken and ClientLogin have
@@ -255,6 +255,8 @@ class GaiaAuthFetcher : public net::URLFetcherDelegate {
const net::URLRequestStatus& status,
int response_code);
+ void SetPendingFetch(bool pending_fetch);
+
private:
// ClientLogin body constants that don't change
static const char kCookiePersistence[];