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> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 // the end. | 42 // the end. |
43 enum Status { | 43 enum Status { |
44 SUCCESS, // Registration completed successfully. | 44 SUCCESS, // Registration completed successfully. |
45 INVALID_PARAMETERS, // One of request paramteres was invalid. | 45 INVALID_PARAMETERS, // One of request paramteres was invalid. |
46 INVALID_SENDER, // One of the provided senders was invalid. | 46 INVALID_SENDER, // One of the provided senders was invalid. |
47 AUTHENTICATION_FAILED, // Authentication failed. | 47 AUTHENTICATION_FAILED, // Authentication failed. |
48 DEVICE_REGISTRATION_ERROR, // Chrome is not properly registered. | 48 DEVICE_REGISTRATION_ERROR, // Chrome is not properly registered. |
49 UNKNOWN_ERROR, // Unknown error. | 49 UNKNOWN_ERROR, // Unknown error. |
50 URL_FETCHING_FAILED, // URL fetching failed. | 50 URL_FETCHING_FAILED, // URL fetching failed. |
51 HTTP_NOT_OK, // HTTP status was not OK. | 51 HTTP_NOT_OK, // HTTP status was not OK. |
52 RESPONSE_PARSING_FAILED, // Registration response parsing failed. | 52 NO_RESPONSE_BODY, // No response body. |
53 REACHED_MAX_RETRIES, // Reached maximum number of retries. | 53 REACHED_MAX_RETRIES, // Reached maximum number of retries. |
54 // NOTE: always keep this entry at the end. Add new status types only | 54 // NOTE: always keep this entry at the end. Add new status types only |
55 // immediately above this line. Make sure to update the corresponding | 55 // immediately above this line. Make sure to update the corresponding |
56 // histogram enum accordingly. | 56 // histogram enum accordingly. |
57 STATUS_COUNT | 57 STATUS_COUNT |
58 }; | 58 }; |
59 | 59 |
60 // Callback completing the registration request. | 60 // Callback completing the registration request. |
61 typedef base::Callback<void(Status status, | 61 typedef base::Callback<void(Status status, |
62 const std::string& registration_id)> | 62 const std::string& registration_id)> |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 std::string source_to_record_; | 149 std::string source_to_record_; |
150 | 150 |
151 base::WeakPtrFactory<RegistrationRequest> weak_ptr_factory_; | 151 base::WeakPtrFactory<RegistrationRequest> weak_ptr_factory_; |
152 | 152 |
153 DISALLOW_COPY_AND_ASSIGN(RegistrationRequest); | 153 DISALLOW_COPY_AND_ASSIGN(RegistrationRequest); |
154 }; | 154 }; |
155 | 155 |
156 } // namespace gcm | 156 } // namespace gcm |
157 | 157 |
158 #endif // GOOGLE_APIS_GCM_ENGINE_REGISTRATION_REQUEST_H_ | 158 #endif // GOOGLE_APIS_GCM_ENGINE_REGISTRATION_REQUEST_H_ |
OLD | NEW |