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

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

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 | « no previous file | chrome/browser/google_apis/base_requests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/google_apis/base_requests.h
diff --git a/chrome/browser/google_apis/base_requests.h b/chrome/browser/google_apis/base_requests.h
index 356eefc9fe2cc916a0ebdc456ab3f82b05cad829..ff71dabd5edc1af118c9b90eab3db40c7a363cc7 100644
--- a/chrome/browser/google_apis/base_requests.h
+++ b/chrome/browser/google_apis/base_requests.h
@@ -12,6 +12,7 @@
#include <vector>
#include "base/callback.h"
+#include "base/files/file_path.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/google_apis/gdata_errorcode.h"
#include "chrome/browser/google_apis/request_registry.h"
@@ -77,10 +78,9 @@ class AuthenticatedRequestInterface {
// using weak pointers, while deprecating RequestRegistry.
virtual base::WeakPtr<AuthenticatedRequestInterface> GetWeakPtr() = 0;
- // TODO(kinaba): crbug.com/{164089, 231209} This is temporarily added during
- // migration of cancellation from RequestRegistry to JobScheduler. It should
- // go away *very soon*.
- virtual RequestRegistry::Request* AsRequestRegistryRequest() = 0;
+ // Cancels the request. It will invoke the callback object passed in
+ // each request's constructor with error code GDATA_CANCELLED.
+ virtual void Cancel() = 0;
};
//============================ UrlFetchRequestBase ===========================
@@ -95,6 +95,7 @@ class UrlFetchRequestBase : public AuthenticatedRequestInterface,
const std::string& custom_user_agent,
const ReAuthenticateCallback& callback) OVERRIDE;
virtual base::WeakPtr<AuthenticatedRequestInterface> GetWeakPtr() OVERRIDE;
+ virtual void Cancel() OVERRIDE;
protected:
UrlFetchRequestBase(RequestSender* runner,
@@ -159,15 +160,11 @@ class UrlFetchRequestBase : public AuthenticatedRequestInterface,
}
private:
- // RequestRegistry::Request overrides.
- virtual void DoCancel() OVERRIDE;
-
// URLFetcherDelegate overrides.
virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE;
// AuthenticatedRequestInterface overrides.
virtual void OnAuthFailed(GDataErrorCode code) OVERRIDE;
- virtual RequestRegistry::Request* AsRequestRegistryRequest() OVERRIDE;
net::URLRequestContextGetter* url_request_context_getter_;
ReAuthenticateCallback re_authenticate_callback_;
@@ -178,7 +175,6 @@ class UrlFetchRequestBase : public AuthenticatedRequestInterface,
bool save_temp_file_;
base::FilePath output_file_path_;
- // WeakPtrFactory bound to the UI thread.
// Note: This should remain the last member so it'll be destroyed and
// invalidate its weak pointers before any other members are destroyed.
base::WeakPtrFactory<UrlFetchRequestBase> weak_ptr_factory_;
« no previous file with comments | « no previous file | chrome/browser/google_apis/base_requests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698