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

Unified Diff: chrome/browser/google_apis/request_registry.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 | « chrome/browser/google_apis/base_requests.cc ('k') | chrome/browser/google_apis/request_registry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/google_apis/request_registry.h
diff --git a/chrome/browser/google_apis/request_registry.h b/chrome/browser/google_apis/request_registry.h
index 9374baa6f25f9f4059fe59e72a2f56658635007d..1331f913ff7ffa0986557cc394d88b65bc9e1c84 100644
--- a/chrome/browser/google_apis/request_registry.h
+++ b/chrome/browser/google_apis/request_registry.h
@@ -6,37 +6,13 @@
#define CHROME_BROWSER_GOOGLE_APIS_REQUEST_REGISTRY_H_
#include "base/basictypes.h"
-#include "base/files/file_path.h"
#include "base/id_map.h"
-#include "chrome/browser/google_apis/gdata_errorcode.h"
namespace google_apis {
// Unique ID to identify each request.
typedef int32 RequestID;
-// Enumeration type for indicating the state of the transfer.
-enum RequestTransferState {
- REQUEST_NOT_STARTED,
- REQUEST_STARTED,
- REQUEST_IN_PROGRESS,
- REQUEST_COMPLETED,
- REQUEST_FAILED,
-};
-
-// Returns string representations of the request state.
-std::string RequestTransferStateToString(RequestTransferState state);
-
-// Structure that packs progress information of each request.
-struct RequestProgressStatus {
- RequestProgressStatus();
-
- RequestID request_id;
-
- // Current state of the transfer;
- RequestTransferState transfer_state;
-};
-
// This class tracks all the in-flight Google API requests and manage
// their lifetime.
class RequestRegistry {
@@ -53,31 +29,16 @@ class RequestRegistry {
explicit Request(RequestRegistry* registry);
virtual ~Request();
- // Cancels the ongoing request. NotifyFinish() is called and the Request
- // object is deleted once the cancellation is done in DoCancel().
- void Cancel();
-
- // Retrieves the current progress status of the request.
- const RequestProgressStatus& progress_status() const {
- return progress_status_;
- }
-
protected:
// Notifies the registry about current status.
void NotifyStart();
- void NotifyFinish(RequestTransferState status);
+ void NotifyFinish();
private:
- // Does the cancellation.
- virtual void DoCancel() = 0;
-
RequestRegistry* const registry_;
- RequestProgressStatus progress_status_;
+ RequestID id_;
};
- // Cancels the specified request.
- void CancelRequest(Request* request);
-
private:
// Handlers for notifications from Requests.
friend class Request;
« no previous file with comments | « chrome/browser/google_apis/base_requests.cc ('k') | chrome/browser/google_apis/request_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698