| 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 #include "google_apis/gcm/engine/registration_request.h" | 5 #include "google_apis/gcm/engine/registration_request.h" |
| 6 | 6 |
| 7 #include <stddef.h> |
| 8 |
| 7 #include "base/bind.h" | 9 #include "base/bind.h" |
| 8 #include "base/location.h" | 10 #include "base/location.h" |
| 11 #include "base/macros.h" |
| 9 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 10 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
| 11 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
| 12 #include "base/thread_task_runner_handle.h" | 15 #include "base/thread_task_runner_handle.h" |
| 13 #include "base/values.h" | 16 #include "base/values.h" |
| 14 #include "google_apis/gcm/base/gcm_util.h" | 17 #include "google_apis/gcm/base/gcm_util.h" |
| 15 #include "google_apis/gcm/monitoring/gcm_stats_recorder.h" | 18 #include "google_apis/gcm/monitoring/gcm_stats_recorder.h" |
| 16 #include "net/base/load_flags.h" | 19 #include "net/base/load_flags.h" |
| 17 #include "net/http/http_request_headers.h" | 20 #include "net/http/http_request_headers.h" |
| 18 #include "net/http/http_status_code.h" | 21 #include "net/http/http_status_code.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 return status == RegistrationRequest::UNKNOWN_ERROR || | 65 return status == RegistrationRequest::UNKNOWN_ERROR || |
| 63 status == RegistrationRequest::AUTHENTICATION_FAILED || | 66 status == RegistrationRequest::AUTHENTICATION_FAILED || |
| 64 status == RegistrationRequest::DEVICE_REGISTRATION_ERROR || | 67 status == RegistrationRequest::DEVICE_REGISTRATION_ERROR || |
| 65 status == RegistrationRequest::HTTP_NOT_OK || | 68 status == RegistrationRequest::HTTP_NOT_OK || |
| 66 status == RegistrationRequest::URL_FETCHING_FAILED || | 69 status == RegistrationRequest::URL_FETCHING_FAILED || |
| 67 status == RegistrationRequest::RESPONSE_PARSING_FAILED; | 70 status == RegistrationRequest::RESPONSE_PARSING_FAILED; |
| 68 } | 71 } |
| 69 | 72 |
| 70 } // namespace | 73 } // namespace |
| 71 | 74 |
| 72 RegistrationRequest::RequestInfo::RequestInfo( | 75 RegistrationRequest::RequestInfo::RequestInfo(uint64_t android_id, |
| 73 uint64 android_id, | 76 uint64_t security_token, |
| 74 uint64 security_token, | 77 const std::string& app_id) |
| 75 const std::string& app_id) | 78 : android_id(android_id), security_token(security_token), app_id(app_id) { |
| 76 : android_id(android_id), | |
| 77 security_token(security_token), | |
| 78 app_id(app_id) { | |
| 79 DCHECK(android_id != 0UL); | 79 DCHECK(android_id != 0UL); |
| 80 DCHECK(security_token != 0UL); | 80 DCHECK(security_token != 0UL); |
| 81 } | 81 } |
| 82 | 82 |
| 83 RegistrationRequest::RequestInfo::~RequestInfo() {} | 83 RegistrationRequest::RequestInfo::~RequestInfo() {} |
| 84 | 84 |
| 85 RegistrationRequest::CustomRequestHandler::CustomRequestHandler() {} | 85 RegistrationRequest::CustomRequestHandler::CustomRequestHandler() {} |
| 86 | 86 |
| 87 RegistrationRequest::CustomRequestHandler::~CustomRequestHandler() {} | 87 RegistrationRequest::CustomRequestHandler::~CustomRequestHandler() {} |
| 88 | 88 |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 // Only REACHED_MAX_RETRIES is reported because the function will skip | 248 // Only REACHED_MAX_RETRIES is reported because the function will skip |
| 249 // reporting count and time when status is not SUCCESS. | 249 // reporting count and time when status is not SUCCESS. |
| 250 DCHECK(custom_request_handler_.get()); | 250 DCHECK(custom_request_handler_.get()); |
| 251 custom_request_handler_->ReportUMAs(status, 0, base::TimeDelta()); | 251 custom_request_handler_->ReportUMAs(status, 0, base::TimeDelta()); |
| 252 } | 252 } |
| 253 | 253 |
| 254 callback_.Run(status, token); | 254 callback_.Run(status, token); |
| 255 } | 255 } |
| 256 | 256 |
| 257 } // namespace gcm | 257 } // namespace gcm |
| OLD | NEW |