Skip to content

Commit

Permalink
Improve GaiaAuthFetcher's API for its subclasses.
Browse files Browse the repository at this point in the history
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}
  • Loading branch information
bzanotti authored and Commit bot committed Jun 5, 2015
1 parent 83caea5 commit 6b49663
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions google_apis/gaia/gaia_auth_fetcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion google_apis/gaia/gaia_auth_fetcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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[];
Expand Down

0 comments on commit 6b49663

Please sign in to comment.