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_core.h" | 5 #include "content/common/net/url_fetcher_core.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_util_proxy.h" | 8 #include "base/file_util_proxy.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
13 #include "base/tracked_objects.h" | 13 #include "base/tracked_objects.h" |
14 #include "content/public/common/url_fetcher_delegate.h" | |
15 #include "net/base/io_buffer.h" | 14 #include "net/base/io_buffer.h" |
16 #include "net/base/load_flags.h" | 15 #include "net/base/load_flags.h" |
17 #include "net/base/net_errors.h" | 16 #include "net/base/net_errors.h" |
18 #include "net/http/http_response_headers.h" | 17 #include "net/http/http_response_headers.h" |
| 18 #include "net/url_request/url_fetcher_delegate.h" |
19 #include "net/url_request/url_request_context.h" | 19 #include "net/url_request/url_request_context.h" |
20 #include "net/url_request/url_request_context_getter.h" | 20 #include "net/url_request/url_request_context_getter.h" |
21 #include "net/url_request/url_request_throttler_manager.h" | 21 #include "net/url_request/url_request_throttler_manager.h" |
22 | 22 |
23 namespace content { | 23 namespace content { |
24 | 24 |
25 static const int kBufferSize = 4096; | 25 static const int kBufferSize = 4096; |
26 static const int kUploadProgressTimerInterval = 100; | 26 static const int kUploadProgressTimerInterval = 100; |
27 | 27 |
28 URLFetcherCore::Registry::Registry() {} | 28 URLFetcherCore::Registry::Registry() {} |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 base::FileUtilProxy::StatusCallback()); // No callback: Ignore errors. | 238 base::FileUtilProxy::StatusCallback()); // No callback: Ignore errors. |
239 DisownFile(); | 239 DisownFile(); |
240 } | 240 } |
241 } | 241 } |
242 | 242 |
243 static bool g_interception_enabled = false; | 243 static bool g_interception_enabled = false; |
244 | 244 |
245 URLFetcherCore::URLFetcherCore(URLFetcher* fetcher, | 245 URLFetcherCore::URLFetcherCore(URLFetcher* fetcher, |
246 const GURL& original_url, | 246 const GURL& original_url, |
247 URLFetcher::RequestType request_type, | 247 URLFetcher::RequestType request_type, |
248 content::URLFetcherDelegate* d) | 248 net::URLFetcherDelegate* d) |
249 : fetcher_(fetcher), | 249 : fetcher_(fetcher), |
250 original_url_(original_url), | 250 original_url_(original_url), |
251 request_type_(request_type), | 251 request_type_(request_type), |
252 delegate_(d), | 252 delegate_(d), |
253 delegate_loop_proxy_( | 253 delegate_loop_proxy_( |
254 base::MessageLoopProxy::current()), | 254 base::MessageLoopProxy::current()), |
255 request_(NULL), | 255 request_(NULL), |
256 load_flags_(net::LOAD_NORMAL), | 256 load_flags_(net::LOAD_NORMAL), |
257 response_code_(URLFetcher::RESPONSE_CODE_INVALID), | 257 response_code_(URLFetcher::RESPONSE_CODE_INVALID), |
258 buffer_(new net::IOBuffer(kBufferSize)), | 258 buffer_(new net::IOBuffer(kBufferSize)), |
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
960 } | 960 } |
961 | 961 |
962 return original_url_backoff > destination_url_backoff ? | 962 return original_url_backoff > destination_url_backoff ? |
963 original_url_backoff : destination_url_backoff; | 963 original_url_backoff : destination_url_backoff; |
964 } else { | 964 } else { |
965 return base::TimeTicks(); | 965 return base::TimeTicks(); |
966 } | 966 } |
967 } | 967 } |
968 | 968 |
969 } // namespace content | 969 } // namespace content |
OLD | NEW |