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 "content/public/test/test_url_fetcher_factory.h" | 5 #include "content/public/test/test_url_fetcher_factory.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
13 #include "content/common/net/url_fetcher_impl.h" | |
14 #include "net/base/host_port_pair.h" | 13 #include "net/base/host_port_pair.h" |
15 #include "net/http/http_response_headers.h" | 14 #include "net/http/http_response_headers.h" |
16 #include "net/url_request/url_fetcher_delegate.h" | 15 #include "net/url_request/url_fetcher_delegate.h" |
| 16 #include "net/url_request/url_fetcher_impl.h" |
17 #include "net/url_request/url_request_status.h" | 17 #include "net/url_request/url_request_status.h" |
18 | 18 |
19 ScopedURLFetcherFactory::ScopedURLFetcherFactory( | 19 ScopedURLFetcherFactory::ScopedURLFetcherFactory( |
20 net::URLFetcherFactory* factory) { | 20 net::URLFetcherFactory* factory) { |
21 DCHECK(!URLFetcherImpl::factory()); | 21 DCHECK(!net::URLFetcherImpl::factory()); |
22 URLFetcherImpl::set_factory(factory); | 22 net::URLFetcherImpl::set_factory(factory); |
23 } | 23 } |
24 | 24 |
25 ScopedURLFetcherFactory::~ScopedURLFetcherFactory() { | 25 ScopedURLFetcherFactory::~ScopedURLFetcherFactory() { |
26 DCHECK(URLFetcherImpl::factory()); | 26 DCHECK(net::URLFetcherImpl::factory()); |
27 URLFetcherImpl::set_factory(NULL); | 27 net::URLFetcherImpl::set_factory(NULL); |
28 } | 28 } |
29 | 29 |
30 TestURLFetcher::TestURLFetcher(int id, | 30 TestURLFetcher::TestURLFetcher(int id, |
31 const GURL& url, | 31 const GURL& url, |
32 net::URLFetcherDelegate* d) | 32 net::URLFetcherDelegate* d) |
33 : id_(id), | 33 : id_(id), |
34 original_url_(url), | 34 original_url_(url), |
35 delegate_(d), | 35 delegate_(d), |
36 did_receive_last_chunk_(false), | 36 did_receive_last_chunk_(false), |
37 fake_load_flags_(0), | 37 fake_load_flags_(0), |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 | 331 |
332 URLFetcherImplFactory::URLFetcherImplFactory() {} | 332 URLFetcherImplFactory::URLFetcherImplFactory() {} |
333 | 333 |
334 URLFetcherImplFactory::~URLFetcherImplFactory() {} | 334 URLFetcherImplFactory::~URLFetcherImplFactory() {} |
335 | 335 |
336 net::URLFetcher* URLFetcherImplFactory::CreateURLFetcher( | 336 net::URLFetcher* URLFetcherImplFactory::CreateURLFetcher( |
337 int id, | 337 int id, |
338 const GURL& url, | 338 const GURL& url, |
339 net::URLFetcher::RequestType request_type, | 339 net::URLFetcher::RequestType request_type, |
340 net::URLFetcherDelegate* d) { | 340 net::URLFetcherDelegate* d) { |
341 return new URLFetcherImpl(url, request_type, d); | 341 return new net::URLFetcherImpl(url, request_type, d); |
342 } | 342 } |
OLD | NEW |