| OLD | NEW |
| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 std::string URLRequestTestJob::test_error_headers() { | 107 std::string URLRequestTestJob::test_error_headers() { |
| 108 static const char kHeaders[] = | 108 static const char kHeaders[] = |
| 109 "HTTP/1.1 500 BOO HOO\n" | 109 "HTTP/1.1 500 BOO HOO\n" |
| 110 "\n"; | 110 "\n"; |
| 111 return std::string(kHeaders, arraysize(kHeaders)); | 111 return std::string(kHeaders, arraysize(kHeaders)); |
| 112 } | 112 } |
| 113 | 113 |
| 114 // static | 114 // static |
| 115 std::unique_ptr<URLRequestJobFactory::ProtocolHandler> | 115 std::unique_ptr<URLRequestJobFactory::ProtocolHandler> |
| 116 URLRequestTestJob::CreateProtocolHandler() { | 116 URLRequestTestJob::CreateProtocolHandler() { |
| 117 return base::WrapUnique(new TestJobProtocolHandler()); | 117 return base::MakeUnique<TestJobProtocolHandler>(); |
| 118 } | 118 } |
| 119 | 119 |
| 120 URLRequestTestJob::URLRequestTestJob(URLRequest* request, | 120 URLRequestTestJob::URLRequestTestJob(URLRequest* request, |
| 121 NetworkDelegate* network_delegate) | 121 NetworkDelegate* network_delegate) |
| 122 : URLRequestJob(request, network_delegate), | 122 : URLRequestJob(request, network_delegate), |
| 123 auto_advance_(false), | 123 auto_advance_(false), |
| 124 stage_(WAITING), | 124 stage_(WAITING), |
| 125 priority_(DEFAULT_PRIORITY), | 125 priority_(DEFAULT_PRIORITY), |
| 126 offset_(0), | 126 offset_(0), |
| 127 async_buf_(NULL), | 127 async_buf_(NULL), |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 | 353 |
| 354 URLRequestTestJob* next_job(g_pending_jobs.Get().front()); | 354 URLRequestTestJob* next_job(g_pending_jobs.Get().front()); |
| 355 g_pending_jobs.Get().pop_front(); | 355 g_pending_jobs.Get().pop_front(); |
| 356 | 356 |
| 357 DCHECK(!next_job->auto_advance()); // auto_advance jobs should be in this q | 357 DCHECK(!next_job->auto_advance()); // auto_advance jobs should be in this q |
| 358 next_job->ProcessNextOperation(); | 358 next_job->ProcessNextOperation(); |
| 359 return true; | 359 return true; |
| 360 } | 360 } |
| 361 | 361 |
| 362 } // namespace net | 362 } // namespace net |
| OLD | NEW |