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