| 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_REGISTRATION_REQUEST_H_ | 5 #ifndef GOOGLE_APIS_GCM_ENGINE_REGISTRATION_REQUEST_H_ |
| 6 #define GOOGLE_APIS_GCM_ENGINE_REGISTRATION_REQUEST_H_ | 6 #define GOOGLE_APIS_GCM_ENGINE_REGISTRATION_REQUEST_H_ |
| 7 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 8 #include <map> | 10 #include <map> |
| 9 #include <string> | 11 #include <string> |
| 10 #include <vector> | 12 #include <vector> |
| 11 | 13 |
| 12 #include "base/basictypes.h" | |
| 13 #include "base/callback.h" | 14 #include "base/callback.h" |
| 15 #include "base/macros.h" |
| 14 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
| 17 #include "base/time/time.h" | 19 #include "base/time/time.h" |
| 18 #include "google_apis/gcm/base/gcm_export.h" | 20 #include "google_apis/gcm/base/gcm_export.h" |
| 19 #include "net/base/backoff_entry.h" | 21 #include "net/base/backoff_entry.h" |
| 20 #include "net/url_request/url_fetcher_delegate.h" | 22 #include "net/url_request/url_fetcher_delegate.h" |
| 21 #include "url/gurl.h" | 23 #include "url/gurl.h" |
| 22 | 24 |
| 23 namespace net { | 25 namespace net { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 }; | 58 }; |
| 57 | 59 |
| 58 // Callback completing the registration request. | 60 // Callback completing the registration request. |
| 59 typedef base::Callback<void(Status status, | 61 typedef base::Callback<void(Status status, |
| 60 const std::string& registration_id)> | 62 const std::string& registration_id)> |
| 61 RegistrationCallback; | 63 RegistrationCallback; |
| 62 | 64 |
| 63 // Defines the common info about a registration/token request. All parameters | 65 // Defines the common info about a registration/token request. All parameters |
| 64 // are mandatory. | 66 // are mandatory. |
| 65 struct GCM_EXPORT RequestInfo { | 67 struct GCM_EXPORT RequestInfo { |
| 66 RequestInfo(uint64 android_id, | 68 RequestInfo(uint64_t android_id, |
| 67 uint64 security_token, | 69 uint64_t security_token, |
| 68 const std::string& app_id); | 70 const std::string& app_id); |
| 69 ~RequestInfo(); | 71 ~RequestInfo(); |
| 70 | 72 |
| 71 // Android ID of the device. | 73 // Android ID of the device. |
| 72 uint64 android_id; | 74 uint64_t android_id; |
| 73 // Security token of the device. | 75 // Security token of the device. |
| 74 uint64 security_token; | 76 uint64_t security_token; |
| 75 // Application ID. | 77 // Application ID. |
| 76 std::string app_id; | 78 std::string app_id; |
| 77 }; | 79 }; |
| 78 | 80 |
| 79 // Encapsulates the custom logic that is needed to build and process the | 81 // Encapsulates the custom logic that is needed to build and process the |
| 80 // registration request. | 82 // registration request. |
| 81 class GCM_EXPORT CustomRequestHandler { | 83 class GCM_EXPORT CustomRequestHandler { |
| 82 public: | 84 public: |
| 83 CustomRequestHandler(); | 85 CustomRequestHandler(); |
| 84 virtual ~CustomRequestHandler(); | 86 virtual ~CustomRequestHandler(); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 std::string source_to_record_; | 140 std::string source_to_record_; |
| 139 | 141 |
| 140 base::WeakPtrFactory<RegistrationRequest> weak_ptr_factory_; | 142 base::WeakPtrFactory<RegistrationRequest> weak_ptr_factory_; |
| 141 | 143 |
| 142 DISALLOW_COPY_AND_ASSIGN(RegistrationRequest); | 144 DISALLOW_COPY_AND_ASSIGN(RegistrationRequest); |
| 143 }; | 145 }; |
| 144 | 146 |
| 145 } // namespace gcm | 147 } // namespace gcm |
| 146 | 148 |
| 147 #endif // GOOGLE_APIS_GCM_ENGINE_REGISTRATION_REQUEST_H_ | 149 #endif // GOOGLE_APIS_GCM_ENGINE_REGISTRATION_REQUEST_H_ |
| OLD | NEW |