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

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

Issue 98173009: GCM Checkin implementation with unit tests and protobufs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gcm-store
Patch Set: Adding more tests per code review, fixing copyright notice Created 6 years, 11 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/gcm_checkin_request.h
diff --git a/google_apis/gcm/engine/gcm_checkin_request.h b/google_apis/gcm/engine/gcm_checkin_request.h
new file mode 100644
index 0000000000000000000000000000000000000000..d9fab410dd68dd073262cb689e18e4974d40084b
--- /dev/null
+++ b/google_apis/gcm/engine/gcm_checkin_request.h
@@ -0,0 +1,54 @@
+// Copyright (c) 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef GOOGLE_APIS_GCM_ENGINE_GCM_CHECKIN_REQUEST_H_
+#define GOOGLE_APIS_GCM_ENGINE_GCM_CHECKIN_REQUEST_H_
+
+#include "base/basictypes.h"
+#include "base/callback.h"
+#include "google_apis/gcm/base/gcm_export.h"
+#include "google_apis/gcm/gcm_client.h"
+#include "google_apis/gcm/protocol/android_checkin.pb.h"
+#include "net/url_request/url_fetcher_delegate.h"
+
+namespace net {
+class URLRequestContextGetter;
+}
+
+namespace gcm {
+
+class GCM_EXPORT GCMCheckinRequest : public net::URLFetcherDelegate {
jianli 2014/01/06 22:26:33 Name the class as GCMCheckInRequest to be consiste
fgorski 2014/01/06 23:15:54 Done. By updating the name to CheckinRequest, and
+ public:
+ // A callback function for the checkin request, accepting |android_id| and
+ // |security_token|.
+ typedef base::Callback<void(uint64, uint64)> CheckinRequestCallback;
+
+ GCMCheckinRequest(const CheckinRequestCallback& callback,
+ const checkin_proto::ChromeBuildProto& chrome_build_proto,
+ int64 user_serial_number,
+ const GCMClient::CheckInInfo& checkin_info,
+ net::URLRequestContextGetter* request_context_getter);
+ virtual ~GCMCheckinRequest();
+
+ void Start();
+
+ // URLFetcherDelegate implementation.
+ virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE;
+
+ private:
+ net::URLRequestContextGetter* request_context_getter_;
+ CheckinRequestCallback callback_;
+
+ scoped_ptr<net::URLFetcher> url_fetcher_;
+ checkin_proto::ChromeBuildProto chrome_build_proto_;
+ uint64 android_id_;
+ uint64 security_token_;
+ int64 user_serial_number_;
+
+ DISALLOW_COPY_AND_ASSIGN(GCMCheckinRequest);
+};
+
+} // namespace gcm
+
+#endif // GOOGLE_APIS_GCM_ENGINE_GCM_CHECKIN_REQUEST_H_
« no previous file with comments | « no previous file | google_apis/gcm/engine/gcm_checkin_request.cc » ('j') | google_apis/gcm/engine/gcm_checkin_request_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698