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

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: Add new files 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..1d525640f61783a6bbe89fe1d684a63759d3bdcc 100644
--- a/google_apis/gcm/engine/unregistration_request.h
+++ b/google_apis/gcm/engine/unregistration_request.h
@@ -57,11 +57,14 @@ class GCM_EXPORT UnregistrationRequest : public net::URLFetcherDelegate {
// Details of the of the Unregistration Request. All parameters are mandatory.
struct GCM_EXPORT RequestInfo {
- RequestInfo(uint64 android_id,
- uint64 security_token,
- const std::string& app_id);
- ~RequestInfo();
+ RequestInfo();
+ virtual ~RequestInfo();
+ virtual void BuildRequestHeaders(std::string* extra_headers);
+ virtual void BuildRequestBody(std::string* body);
+
+ // Version to pass.
+ std::string chrome_version;
// Android ID of the device.
uint64 android_id;
// Security token of the device.
@@ -70,12 +73,34 @@ class GCM_EXPORT UnregistrationRequest : public net::URLFetcherDelegate {
std::string app_id;
};
+ // GCM registration request.
+ struct GCM_EXPORT GCMRequestInfo : public RequestInfo {
+ GCMRequestInfo();
+ ~GCMRequestInfo() override;
+
+ // RequestInfo overrides:
+ void BuildRequestBody(std::string* body) override;
+ };
+
+ // GCM token request.
fgorski 2015/05/13 18:32:41 Instance ID token request
jianli 2015/05/13 22:42:57 Done.
+ struct GCM_EXPORT InstanceIDRequestInfo : public RequestInfo {
+ InstanceIDRequestInfo();
+ ~InstanceIDRequestInfo() override;
+
+ // RequestInfo overrides:
+ void BuildRequestBody(std::string* body) override;
+
+ std::string instance_id;
+ std::string authorized_entity;
+ std::string scope;
+ };
+
// Creates an instance of UnregistrationRequest. |callback| will be called
// once registration has been revoked or there has been an error that makes
// further retries pointless.
UnregistrationRequest(
const GURL& registration_url,
- const RequestInfo& request_info,
+ scoped_ptr<RequestInfo> request_info,
const net::BackoffEntry::Policy& backoff_policy,
const UnregistrationCallback& callback,
scoped_refptr<net::URLRequestContextGetter> request_context_getter,
@@ -94,7 +119,7 @@ class GCM_EXPORT UnregistrationRequest : public net::URLFetcherDelegate {
void RetryWithBackoff(bool update_backoff);
UnregistrationCallback callback_;
- RequestInfo request_info_;
+ scoped_ptr<RequestInfo> request_info_;
GURL registration_url_;
net::BackoffEntry backoff_entry_;

Powered by Google App Engine
This is Rietveld 408576698