Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Side by Side Diff: net/url_request/url_request.cc

Issue 12701011: [Net] Propagate priority changes from URLRequest to HttpTransaction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_request.h" 5 #include "net/url_request/url_request.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after
821 } 821 }
822 822
823 int64 URLRequest::GetExpectedContentSize() const { 823 int64 URLRequest::GetExpectedContentSize() const {
824 int64 expected_content_size = -1; 824 int64 expected_content_size = -1;
825 if (job_) 825 if (job_)
826 expected_content_size = job_->expected_content_size(); 826 expected_content_size = job_->expected_content_size();
827 827
828 return expected_content_size; 828 return expected_content_size;
829 } 829 }
830 830
831 void URLRequest::SetPriority(RequestPriority priority) {
832 DCHECK_GE(priority, MINIMUM_PRIORITY);
833 DCHECK_LT(priority, NUM_PRIORITIES);
834 if (priority_ == priority)
835 return;
836
837 priority_ = priority;
838 if (job_) {
839 net_log_.AddEvent(NetLog::TYPE_URL_REQUEST_SET_PRIORITY,
840 NetLog::IntegerCallback("priority", priority_));
841 job_->SetPriority(priority_);
842 }
843 }
844
831 bool URLRequest::GetHSTSRedirect(GURL* redirect_url) const { 845 bool URLRequest::GetHSTSRedirect(GURL* redirect_url) const {
832 const GURL& url = this->url(); 846 const GURL& url = this->url();
833 if (!url.SchemeIs("http")) 847 if (!url.SchemeIs("http"))
834 return false; 848 return false;
835 TransportSecurityState::DomainState domain_state; 849 TransportSecurityState::DomainState domain_state;
836 if (context()->transport_security_state() && 850 if (context()->transport_security_state() &&
837 context()->transport_security_state()->GetDomainState( 851 context()->transport_security_state()->GetDomainState(
838 url.host(), 852 url.host(),
839 SSLConfigService::IsSNIAvailable(context()->ssl_config_service()), 853 SSLConfigService::IsSNIAvailable(context()->ssl_config_service()),
840 &domain_state) && 854 &domain_state) &&
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
998 new base::debug::StackTrace(NULL, 0); 1012 new base::debug::StackTrace(NULL, 0);
999 *stack_trace_copy = stack_trace; 1013 *stack_trace_copy = stack_trace;
1000 stack_trace_.reset(stack_trace_copy); 1014 stack_trace_.reset(stack_trace_copy);
1001 } 1015 }
1002 1016
1003 const base::debug::StackTrace* URLRequest::stack_trace() const { 1017 const base::debug::StackTrace* URLRequest::stack_trace() const {
1004 return stack_trace_.get(); 1018 return stack_trace_.get();
1005 } 1019 }
1006 1020
1007 } // namespace net 1021 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698