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 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 <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/debug/leak_tracker.h" | 11 #include "base/debug/leak_tracker.h" |
12 #include "base/gtest_prod_util.h" | |
12 #include "base/logging.h" | 13 #include "base/logging.h" |
13 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
14 #include "base/string16.h" | 15 #include "base/string16.h" |
15 #include "base/supports_user_data.h" | 16 #include "base/supports_user_data.h" |
16 #include "base/time.h" | 17 #include "base/time.h" |
17 #include "base/threading/non_thread_safe.h" | 18 #include "base/threading/non_thread_safe.h" |
18 #include "googleurl/src/gurl.h" | 19 #include "googleurl/src/gurl.h" |
19 #include "net/base/auth.h" | 20 #include "net/base/auth.h" |
20 #include "net/base/completion_callback.h" | 21 #include "net/base/completion_callback.h" |
21 #include "net/base/load_states.h" | 22 #include "net/base/load_states.h" |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
608 // Used to specify the context (cookie store, cache) for this request. | 609 // Used to specify the context (cookie store, cache) for this request. |
609 const URLRequestContext* context() const; | 610 const URLRequestContext* context() const; |
610 | 611 |
611 const BoundNetLog& net_log() const { return net_log_; } | 612 const BoundNetLog& net_log() const { return net_log_; } |
612 | 613 |
613 // Returns the expected content size if available | 614 // Returns the expected content size if available |
614 int64 GetExpectedContentSize() const; | 615 int64 GetExpectedContentSize() const; |
615 | 616 |
616 // Returns the priority level for this request. | 617 // Returns the priority level for this request. |
617 RequestPriority priority() const { return priority_; } | 618 RequestPriority priority() const { return priority_; } |
618 void set_priority(RequestPriority priority) { | 619 |
619 DCHECK_GE(priority, MINIMUM_PRIORITY); | 620 // Sets the priority level for this request and any related jobs. |
620 DCHECK_LT(priority, NUM_PRIORITIES); | 621 void SetPriority(RequestPriority priority); |
621 priority_ = priority; | |
622 } | |
623 | 622 |
624 // Returns true iff this request would be internally redirected to HTTPS | 623 // Returns true iff this request would be internally redirected to HTTPS |
625 // due to HSTS. If so, |redirect_url| is rewritten to the new HTTPS URL. | 624 // due to HSTS. If so, |redirect_url| is rewritten to the new HTTPS URL. |
626 bool GetHSTSRedirect(GURL* redirect_url) const; | 625 bool GetHSTSRedirect(GURL* redirect_url) const; |
627 | 626 |
628 // TODO(willchan): Undo this. Only temporarily public. | 627 // TODO(willchan): Undo this. Only temporarily public. |
629 bool has_delegate() const { return delegate_ != NULL; } | 628 bool has_delegate() const { return delegate_ != NULL; } |
630 | 629 |
631 // NOTE(willchan): This is just temporary for debugging | 630 // NOTE(willchan): This is just temporary for debugging |
632 // http://crbug.com/90971. | 631 // http://crbug.com/90971. |
(...skipping 22 matching lines...) Expand all Loading... | |
655 // Called by URLRequestJob to allow interception when a redirect occurs. | 654 // Called by URLRequestJob to allow interception when a redirect occurs. |
656 void NotifyReceivedRedirect(const GURL& location, bool* defer_redirect); | 655 void NotifyReceivedRedirect(const GURL& location, bool* defer_redirect); |
657 | 656 |
658 // Allow an interceptor's URLRequestJob to restart this request. | 657 // Allow an interceptor's URLRequestJob to restart this request. |
659 // Should only be called if the original job has not started a response. | 658 // Should only be called if the original job has not started a response. |
660 void Restart(); | 659 void Restart(); |
661 | 660 |
662 private: | 661 private: |
663 friend class URLRequestJob; | 662 friend class URLRequestJob; |
664 | 663 |
664 FRIEND_TEST_ALL_PREFIXES(URLRequestTest, Priority); | |
mmenke
2013/03/12 18:40:22
I don't believe this is currently needed.
akalin
2013/03/12 22:08:28
Not after addressing your other comments. Done.
mmenke
2013/03/12 22:58:26
Oops - yea, comment was wrong. I missed the last
| |
665 | |
665 // Registers a new protocol handler for the given scheme. If the scheme is | 666 // Registers a new protocol handler for the given scheme. If the scheme is |
666 // already handled, this will overwrite the given factory. To delete the | 667 // already handled, this will overwrite the given factory. To delete the |
667 // protocol factory, use NULL for the factory BUT this WILL NOT put back | 668 // protocol factory, use NULL for the factory BUT this WILL NOT put back |
668 // any previously registered protocol factory. It will have returned | 669 // any previously registered protocol factory. It will have returned |
669 // the previously registered factory (or NULL if none is registered) when | 670 // the previously registered factory (or NULL if none is registered) when |
670 // the scheme was first registered so that the caller can manually put it | 671 // the scheme was first registered so that the caller can manually put it |
671 // back if desired. | 672 // back if desired. |
672 // | 673 // |
673 // The scheme must be all-lowercase ASCII. See the ProtocolFactory | 674 // The scheme must be all-lowercase ASCII. See the ProtocolFactory |
674 // declaration for its requirements. | 675 // declaration for its requirements. |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
840 LoadTimingInfo load_timing_info_; | 841 LoadTimingInfo load_timing_info_; |
841 | 842 |
842 scoped_ptr<const base::debug::StackTrace> stack_trace_; | 843 scoped_ptr<const base::debug::StackTrace> stack_trace_; |
843 | 844 |
844 DISALLOW_COPY_AND_ASSIGN(URLRequest); | 845 DISALLOW_COPY_AND_ASSIGN(URLRequest); |
845 }; | 846 }; |
846 | 847 |
847 } // namespace net | 848 } // namespace net |
848 | 849 |
849 #endif // NET_URL_REQUEST_URL_REQUEST_H_ | 850 #endif // NET_URL_REQUEST_URL_REQUEST_H_ |
OLD | NEW |