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 "net/url_request/url_fetcher_impl.h" | 5 #include "net/url_request/url_fetcher_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/sequenced_task_runner.h" | 10 #include "base/sequenced_task_runner.h" |
11 #include "net/base/upload_data_stream.h" | 11 #include "net/base/upload_data_stream.h" |
12 #include "net/url_request/url_fetcher_core.h" | 12 #include "net/url_request/url_fetcher_core.h" |
13 #include "net/url_request/url_fetcher_factory.h" | 13 #include "net/url_request/url_fetcher_factory.h" |
14 #include "net/url_request/url_fetcher_response_writer.h" | 14 #include "net/url_request/url_fetcher_response_writer.h" |
15 | 15 |
16 namespace net { | 16 namespace net { |
17 | 17 |
18 static URLFetcherFactory* g_factory = NULL; | 18 static URLFetcherFactory* g_factory = NULL; |
19 | 19 |
20 URLFetcherImpl::URLFetcherImpl(const GURL& url, | 20 URLFetcherImpl::URLFetcherImpl( |
21 RequestType request_type, | 21 const GURL& url, |
22 URLFetcherDelegate* d) | 22 RequestType request_type, |
23 : core_(new URLFetcherCore(this, url, request_type, d)) { | 23 URLFetcherDelegate* d, |
24 } | 24 net::NetworkTrafficAnnotationTag traffic_annotation) |
| 25 : core_( |
| 26 new URLFetcherCore(this, url, request_type, d, traffic_annotation)) {} |
25 | 27 |
26 URLFetcherImpl::~URLFetcherImpl() { | 28 URLFetcherImpl::~URLFetcherImpl() { |
27 core_->Stop(); | 29 core_->Stop(); |
28 } | 30 } |
29 | 31 |
30 void URLFetcherImpl::SetUploadData(const std::string& upload_content_type, | 32 void URLFetcherImpl::SetUploadData(const std::string& upload_content_type, |
31 const std::string& upload_content) { | 33 const std::string& upload_content) { |
32 core_->SetUploadData(upload_content_type, upload_content); | 34 core_->SetUploadData(upload_content_type, upload_content); |
33 } | 35 } |
34 | 36 |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 URLFetcherFactory* URLFetcherImpl::factory() { | 228 URLFetcherFactory* URLFetcherImpl::factory() { |
227 return g_factory; | 229 return g_factory; |
228 } | 230 } |
229 | 231 |
230 // static | 232 // static |
231 void URLFetcherImpl::set_factory(URLFetcherFactory* factory) { | 233 void URLFetcherImpl::set_factory(URLFetcherFactory* factory) { |
232 g_factory = factory; | 234 g_factory = factory; |
233 } | 235 } |
234 | 236 |
235 } // namespace net | 237 } // namespace net |
OLD | NEW |