Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Side by Side Diff: net/url_request/url_request_test_job.cc

Issue 2835533002: Remove URLRequestJob::GetResponseCode implementations (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/url_request/url_request_test_job.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "net/url_request/url_request_test_job.h" 5 #include "net/url_request/url_request_test_job.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <list> 8 #include <list>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 LoadTimingInfo* load_timing_info) const { 289 LoadTimingInfo* load_timing_info) const {
290 // Preserve the times the URLRequest is responsible for, but overwrite all 290 // Preserve the times the URLRequest is responsible for, but overwrite all
291 // the others. 291 // the others.
292 base::TimeTicks request_start = load_timing_info->request_start; 292 base::TimeTicks request_start = load_timing_info->request_start;
293 base::Time request_start_time = load_timing_info->request_start_time; 293 base::Time request_start_time = load_timing_info->request_start_time;
294 *load_timing_info = load_timing_info_; 294 *load_timing_info = load_timing_info_;
295 load_timing_info->request_start = request_start; 295 load_timing_info->request_start = request_start;
296 load_timing_info->request_start_time = request_start_time; 296 load_timing_info->request_start_time = request_start_time;
297 } 297 }
298 298
299 int URLRequestTestJob::GetResponseCode() const {
300 if (response_headers_.get())
301 return response_headers_->response_code();
302 return -1;
303 }
304
305 int64_t URLRequestTestJob::GetTotalReceivedBytes() const { 299 int64_t URLRequestTestJob::GetTotalReceivedBytes() const {
306 return response_headers_length_ + offset_; 300 return response_headers_length_ + offset_;
307 } 301 }
308 302
309 bool URLRequestTestJob::IsRedirectResponse(GURL* location, 303 bool URLRequestTestJob::IsRedirectResponse(GURL* location,
310 int* http_status_code) { 304 int* http_status_code) {
311 if (!response_headers_.get()) 305 if (!response_headers_.get())
312 return false; 306 return false;
313 307
314 std::string value; 308 std::string value;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 380
387 URLRequestTestJob* next_job(g_pending_jobs.Get().front()); 381 URLRequestTestJob* next_job(g_pending_jobs.Get().front());
388 g_pending_jobs.Get().pop_front(); 382 g_pending_jobs.Get().pop_front();
389 383
390 DCHECK(!next_job->auto_advance()); // auto_advance jobs should be in this q 384 DCHECK(!next_job->auto_advance()); // auto_advance jobs should be in this q
391 next_job->ProcessNextOperation(); 385 next_job->ProcessNextOperation();
392 return true; 386 return true;
393 } 387 }
394 388
395 } // namespace net 389 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_test_job.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698