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

Unified Diff: chrome/browser/google_apis/base_requests.cc

Issue 17379020: Get rid of RequestRegistry (part 5): each request cancels itself. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | « chrome/browser/google_apis/base_requests.h ('k') | chrome/browser/google_apis/request_registry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/google_apis/base_requests.cc
diff --git a/chrome/browser/google_apis/base_requests.cc b/chrome/browser/google_apis/base_requests.cc
index 52dce3011b3346664d572e72a023bcf21ab0d972..3c11531d0d0451f091adb86ff7e26ebdc5b4372b 100644
--- a/chrome/browser/google_apis/base_requests.cc
+++ b/chrome/browser/google_apis/base_requests.cc
@@ -218,9 +218,10 @@ bool UrlFetchRequestBase::GetContentFile(base::FilePath* local_file_path,
return false;
}
-void UrlFetchRequestBase::DoCancel() {
+void UrlFetchRequestBase::Cancel() {
url_fetcher_.reset(NULL);
RunCallbackOnPrematureFailure(GDATA_CANCELLED);
+ NotifyFinish();
}
// static
@@ -239,7 +240,7 @@ GDataErrorCode UrlFetchRequestBase::GetErrorCode(const URLFetcher* source) {
}
void UrlFetchRequestBase::OnProcessURLFetchResultsComplete(bool result) {
- NotifyFinish(result ? REQUEST_COMPLETED : REQUEST_FAILED);
+ NotifyFinish();
}
void UrlFetchRequestBase::OnURLFetchComplete(const URLFetcher* source) {
@@ -274,11 +275,7 @@ void UrlFetchRequestBase::OnAuthFailed(GDataErrorCode code) {
// Note: NotifyFinish() must be invoked at the end, after all other callbacks
// and notifications. Once NotifyFinish() is called, the current instance of
// request will be deleted from the RequestRegistry and become invalid.
- NotifyFinish(REQUEST_FAILED);
-}
-
-RequestRegistry::Request* UrlFetchRequestBase::AsRequestRegistryRequest() {
- return this;
+ NotifyFinish();
}
base::WeakPtr<AuthenticatedRequestInterface>
« no previous file with comments | « chrome/browser/google_apis/base_requests.h ('k') | chrome/browser/google_apis/request_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698