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 "components/domain_reliability/uploader.h" | 5 #include "components/domain_reliability/uploader.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/metrics/sparse_histogram.h" | 9 #include "base/metrics/sparse_histogram.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 UploadCallbackMap upload_callbacks_; | 157 UploadCallbackMap upload_callbacks_; |
158 bool discard_uploads_; | 158 bool discard_uploads_; |
159 }; | 159 }; |
160 | 160 |
161 } // namespace | 161 } // namespace |
162 | 162 |
163 DomainReliabilityUploader::DomainReliabilityUploader() {} | 163 DomainReliabilityUploader::DomainReliabilityUploader() {} |
164 DomainReliabilityUploader::~DomainReliabilityUploader() {} | 164 DomainReliabilityUploader::~DomainReliabilityUploader() {} |
165 | 165 |
166 // static | 166 // static |
167 scoped_ptr<DomainReliabilityUploader> DomainReliabilityUploader::Create( | 167 std::unique_ptr<DomainReliabilityUploader> DomainReliabilityUploader::Create( |
168 MockableTime* time, | 168 MockableTime* time, |
169 const scoped_refptr<net::URLRequestContextGetter>& | 169 const scoped_refptr<net::URLRequestContextGetter>& |
170 url_request_context_getter) { | 170 url_request_context_getter) { |
171 return scoped_ptr<DomainReliabilityUploader>( | 171 return std::unique_ptr<DomainReliabilityUploader>( |
172 new DomainReliabilityUploaderImpl(time, url_request_context_getter)); | 172 new DomainReliabilityUploaderImpl(time, url_request_context_getter)); |
173 } | 173 } |
174 | 174 |
175 // static | 175 // static |
176 int DomainReliabilityUploader::GetURLRequestUploadDepth( | 176 int DomainReliabilityUploader::GetURLRequestUploadDepth( |
177 const net::URLRequest& request) { | 177 const net::URLRequest& request) { |
178 UploadUserData* data = static_cast<UploadUserData*>( | 178 UploadUserData* data = static_cast<UploadUserData*>( |
179 request.GetUserData(UploadUserData::kUserDataKey)); | 179 request.GetUserData(UploadUserData::kUserDataKey)); |
180 if (!data) | 180 if (!data) |
181 return 0; | 181 return 0; |
182 return data->depth(); | 182 return data->depth(); |
183 } | 183 } |
184 | 184 |
185 } // namespace domain_reliability | 185 } // namespace domain_reliability |
OLD | NEW |