| 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> | 7 #include <stddef.h> |
| 8 #include <utility> |
| 8 | 9 |
| 9 #include "base/bind.h" | 10 #include "base/bind.h" |
| 10 #include "base/location.h" | 11 #include "base/location.h" |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
| 13 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
| 14 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
| 15 #include "base/thread_task_runner_handle.h" | 16 #include "base/thread_task_runner_handle.h" |
| 16 #include "base/values.h" | 17 #include "base/values.h" |
| 17 #include "google_apis/gcm/base/gcm_util.h" | 18 #include "google_apis/gcm/base/gcm_util.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 const RequestInfo& request_info, | 92 const RequestInfo& request_info, |
| 92 scoped_ptr<CustomRequestHandler> custom_request_handler, | 93 scoped_ptr<CustomRequestHandler> custom_request_handler, |
| 93 const net::BackoffEntry::Policy& backoff_policy, | 94 const net::BackoffEntry::Policy& backoff_policy, |
| 94 const RegistrationCallback& callback, | 95 const RegistrationCallback& callback, |
| 95 int max_retry_count, | 96 int max_retry_count, |
| 96 scoped_refptr<net::URLRequestContextGetter> request_context_getter, | 97 scoped_refptr<net::URLRequestContextGetter> request_context_getter, |
| 97 GCMStatsRecorder* recorder, | 98 GCMStatsRecorder* recorder, |
| 98 const std::string& source_to_record) | 99 const std::string& source_to_record) |
| 99 : callback_(callback), | 100 : callback_(callback), |
| 100 request_info_(request_info), | 101 request_info_(request_info), |
| 101 custom_request_handler_(custom_request_handler.Pass()), | 102 custom_request_handler_(std::move(custom_request_handler)), |
| 102 registration_url_(registration_url), | 103 registration_url_(registration_url), |
| 103 backoff_entry_(&backoff_policy), | 104 backoff_entry_(&backoff_policy), |
| 104 request_context_getter_(request_context_getter), | 105 request_context_getter_(request_context_getter), |
| 105 retries_left_(max_retry_count), | 106 retries_left_(max_retry_count), |
| 106 recorder_(recorder), | 107 recorder_(recorder), |
| 107 source_to_record_(source_to_record), | 108 source_to_record_(source_to_record), |
| 108 weak_ptr_factory_(this) { | 109 weak_ptr_factory_(this) { |
| 109 DCHECK_GE(max_retry_count, 0); | 110 DCHECK_GE(max_retry_count, 0); |
| 110 } | 111 } |
| 111 | 112 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 // Only REACHED_MAX_RETRIES is reported because the function will skip | 249 // Only REACHED_MAX_RETRIES is reported because the function will skip |
| 249 // reporting count and time when status is not SUCCESS. | 250 // reporting count and time when status is not SUCCESS. |
| 250 DCHECK(custom_request_handler_.get()); | 251 DCHECK(custom_request_handler_.get()); |
| 251 custom_request_handler_->ReportUMAs(status, 0, base::TimeDelta()); | 252 custom_request_handler_->ReportUMAs(status, 0, base::TimeDelta()); |
| 252 } | 253 } |
| 253 | 254 |
| 254 callback_.Run(status, token); | 255 callback_.Run(status, token); |
| 255 } | 256 } |
| 256 | 257 |
| 257 } // namespace gcm | 258 } // namespace gcm |
| OLD | NEW |