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_UNREGISTRATION_REQUEST_H_ | 5 #ifndef GOOGLE_APIS_GCM_ENGINE_UNREGISTRATION_REQUEST_H_ |
6 #define GOOGLE_APIS_GCM_ENGINE_UNREGISTRATION_REQUEST_H_ | 6 #define GOOGLE_APIS_GCM_ENGINE_UNREGISTRATION_REQUEST_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 const net::BackoffEntry::Policy& backoff_policy, | 79 const net::BackoffEntry::Policy& backoff_policy, |
80 const UnregistrationCallback& callback, | 80 const UnregistrationCallback& callback, |
81 scoped_refptr<net::URLRequestContextGetter> request_context_getter, | 81 scoped_refptr<net::URLRequestContextGetter> request_context_getter, |
82 GCMStatsRecorder* recorder); | 82 GCMStatsRecorder* recorder); |
83 virtual ~UnregistrationRequest(); | 83 virtual ~UnregistrationRequest(); |
84 | 84 |
85 // Starts an unregistration request. | 85 // Starts an unregistration request. |
86 void Start(); | 86 void Start(); |
87 | 87 |
88 // URLFetcherDelegate implementation. | 88 // URLFetcherDelegate implementation. |
89 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; | 89 virtual void OnURLFetchComplete(const net::URLFetcher* source) override; |
90 | 90 |
91 private: | 91 private: |
92 // Schedules a retry attempt and informs the backoff of previous request's | 92 // Schedules a retry attempt and informs the backoff of previous request's |
93 // failure, when |update_backoff| is true. | 93 // failure, when |update_backoff| is true. |
94 void RetryWithBackoff(bool update_backoff); | 94 void RetryWithBackoff(bool update_backoff); |
95 | 95 |
96 UnregistrationCallback callback_; | 96 UnregistrationCallback callback_; |
97 RequestInfo request_info_; | 97 RequestInfo request_info_; |
98 GURL registration_url_; | 98 GURL registration_url_; |
99 | 99 |
100 net::BackoffEntry backoff_entry_; | 100 net::BackoffEntry backoff_entry_; |
101 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; | 101 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; |
102 scoped_ptr<net::URLFetcher> url_fetcher_; | 102 scoped_ptr<net::URLFetcher> url_fetcher_; |
103 base::TimeTicks request_start_time_; | 103 base::TimeTicks request_start_time_; |
104 | 104 |
105 // Recorder that records GCM activities for debugging purpose. Not owned. | 105 // Recorder that records GCM activities for debugging purpose. Not owned. |
106 GCMStatsRecorder* recorder_; | 106 GCMStatsRecorder* recorder_; |
107 | 107 |
108 base::WeakPtrFactory<UnregistrationRequest> weak_ptr_factory_; | 108 base::WeakPtrFactory<UnregistrationRequest> weak_ptr_factory_; |
109 | 109 |
110 DISALLOW_COPY_AND_ASSIGN(UnregistrationRequest); | 110 DISALLOW_COPY_AND_ASSIGN(UnregistrationRequest); |
111 }; | 111 }; |
112 | 112 |
113 } // namespace gcm | 113 } // namespace gcm |
114 | 114 |
115 #endif // GOOGLE_APIS_GCM_ENGINE_UNREGISTRATION_REQUEST_H_ | 115 #endif // GOOGLE_APIS_GCM_ENGINE_UNREGISTRATION_REQUEST_H_ |
OLD | NEW |