| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 NET_URL_REQUEST_URL_REQUEST_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_H_ |
| 6 #define NET_URL_REQUEST_URL_REQUEST_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/leak_tracker.h" | 12 #include "base/leak_tracker.h" |
| 13 #include "base/linked_ptr.h" | 13 #include "base/linked_ptr.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/ref_counted.h" | 15 #include "base/ref_counted.h" |
| 16 #include "base/scoped_ptr.h" | 16 #include "base/scoped_ptr.h" |
| 17 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
| 18 #include "net/base/load_log.h" |
| 18 #include "net/base/load_states.h" | 19 #include "net/base/load_states.h" |
| 19 #include "net/http/http_response_info.h" | 20 #include "net/http/http_response_info.h" |
| 20 #include "net/url_request/url_request_status.h" | 21 #include "net/url_request/url_request_status.h" |
| 21 | 22 |
| 22 namespace base { | 23 namespace base { |
| 23 class Time; | 24 class Time; |
| 24 } // namespace base | 25 } // namespace base |
| 25 | 26 |
| 26 namespace net { | 27 namespace net { |
| 27 class IOBuffer; | 28 class IOBuffer; |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 // Returns true if performance profiling should be enabled on the | 479 // Returns true if performance profiling should be enabled on the |
| 479 // URLRequestJob serving this request. | 480 // URLRequestJob serving this request. |
| 480 bool enable_profiling() const { return enable_profiling_; } | 481 bool enable_profiling() const { return enable_profiling_; } |
| 481 | 482 |
| 482 void set_enable_profiling(bool profiling) { enable_profiling_ = profiling; } | 483 void set_enable_profiling(bool profiling) { enable_profiling_ = profiling; } |
| 483 | 484 |
| 484 // Used to specify the context (cookie store, cache) for this request. | 485 // Used to specify the context (cookie store, cache) for this request. |
| 485 URLRequestContext* context(); | 486 URLRequestContext* context(); |
| 486 void set_context(URLRequestContext* context); | 487 void set_context(URLRequestContext* context); |
| 487 | 488 |
| 489 net::LoadLog* load_log() { return load_log_; } |
| 490 |
| 488 // Returns the expected content size if available | 491 // Returns the expected content size if available |
| 489 int64 GetExpectedContentSize() const; | 492 int64 GetExpectedContentSize() const; |
| 490 | 493 |
| 491 // Returns the priority level for this request. A larger value indicates | 494 // Returns the priority level for this request. A larger value indicates |
| 492 // higher priority. Negative values are not used. | 495 // higher priority. Negative values are not used. |
| 493 int priority() const { return priority_; } | 496 int priority() const { return priority_; } |
| 494 void set_priority(int priority) { | 497 void set_priority(int priority) { |
| 495 DCHECK_GE(priority, 0); | 498 DCHECK_GE(priority, 0); |
| 496 priority_ = priority; | 499 priority_ = priority; |
| 497 } | 500 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 void OrphanJob(); | 537 void OrphanJob(); |
| 535 | 538 |
| 536 // Cancels the request and set the error and ssl info for this request to the | 539 // Cancels the request and set the error and ssl info for this request to the |
| 537 // passed values. | 540 // passed values. |
| 538 void DoCancel(int os_error, const net::SSLInfo& ssl_info); | 541 void DoCancel(int os_error, const net::SSLInfo& ssl_info); |
| 539 | 542 |
| 540 // Discard headers which have meaning in POST (Content-Length, Content-Type, | 543 // Discard headers which have meaning in POST (Content-Length, Content-Type, |
| 541 // Origin). | 544 // Origin). |
| 542 static std::string StripPostSpecificHeaders(const std::string& headers); | 545 static std::string StripPostSpecificHeaders(const std::string& headers); |
| 543 | 546 |
| 544 // Contextual information used for this request (can be NULL). | 547 // Contextual information used for this request (can be NULL). This contains |
| 548 // most of the dependencies which are shared between requests (disk cache, |
| 549 // cookie store, socket poool, etc.) |
| 545 scoped_refptr<URLRequestContext> context_; | 550 scoped_refptr<URLRequestContext> context_; |
| 546 | 551 |
| 552 // Tracks the time spent in various load states throughout this request. |
| 553 scoped_refptr<net::LoadLog> load_log_; |
| 554 |
| 547 scoped_refptr<URLRequestJob> job_; | 555 scoped_refptr<URLRequestJob> job_; |
| 548 scoped_refptr<net::UploadData> upload_; | 556 scoped_refptr<net::UploadData> upload_; |
| 549 GURL url_; | 557 GURL url_; |
| 550 GURL original_url_; | 558 GURL original_url_; |
| 551 GURL first_party_for_cookies_; | 559 GURL first_party_for_cookies_; |
| 552 std::string method_; // "GET", "POST", etc. Should be all uppercase. | 560 std::string method_; // "GET", "POST", etc. Should be all uppercase. |
| 553 std::string referrer_; | 561 std::string referrer_; |
| 554 std::string extra_request_headers_; | 562 std::string extra_request_headers_; |
| 555 int load_flags_; // Flags indicating the request type for the load; | 563 int load_flags_; // Flags indicating the request type for the load; |
| 556 // expected values are LOAD_* enums above. | 564 // expected values are LOAD_* enums above. |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 #define URLREQUEST_COUNT_DTOR() url_request_metrics.object_count-- | 625 #define URLREQUEST_COUNT_DTOR() url_request_metrics.object_count-- |
| 618 | 626 |
| 619 #else // disable leak checking in release builds... | 627 #else // disable leak checking in release builds... |
| 620 | 628 |
| 621 #define URLREQUEST_COUNT_CTOR() | 629 #define URLREQUEST_COUNT_CTOR() |
| 622 #define URLREQUEST_COUNT_DTOR() | 630 #define URLREQUEST_COUNT_DTOR() |
| 623 | 631 |
| 624 #endif // #ifndef NDEBUG | 632 #endif // #ifndef NDEBUG |
| 625 | 633 |
| 626 #endif // NET_URL_REQUEST_URL_REQUEST_H_ | 634 #endif // NET_URL_REQUEST_URL_REQUEST_H_ |
| OLD | NEW |