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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 : URLRequestJob(request, request->context()->network_delegate()), | 100 : URLRequestJob(request, request->context()->network_delegate()), |
101 auto_advance_(auto_advance), | 101 auto_advance_(auto_advance), |
102 stage_(WAITING), | 102 stage_(WAITING), |
103 offset_(0), | 103 offset_(0), |
104 async_buf_(NULL), | 104 async_buf_(NULL), |
105 async_buf_size_(0), | 105 async_buf_size_(0), |
106 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { | 106 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { |
107 } | 107 } |
108 | 108 |
109 URLRequestTestJob::URLRequestTestJob(URLRequest* request, | 109 URLRequestTestJob::URLRequestTestJob(URLRequest* request, |
| 110 NetworkDelegate* network_delegate, |
110 const std::string& response_headers, | 111 const std::string& response_headers, |
111 const std::string& response_data, | 112 const std::string& response_data, |
112 bool auto_advance) | 113 bool auto_advance) |
113 : URLRequestJob(request, request->context()->network_delegate()), | 114 : URLRequestJob(request, network_delegate), |
114 auto_advance_(auto_advance), | 115 auto_advance_(auto_advance), |
115 stage_(WAITING), | 116 stage_(WAITING), |
116 response_headers_(new HttpResponseHeaders(response_headers)), | 117 response_headers_(new HttpResponseHeaders(response_headers)), |
117 response_data_(response_data), | 118 response_data_(response_data), |
118 offset_(0), | 119 offset_(0), |
119 async_buf_(NULL), | 120 async_buf_(NULL), |
120 async_buf_size_(0), | 121 async_buf_size_(0), |
121 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { | 122 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { |
122 } | 123 } |
123 | 124 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 | 293 |
293 URLRequestTestJob* next_job(g_pending_jobs.Get().front()); | 294 URLRequestTestJob* next_job(g_pending_jobs.Get().front()); |
294 g_pending_jobs.Get().pop_front(); | 295 g_pending_jobs.Get().pop_front(); |
295 | 296 |
296 DCHECK(!next_job->auto_advance()); // auto_advance jobs should be in this q | 297 DCHECK(!next_job->auto_advance()); // auto_advance jobs should be in this q |
297 next_job->ProcessNextOperation(); | 298 next_job->ProcessNextOperation(); |
298 return true; | 299 return true; |
299 } | 300 } |
300 | 301 |
301 } // namespace net | 302 } // namespace net |
OLD | NEW |