Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef GOOGLE_APIS_GCM_ENGINE_CHECKIN_REQUEST_H_ | |
| 6 #define GOOGLE_APIS_GCM_ENGINE_CHECKIN_REQUEST_H_ | |
| 7 | |
| 8 #include "base/basictypes.h" | |
| 9 #include "base/callback.h" | |
| 10 #include "google_apis/gcm/base/gcm_export.h" | |
| 11 #include "google_apis/gcm/gcm_client.h" | |
| 12 #include "google_apis/gcm/protocol/android_checkin.pb.h" | |
| 13 #include "net/url_request/url_fetcher_delegate.h" | |
| 14 | |
| 15 namespace net { | |
| 16 class URLRequestContextGetter; | |
| 17 } | |
| 18 | |
| 19 namespace gcm { | |
| 20 | |
| 21 class GCM_EXPORT CheckinRequest : public net::URLFetcherDelegate { | |
|
Nicolas Zea
2014/01/07 00:41:52
Add comment describing the purpose of this class
fgorski
2014/01/07 23:46:44
Done.
| |
| 22 public: | |
| 23 // A callback function for the checkin request, accepting |android_id| and | |
| 24 // |security_token|. | |
| 25 typedef base::Callback<void(uint64, uint64)> CheckinRequestCallback; | |
| 26 | |
| 27 CheckinRequest(const CheckinRequestCallback& callback, | |
| 28 const checkin_proto::ChromeBuildProto& chrome_build_proto, | |
| 29 int64 user_serial_number, | |
| 30 const GCMClient::CheckinInfo& checkin_info, | |
|
Nicolas Zea
2014/01/07 00:41:52
It's a bit weird that a CheckinRequest takes a Che
fgorski
2014/01/07 23:46:44
Done.
| |
| 31 net::URLRequestContextGetter* request_context_getter); | |
| 32 virtual ~CheckinRequest(); | |
| 33 | |
| 34 void Start(); | |
| 35 | |
| 36 // URLFetcherDelegate implementation. | |
| 37 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; | |
| 38 | |
| 39 private: | |
| 40 net::URLRequestContextGetter* request_context_getter_; | |
| 41 CheckinRequestCallback callback_; | |
| 42 | |
| 43 scoped_ptr<net::URLFetcher> url_fetcher_; | |
| 44 checkin_proto::ChromeBuildProto chrome_build_proto_; | |
| 45 uint64 android_id_; | |
| 46 uint64 security_token_; | |
| 47 int64 user_serial_number_; | |
| 48 | |
| 49 DISALLOW_COPY_AND_ASSIGN(CheckinRequest); | |
| 50 }; | |
| 51 | |
| 52 } // namespace gcm | |
| 53 | |
| 54 #endif // GOOGLE_APIS_GCM_ENGINE_CHECKIN_REQUEST_H_ | |
| OLD | NEW |