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

Unified Diff: google_apis/gcm/engine/unregistration_request.h

Issue 1137463003: Support getting and deleting token for Instance ID. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix trybots Created 5 years, 7 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
Index: google_apis/gcm/engine/unregistration_request.h
diff --git a/google_apis/gcm/engine/unregistration_request.h b/google_apis/gcm/engine/unregistration_request.h
index c5c0eb5919b915e2672e0c3a4e8bfffe690130b9..15110e0c1dc1cd5d605861463c2c38ef2f296b4b 100644
--- a/google_apis/gcm/engine/unregistration_request.h
+++ b/google_apis/gcm/engine/unregistration_request.h
@@ -24,9 +24,9 @@ namespace gcm {
class GCMStatsRecorder;
-// Unregistration request is used to revoke registration IDs for applications
-// that were uninstalled and should no longer receive GCM messages. In case an
-// attempt to unregister fails, it will retry using the backoff policy.
+// Encapsulates the common logic applying to both GCM unregistration requests
+// and InstanceID delete-token requests. In case an attempt fails, it will retry
+// using the backoff policy.
// TODO(fgorski): Consider sharing code with RegistrationRequest if possible.
class GCM_EXPORT UnregistrationRequest : public net::URLFetcherDelegate {
public:
@@ -55,7 +55,8 @@ class GCM_EXPORT UnregistrationRequest : public net::URLFetcherDelegate {
// Callback completing the unregistration request.
typedef base::Callback<void(Status success)> UnregistrationCallback;
- // Details of the of the Unregistration Request. All parameters are mandatory.
+ // Encapsulates the common info about an unregistration/token-deletion
+ // request. All parameters are mandatory.
struct GCM_EXPORT RequestInfo {
RequestInfo(uint64 android_id,
uint64 security_token,
@@ -85,10 +86,17 @@ class GCM_EXPORT UnregistrationRequest : public net::URLFetcherDelegate {
// Starts an unregistration request.
void Start();
+ virtual void BuildRequestHeaders(std::string* extra_headers);
Nicolas Zea 2015/05/21 21:07:51 Is anything overriding this?
jianli 2015/05/21 23:11:24 No. Removed virtual.
+ virtual void BuildRequestBody(std::string* body);
+ virtual bool ParseResponse(const net::URLFetcher* source, Status* status);
+
+ protected:
+ std::string app_id() const;
+
+ private:
// URLFetcherDelegate implementation.
void OnURLFetchComplete(const net::URLFetcher* source) override;
- private:
// Schedules a retry attempt and informs the backoff of previous request's
// failure, when |update_backoff| is true.
void RetryWithBackoff(bool update_backoff);

Powered by Google App Engine
This is Rietveld 408576698