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

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

Issue 215363007: [GCM] Adding basic G-services handling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removing the G-services handling form GCMClientImpl Created 6 years, 8 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 | google_apis/gcm/engine/checkin_request.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gcm/engine/checkin_request.h
diff --git a/google_apis/gcm/engine/checkin_request.h b/google_apis/gcm/engine/checkin_request.h
index e11089acd1f02282104eb140ca05a5462e6106bd..1d706a7d88d963ac7d787e88dbf168c9c6033a0d 100644
--- a/google_apis/gcm/engine/checkin_request.h
+++ b/google_apis/gcm/engine/checkin_request.h
@@ -12,7 +12,7 @@
#include "base/callback.h"
#include "base/memory/weak_ptr.h"
#include "google_apis/gcm/base/gcm_export.h"
-#include "google_apis/gcm/protocol/android_checkin.pb.h"
+#include "google_apis/gcm/protocol/checkin.pb.h"
#include "net/base/backoff_entry.h"
#include "net/url_request/url_fetcher_delegate.h"
@@ -28,17 +28,35 @@ namespace gcm {
// check-ins.
class GCM_EXPORT CheckinRequest : public net::URLFetcherDelegate {
public:
- // A callback function for the checkin request, accepting |android_id| and
- // |security_token|.
- typedef base::Callback<void(uint64 android_id, uint64 security_token)>
- CheckinRequestCallback;
-
- CheckinRequest(const CheckinRequestCallback& callback,
+ // A callback function for the checkin request, accepting |checkin_response|
+ // protobuf.
+ typedef base::Callback<void(const checkin_proto::AndroidCheckinResponse&
+ checkin_response)> CheckinRequestCallback;
+
+ // Checkin request details.
+ struct GCM_EXPORT RequestInfo {
+ RequestInfo(uint64 android_id,
+ uint64 security_token,
+ const std::string& settings_digest,
+ const std::vector<std::string>& account_ids,
+ const checkin_proto::ChromeBuildProto& chrome_build_proto);
+ ~RequestInfo();
+
+ // Android ID of the device.
+ uint64 android_id;
+ // Security token of the device.
+ uint64 security_token;
+ // Digest of GServices settings on the device.
+ std::string settings_digest;
+ // Account IDs of GAIA accounts related to this device.
+ std::vector<std::string> account_ids;
+ // Information of the Chrome build of this device.
+ checkin_proto::ChromeBuildProto chrome_build_proto;
+ };
+
+ CheckinRequest(const RequestInfo& request_info,
const net::BackoffEntry::Policy& backoff_policy,
- const checkin_proto::ChromeBuildProto& chrome_build_proto,
- uint64 android_id,
- uint64 security_token,
- const std::vector<std::string>& account_ids,
+ const CheckinRequestCallback& callback,
net::URLRequestContextGetter* request_context_getter);
virtual ~CheckinRequest();
@@ -57,10 +75,7 @@ class GCM_EXPORT CheckinRequest : public net::URLFetcherDelegate {
net::BackoffEntry backoff_entry_;
scoped_ptr<net::URLFetcher> url_fetcher_;
- const checkin_proto::ChromeBuildProto chrome_build_proto_;
- const uint64 android_id_;
- const uint64 security_token_;
- const std::vector<std::string> account_ids_;
+ const RequestInfo request_info_;
base::WeakPtrFactory<CheckinRequest> weak_ptr_factory_;
« no previous file with comments | « no previous file | google_apis/gcm/engine/checkin_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698