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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 const RequestInfo& request_info, | 62 const RequestInfo& request_info, |
63 const net::BackoffEntry::Policy& backoff_policy, | 63 const net::BackoffEntry::Policy& backoff_policy, |
64 const CheckinRequestCallback& callback, | 64 const CheckinRequestCallback& callback, |
65 net::URLRequestContextGetter* request_context_getter, | 65 net::URLRequestContextGetter* request_context_getter, |
66 GCMStatsRecorder* recorder); | 66 GCMStatsRecorder* recorder); |
67 virtual ~CheckinRequest(); | 67 virtual ~CheckinRequest(); |
68 | 68 |
69 void Start(); | 69 void Start(); |
70 | 70 |
71 // URLFetcherDelegate implementation. | 71 // URLFetcherDelegate implementation. |
72 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; | 72 virtual void OnURLFetchComplete(const net::URLFetcher* source) override; |
73 | 73 |
74 private: | 74 private: |
75 // Schedules a retry attempt, informs the backoff of a previous request's | 75 // Schedules a retry attempt, informs the backoff of a previous request's |
76 // failure when |update_backoff| is true. | 76 // failure when |update_backoff| is true. |
77 void RetryWithBackoff(bool update_backoff); | 77 void RetryWithBackoff(bool update_backoff); |
78 | 78 |
79 net::URLRequestContextGetter* request_context_getter_; | 79 net::URLRequestContextGetter* request_context_getter_; |
80 CheckinRequestCallback callback_; | 80 CheckinRequestCallback callback_; |
81 | 81 |
82 net::BackoffEntry backoff_entry_; | 82 net::BackoffEntry backoff_entry_; |
83 GURL checkin_url_; | 83 GURL checkin_url_; |
84 scoped_ptr<net::URLFetcher> url_fetcher_; | 84 scoped_ptr<net::URLFetcher> url_fetcher_; |
85 const RequestInfo request_info_; | 85 const RequestInfo request_info_; |
86 base::TimeTicks request_start_time_; | 86 base::TimeTicks request_start_time_; |
87 | 87 |
88 // Recorder that records GCM activities for debugging purpose. Not owned. | 88 // Recorder that records GCM activities for debugging purpose. Not owned. |
89 GCMStatsRecorder* recorder_; | 89 GCMStatsRecorder* recorder_; |
90 | 90 |
91 base::WeakPtrFactory<CheckinRequest> weak_ptr_factory_; | 91 base::WeakPtrFactory<CheckinRequest> weak_ptr_factory_; |
92 | 92 |
93 DISALLOW_COPY_AND_ASSIGN(CheckinRequest); | 93 DISALLOW_COPY_AND_ASSIGN(CheckinRequest); |
94 }; | 94 }; |
95 | 95 |
96 } // namespace gcm | 96 } // namespace gcm |
97 | 97 |
98 #endif // GOOGLE_APIS_GCM_ENGINE_CHECKIN_REQUEST_H_ | 98 #endif // GOOGLE_APIS_GCM_ENGINE_CHECKIN_REQUEST_H_ |
OLD | NEW |