| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "net/url_request/url_request_test_job.h" | 7 #include "net/url_request/url_request_test_job.h" |
| 8 | 8 |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| 11 #include "net/base/io_buffer.h" |
| 11 #include "net/base/net_errors.h" | 12 #include "net/base/net_errors.h" |
| 12 #include "net/http/http_response_headers.h" | 13 #include "net/http/http_response_headers.h" |
| 13 #include "net/url_request/url_request.h" | 14 #include "net/url_request/url_request.h" |
| 14 | 15 |
| 15 // This emulates the global message loop for the test URL request class, since | 16 // This emulates the global message loop for the test URL request class, since |
| 16 // this is only test code, it's probably not too dangerous to have this static | 17 // this is only test code, it's probably not too dangerous to have this static |
| 17 // object. | 18 // object. |
| 18 static std::vector< scoped_refptr<URLRequestTestJob> > pending_jobs; | 19 static std::vector< scoped_refptr<URLRequestTestJob> > pending_jobs; |
| 19 | 20 |
| 20 // static getters for known URLs | 21 // static getters for known URLs |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 if (pending_jobs.empty()) | 245 if (pending_jobs.empty()) |
| 245 return false; | 246 return false; |
| 246 | 247 |
| 247 scoped_refptr<URLRequestTestJob> next_job(pending_jobs[0]); | 248 scoped_refptr<URLRequestTestJob> next_job(pending_jobs[0]); |
| 248 pending_jobs.erase(pending_jobs.begin()); | 249 pending_jobs.erase(pending_jobs.begin()); |
| 249 | 250 |
| 250 DCHECK(!next_job->auto_advance()); // auto_advance jobs should be in this q | 251 DCHECK(!next_job->auto_advance()); // auto_advance jobs should be in this q |
| 251 next_job->ProcessNextOperation(); | 252 next_job->ProcessNextOperation(); |
| 252 return true; | 253 return true; |
| 253 } | 254 } |
| OLD | NEW |