| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef GOOGLE_APIS_GCM_ENGINE_CHECKIN_REQUEST_H_ | 5 #ifndef GOOGLE_APIS_GCM_ENGINE_CHECKIN_REQUEST_H_ |
| 6 #define GOOGLE_APIS_GCM_ENGINE_CHECKIN_REQUEST_H_ | 6 #define GOOGLE_APIS_GCM_ENGINE_CHECKIN_REQUEST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | |
| 10 | 9 |
| 11 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 12 #include "base/callback.h" | 11 #include "base/callback.h" |
| 13 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 14 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 15 #include "google_apis/gcm/base/gcm_export.h" | 14 #include "google_apis/gcm/base/gcm_export.h" |
| 16 #include "google_apis/gcm/protocol/android_checkin.pb.h" | 15 #include "google_apis/gcm/protocol/android_checkin.pb.h" |
| 17 #include "google_apis/gcm/protocol/checkin.pb.h" | 16 #include "google_apis/gcm/protocol/checkin.pb.h" |
| 18 #include "net/base/backoff_entry.h" | 17 #include "net/base/backoff_entry.h" |
| 19 #include "net/url_request/url_fetcher_delegate.h" | 18 #include "net/url_request/url_fetcher_delegate.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 36 // A callback function for the checkin request, accepting |checkin_response| | 35 // A callback function for the checkin request, accepting |checkin_response| |
| 37 // protobuf. | 36 // protobuf. |
| 38 typedef base::Callback<void(const checkin_proto::AndroidCheckinResponse& | 37 typedef base::Callback<void(const checkin_proto::AndroidCheckinResponse& |
| 39 checkin_response)> CheckinRequestCallback; | 38 checkin_response)> CheckinRequestCallback; |
| 40 | 39 |
| 41 // Checkin request details. | 40 // Checkin request details. |
| 42 struct GCM_EXPORT RequestInfo { | 41 struct GCM_EXPORT RequestInfo { |
| 43 RequestInfo(uint64 android_id, | 42 RequestInfo(uint64 android_id, |
| 44 uint64 security_token, | 43 uint64 security_token, |
| 45 const std::string& settings_digest, | 44 const std::string& settings_digest, |
| 46 const std::vector<std::string>& account_ids, | |
| 47 const checkin_proto::ChromeBuildProto& chrome_build_proto); | 45 const checkin_proto::ChromeBuildProto& chrome_build_proto); |
| 48 ~RequestInfo(); | 46 ~RequestInfo(); |
| 49 | 47 |
| 50 // Android ID of the device. | 48 // Android ID of the device. |
| 51 uint64 android_id; | 49 uint64 android_id; |
| 52 // Security token of the device. | 50 // Security token of the device. |
| 53 uint64 security_token; | 51 uint64 security_token; |
| 54 // Digest of GServices settings on the device. | 52 // Digest of GServices settings on the device. |
| 55 std::string settings_digest; | 53 std::string settings_digest; |
| 56 // Account IDs of GAIA accounts related to this device. | |
| 57 std::vector<std::string> account_ids; | |
| 58 // Information of the Chrome build of this device. | 54 // Information of the Chrome build of this device. |
| 59 checkin_proto::ChromeBuildProto chrome_build_proto; | 55 checkin_proto::ChromeBuildProto chrome_build_proto; |
| 60 }; | 56 }; |
| 61 | 57 |
| 62 CheckinRequest(const GURL& checkin_url, | 58 CheckinRequest(const GURL& checkin_url, |
| 63 const RequestInfo& request_info, | 59 const RequestInfo& request_info, |
| 64 const net::BackoffEntry::Policy& backoff_policy, | 60 const net::BackoffEntry::Policy& backoff_policy, |
| 65 const CheckinRequestCallback& callback, | 61 const CheckinRequestCallback& callback, |
| 66 net::URLRequestContextGetter* request_context_getter, | 62 net::URLRequestContextGetter* request_context_getter, |
| 67 GCMStatsRecorder* recorder); | 63 GCMStatsRecorder* recorder); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 90 GCMStatsRecorder* recorder_; | 86 GCMStatsRecorder* recorder_; |
| 91 | 87 |
| 92 base::WeakPtrFactory<CheckinRequest> weak_ptr_factory_; | 88 base::WeakPtrFactory<CheckinRequest> weak_ptr_factory_; |
| 93 | 89 |
| 94 DISALLOW_COPY_AND_ASSIGN(CheckinRequest); | 90 DISALLOW_COPY_AND_ASSIGN(CheckinRequest); |
| 95 }; | 91 }; |
| 96 | 92 |
| 97 } // namespace gcm | 93 } // namespace gcm |
| 98 | 94 |
| 99 #endif // GOOGLE_APIS_GCM_ENGINE_CHECKIN_REQUEST_H_ | 95 #endif // GOOGLE_APIS_GCM_ENGINE_CHECKIN_REQUEST_H_ |
| OLD | NEW |