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 virtual ~CustomRequestHandler(); | 79 virtual ~CustomRequestHandler(); |
80 | 80 |
81 // Builds the HTTP request body data. It is called after | 81 // Builds the HTTP request body data. It is called after |
82 // UnregistrationRequest::BuildRequestBody to append more custom info to | 82 // UnregistrationRequest::BuildRequestBody to append more custom info to |
83 // |body|. Note that the request body is encoded in HTTP form format. | 83 // |body|. Note that the request body is encoded in HTTP form format. |
84 virtual void BuildRequestBody(std::string* body) = 0; | 84 virtual void BuildRequestBody(std::string* body) = 0; |
85 | 85 |
86 // Parses the HTTP response. It is called after | 86 // Parses the HTTP response. It is called after |
87 // UnregistrationRequest::ParseResponse to proceed the parsing. | 87 // UnregistrationRequest::ParseResponse to proceed the parsing. |
88 virtual Status ParseResponse(const net::URLFetcher* source) = 0; | 88 virtual Status ParseResponse(const net::URLFetcher* source) = 0; |
| 89 |
| 90 // Reports various UMAs, including status, retry count and completion time. |
| 91 virtual void ReportUMAs(Status status, |
| 92 int retry_count, |
| 93 base::TimeDelta complete_time) = 0; |
89 }; | 94 }; |
90 | 95 |
91 // Creates an instance of UnregistrationRequest. |callback| will be called | 96 // Creates an instance of UnregistrationRequest. |callback| will be called |
92 // once registration has been revoked or there has been an error that makes | 97 // once registration has been revoked or there has been an error that makes |
93 // further retries pointless. | 98 // further retries pointless. |
94 UnregistrationRequest( | 99 UnregistrationRequest( |
95 const GURL& registration_url, | 100 const GURL& registration_url, |
96 const RequestInfo& request_info, | 101 const RequestInfo& request_info, |
97 scoped_ptr<CustomRequestHandler> custom_request_handler, | 102 scoped_ptr<CustomRequestHandler> custom_request_handler, |
98 const net::BackoffEntry::Policy& backoff_policy, | 103 const net::BackoffEntry::Policy& backoff_policy, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 GCMStatsRecorder* recorder_; | 135 GCMStatsRecorder* recorder_; |
131 | 136 |
132 base::WeakPtrFactory<UnregistrationRequest> weak_ptr_factory_; | 137 base::WeakPtrFactory<UnregistrationRequest> weak_ptr_factory_; |
133 | 138 |
134 DISALLOW_COPY_AND_ASSIGN(UnregistrationRequest); | 139 DISALLOW_COPY_AND_ASSIGN(UnregistrationRequest); |
135 }; | 140 }; |
136 | 141 |
137 } // namespace gcm | 142 } // namespace gcm |
138 | 143 |
139 #endif // GOOGLE_APIS_GCM_ENGINE_UNREGISTRATION_REQUEST_H_ | 144 #endif // GOOGLE_APIS_GCM_ENGINE_UNREGISTRATION_REQUEST_H_ |
OLD | NEW |