| 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 #ifndef CONTENT_COMMON_NET_URL_FETCHER_CORE_H_ | 5 #ifndef CONTENT_COMMON_NET_URL_FETCHER_CORE_H_ |
| 6 #define CONTENT_COMMON_NET_URL_FETCHER_CORE_H_ | 6 #define CONTENT_COMMON_NET_URL_FETCHER_CORE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 bool was_fetched_via_proxy_; | 331 bool was_fetched_via_proxy_; |
| 332 net::HostPortPair socket_address_; | 332 net::HostPortPair socket_address_; |
| 333 | 333 |
| 334 std::string upload_content_; // HTTP POST payload | 334 std::string upload_content_; // HTTP POST payload |
| 335 std::string upload_content_type_; // MIME type of POST payload | 335 std::string upload_content_type_; // MIME type of POST payload |
| 336 std::string referrer_; // HTTP Referer header value | 336 std::string referrer_; // HTTP Referer header value |
| 337 bool is_chunked_upload_; // True if using chunked transfer encoding | 337 bool is_chunked_upload_; // True if using chunked transfer encoding |
| 338 | 338 |
| 339 // Used to determine how long to wait before making a request or doing a | 339 // Used to determine how long to wait before making a request or doing a |
| 340 // retry. | 340 // retry. |
| 341 // |
| 341 // Both of them can only be accessed on the IO thread. | 342 // Both of them can only be accessed on the IO thread. |
| 342 // We need not only the throttler entry for |original_URL|, but also the one | 343 // |
| 343 // for |url|. For example, consider the case that URL A redirects to URL B, | 344 // We need not only the throttler entry for |original_URL|, but also |
| 344 // for which the server returns a 500 response. In this case, the exponential | 345 // the one for |url|. For example, consider the case that URL A |
| 345 // back-off release time of URL A won't increase. If we retry without | 346 // redirects to URL B, for which the server returns a 500 |
| 346 // considering the back-off constraint of URL B, we may send out too many | 347 // response. In this case, the exponential back-off release time of |
| 347 // requests for URL A in a short period of time. | 348 // URL A won't increase. If we retry without considering the |
| 349 // back-off constraint of URL B, we may send out too many requests |
| 350 // for URL A in a short period of time. |
| 351 // |
| 352 // Both of these will be NULL if |
| 353 // URLRequestContext::throttler_manager() is NULL. |
| 348 scoped_refptr<net::URLRequestThrottlerEntryInterface> | 354 scoped_refptr<net::URLRequestThrottlerEntryInterface> |
| 349 original_url_throttler_entry_; | 355 original_url_throttler_entry_; |
| 350 scoped_refptr<net::URLRequestThrottlerEntryInterface> url_throttler_entry_; | 356 scoped_refptr<net::URLRequestThrottlerEntryInterface> url_throttler_entry_; |
| 351 | 357 |
| 352 // |num_retries_| indicates how many times we've failed to successfully | 358 // |num_retries_| indicates how many times we've failed to successfully |
| 353 // fetch this URL. Once this value exceeds the maximum number of retries | 359 // fetch this URL. Once this value exceeds the maximum number of retries |
| 354 // specified by the owner URLFetcher instance, we'll give up. | 360 // specified by the owner URLFetcher instance, we'll give up. |
| 355 int num_retries_; | 361 int num_retries_; |
| 356 | 362 |
| 357 // True if the URLFetcher has been cancelled. | 363 // True if the URLFetcher has been cancelled. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 int64 total_response_bytes_; | 395 int64 total_response_bytes_; |
| 390 | 396 |
| 391 static base::LazyInstance<Registry> g_registry; | 397 static base::LazyInstance<Registry> g_registry; |
| 392 | 398 |
| 393 DISALLOW_COPY_AND_ASSIGN(URLFetcherCore); | 399 DISALLOW_COPY_AND_ASSIGN(URLFetcherCore); |
| 394 }; | 400 }; |
| 395 | 401 |
| 396 } // namespace content | 402 } // namespace content |
| 397 | 403 |
| 398 #endif // CONTENT_COMMON_NET_URL_FETCHER_CORE_H_ | 404 #endif // CONTENT_COMMON_NET_URL_FETCHER_CORE_H_ |
| OLD | NEW |