| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
| 12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
| 14 #include "net/base/io_buffer.h" | 14 #include "net/base/io_buffer.h" |
| 15 #include "net/base/net_errors.h" | 15 #include "net/base/net_errors.h" |
| 16 #include "net/http/http_response_headers.h" | 16 #include "net/http/http_response_headers.h" |
| 17 #include "net/url_request/url_request.h" | 17 #include "net/url_request/url_request.h" |
| 18 | 18 |
| 19 namespace net { | 19 namespace net { |
| 20 | 20 |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 typedef std::list<URLRequestTestJob*> URLRequestJobList; | 23 typedef std::list<URLRequestTestJob*> URLRequestJobList; |
| 24 base::LazyInstance<URLRequestJobList, | 24 base::LazyInstance<URLRequestJobList, |
| 25 base::LeakyLazyInstanceTraits<URLRequestJobList> > | 25 base::LeakyLazyInstanceTraits<URLRequestJobList> > |
| 26 g_pending_jobs(base::LINKER_INITIALIZED); | 26 g_pending_jobs = LAZY_INSTANCE_INITIALIZER; |
| 27 | 27 |
| 28 } // namespace | 28 } // namespace |
| 29 | 29 |
| 30 // static getters for known URLs | 30 // static getters for known URLs |
| 31 GURL URLRequestTestJob::test_url_1() { | 31 GURL URLRequestTestJob::test_url_1() { |
| 32 return GURL("test:url1"); | 32 return GURL("test:url1"); |
| 33 } | 33 } |
| 34 GURL URLRequestTestJob::test_url_2() { | 34 GURL URLRequestTestJob::test_url_2() { |
| 35 return GURL("test:url2"); | 35 return GURL("test:url2"); |
| 36 } | 36 } |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 | 282 |
| 283 URLRequestTestJob* next_job(g_pending_jobs.Get().front()); | 283 URLRequestTestJob* next_job(g_pending_jobs.Get().front()); |
| 284 g_pending_jobs.Get().pop_front(); | 284 g_pending_jobs.Get().pop_front(); |
| 285 | 285 |
| 286 DCHECK(!next_job->auto_advance()); // auto_advance jobs should be in this q | 286 DCHECK(!next_job->auto_advance()); // auto_advance jobs should be in this q |
| 287 next_job->ProcessNextOperation(); | 287 next_job->ProcessNextOperation(); |
| 288 return true; | 288 return true; |
| 289 } | 289 } |
| 290 | 290 |
| 291 } // namespace net | 291 } // namespace net |
| OLD | NEW |