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 <stdint.h> |
| 9 |
8 #include <string> | 10 #include <string> |
9 | 11 |
10 #include "base/basictypes.h" | |
11 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/macros.h" |
12 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
13 #include "base/time/time.h" | 15 #include "base/time/time.h" |
14 #include "google_apis/gcm/base/gcm_export.h" | 16 #include "google_apis/gcm/base/gcm_export.h" |
15 #include "google_apis/gcm/protocol/android_checkin.pb.h" | 17 #include "google_apis/gcm/protocol/android_checkin.pb.h" |
16 #include "google_apis/gcm/protocol/checkin.pb.h" | 18 #include "google_apis/gcm/protocol/checkin.pb.h" |
17 #include "net/base/backoff_entry.h" | 19 #include "net/base/backoff_entry.h" |
18 #include "net/url_request/url_fetcher_delegate.h" | 20 #include "net/url_request/url_fetcher_delegate.h" |
19 #include "url/gurl.h" | 21 #include "url/gurl.h" |
20 | 22 |
21 namespace net { | 23 namespace net { |
(...skipping 10 matching lines...) Expand all Loading... |
32 // check-ins. | 34 // check-ins. |
33 class GCM_EXPORT CheckinRequest : public net::URLFetcherDelegate { | 35 class GCM_EXPORT CheckinRequest : public net::URLFetcherDelegate { |
34 public: | 36 public: |
35 // A callback function for the checkin request, accepting |checkin_response| | 37 // A callback function for the checkin request, accepting |checkin_response| |
36 // protobuf. | 38 // protobuf. |
37 typedef base::Callback<void(const checkin_proto::AndroidCheckinResponse& | 39 typedef base::Callback<void(const checkin_proto::AndroidCheckinResponse& |
38 checkin_response)> CheckinRequestCallback; | 40 checkin_response)> CheckinRequestCallback; |
39 | 41 |
40 // Checkin request details. | 42 // Checkin request details. |
41 struct GCM_EXPORT RequestInfo { | 43 struct GCM_EXPORT RequestInfo { |
42 RequestInfo(uint64 android_id, | 44 RequestInfo(uint64_t android_id, |
43 uint64 security_token, | 45 uint64_t security_token, |
44 const std::map<std::string, std::string>& account_tokens, | 46 const std::map<std::string, std::string>& account_tokens, |
45 const std::string& settings_digest, | 47 const std::string& settings_digest, |
46 const checkin_proto::ChromeBuildProto& chrome_build_proto); | 48 const checkin_proto::ChromeBuildProto& chrome_build_proto); |
47 ~RequestInfo(); | 49 ~RequestInfo(); |
48 | 50 |
49 // Android ID of the device. | 51 // Android ID of the device. |
50 uint64 android_id; | 52 uint64_t android_id; |
51 // Security token of the device. | 53 // Security token of the device. |
52 uint64 security_token; | 54 uint64_t security_token; |
53 // Map of account OAuth2 tokens keyed by emails. | 55 // Map of account OAuth2 tokens keyed by emails. |
54 std::map<std::string, std::string> account_tokens; | 56 std::map<std::string, std::string> account_tokens; |
55 // Digest of GServices settings on the device. | 57 // Digest of GServices settings on the device. |
56 std::string settings_digest; | 58 std::string settings_digest; |
57 // Information of the Chrome build of this device. | 59 // Information of the Chrome build of this device. |
58 checkin_proto::ChromeBuildProto chrome_build_proto; | 60 checkin_proto::ChromeBuildProto chrome_build_proto; |
59 }; | 61 }; |
60 | 62 |
61 CheckinRequest(const GURL& checkin_url, | 63 CheckinRequest(const GURL& checkin_url, |
62 const RequestInfo& request_info, | 64 const RequestInfo& request_info, |
(...skipping 25 matching lines...) Expand all Loading... |
88 GCMStatsRecorder* recorder_; | 90 GCMStatsRecorder* recorder_; |
89 | 91 |
90 base::WeakPtrFactory<CheckinRequest> weak_ptr_factory_; | 92 base::WeakPtrFactory<CheckinRequest> weak_ptr_factory_; |
91 | 93 |
92 DISALLOW_COPY_AND_ASSIGN(CheckinRequest); | 94 DISALLOW_COPY_AND_ASSIGN(CheckinRequest); |
93 }; | 95 }; |
94 | 96 |
95 } // namespace gcm | 97 } // namespace gcm |
96 | 98 |
97 #endif // GOOGLE_APIS_GCM_ENGINE_CHECKIN_REQUEST_H_ | 99 #endif // GOOGLE_APIS_GCM_ENGINE_CHECKIN_REQUEST_H_ |
OLD | NEW |