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/common/net/url_fetcher_impl.h" | 5 #include "content/common/net/url_fetcher_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop_proxy.h" | 8 #include "base/message_loop_proxy.h" |
9 #include "content/common/net/url_fetcher_core.h" | 9 #include "content/common/net/url_fetcher_core.h" |
10 #include "content/common/net/url_request_user_data.h" | 10 #include "content/common/net/url_request_user_data.h" |
11 #include "content/public/common/url_fetcher_factory.h" | 11 #include "content/public/common/url_fetcher_factory.h" |
12 | 12 |
13 static content::URLFetcherFactory* g_factory = NULL; | 13 static content::URLFetcherFactory* g_factory = NULL; |
14 | 14 |
15 // static | 15 // static |
16 content::URLFetcher* content::URLFetcher::Create( | 16 net::URLFetcher* content::URLFetcher::Create( |
17 const GURL& url, | 17 const GURL& url, |
18 RequestType request_type, | 18 net::URLFetcher::RequestType request_type, |
19 net::URLFetcherDelegate* d) { | 19 net::URLFetcherDelegate* d) { |
20 return new URLFetcherImpl(url, request_type, d); | 20 return new URLFetcherImpl(url, request_type, d); |
21 } | 21 } |
22 | 22 |
23 // static | 23 // static |
24 content::URLFetcher* content::URLFetcher::Create( | 24 net::URLFetcher* content::URLFetcher::Create( |
25 int id, | 25 int id, |
26 const GURL& url, | 26 const GURL& url, |
27 RequestType request_type, | 27 net::URLFetcher::RequestType request_type, |
28 net::URLFetcherDelegate* d) { | 28 net::URLFetcherDelegate* d) { |
29 return g_factory ? g_factory->CreateURLFetcher(id, url, request_type, d) : | 29 return g_factory ? g_factory->CreateURLFetcher(id, url, request_type, d) : |
30 new URLFetcherImpl(url, request_type, d); | 30 new URLFetcherImpl(url, request_type, d); |
31 } | 31 } |
32 | 32 |
33 // static | 33 // static |
34 void content::URLFetcher::CancelAll() { | 34 void content::URLFetcher::CancelAll() { |
35 URLFetcherImpl::CancelAll(); | 35 URLFetcherImpl::CancelAll(); |
36 } | 36 } |
37 | 37 |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 | 233 |
234 // static | 234 // static |
235 content::URLFetcherFactory* URLFetcherImpl::factory() { | 235 content::URLFetcherFactory* URLFetcherImpl::factory() { |
236 return g_factory; | 236 return g_factory; |
237 } | 237 } |
238 | 238 |
239 // static | 239 // static |
240 void URLFetcherImpl::set_factory(content::URLFetcherFactory* factory) { | 240 void URLFetcherImpl::set_factory(content::URLFetcherFactory* factory) { |
241 g_factory = factory; | 241 g_factory = factory; |
242 } | 242 } |
OLD | NEW |