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

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

Issue 1310743003: Consistently use LoFi for an entire page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test fixes Created 5 years, 3 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
« net/url_request/url_request.h ('K') | « net/url_request/url_request.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 477
478 void URLRequest::set_referrer_policy(ReferrerPolicy referrer_policy) { 478 void URLRequest::set_referrer_policy(ReferrerPolicy referrer_policy) {
479 DCHECK(!is_pending_); 479 DCHECK(!is_pending_);
480 referrer_policy_ = referrer_policy; 480 referrer_policy_ = referrer_policy;
481 } 481 }
482 482
483 void URLRequest::set_delegate(Delegate* delegate) { 483 void URLRequest::set_delegate(Delegate* delegate) {
484 delegate_ = delegate; 484 delegate_ = delegate;
485 } 485 }
486 486
487 void URLRequest::set_lofi_state(LoFiState lofi_state) {
488 lofi_state_ = lofi_state;
489 }
490
487 void URLRequest::Start() { 491 void URLRequest::Start() {
488 // TODO(pkasting): Remove ScopedTracker below once crbug.com/456327 is fixed. 492 // TODO(pkasting): Remove ScopedTracker below once crbug.com/456327 is fixed.
489 tracked_objects::ScopedTracker tracking_profile( 493 tracked_objects::ScopedTracker tracking_profile(
490 FROM_HERE_WITH_EXPLICIT_FUNCTION("456327 URLRequest::Start")); 494 FROM_HERE_WITH_EXPLICIT_FUNCTION("456327 URLRequest::Start"));
491 495
492 // Some values can be NULL, but the job factory must not be. 496 // Some values can be NULL, but the job factory must not be.
493 DCHECK(context_->job_factory()); 497 DCHECK(context_->job_factory());
494 498
495 // Anything that sets |blocked_by_| before start should have cleaned up after 499 // Anything that sets |blocked_by_| before start should have cleaned up after
496 // itself. 500 // itself.
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 redirect_limit_(kMaxRedirects), 554 redirect_limit_(kMaxRedirects),
551 priority_(priority), 555 priority_(priority),
552 identifier_(GenerateURLRequestIdentifier()), 556 identifier_(GenerateURLRequestIdentifier()),
553 calling_delegate_(false), 557 calling_delegate_(false),
554 use_blocked_by_as_load_param_(false), 558 use_blocked_by_as_load_param_(false),
555 before_request_callback_(base::Bind(&URLRequest::BeforeRequestComplete, 559 before_request_callback_(base::Bind(&URLRequest::BeforeRequestComplete,
556 base::Unretained(this))), 560 base::Unretained(this))),
557 has_notified_completion_(false), 561 has_notified_completion_(false),
558 received_response_content_length_(0), 562 received_response_content_length_(0),
559 creation_time_(base::TimeTicks::Now()), 563 creation_time_(base::TimeTicks::Now()),
560 notified_before_network_start_(false) { 564 notified_before_network_start_(false),
565 lofi_state_(LOFI_DEFAULT) {
561 // Sanity check out environment. 566 // Sanity check out environment.
562 DCHECK(base::MessageLoop::current()) 567 DCHECK(base::MessageLoop::current())
563 << "The current base::MessageLoop must exist"; 568 << "The current base::MessageLoop must exist";
564 569
565 context->url_requests()->insert(this); 570 context->url_requests()->insert(this);
566 net_log_.BeginEvent(NetLog::TYPE_REQUEST_ALIVE); 571 net_log_.BeginEvent(NetLog::TYPE_REQUEST_ALIVE);
567 } 572 }
568 573
569 void URLRequest::BeforeRequestComplete(int error) { 574 void URLRequest::BeforeRequestComplete(int error) {
570 DCHECK(!job_.get()); 575 DCHECK(!job_.get());
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
1186 } 1191 }
1187 1192
1188 void URLRequest::GetConnectionAttempts(ConnectionAttempts* out) const { 1193 void URLRequest::GetConnectionAttempts(ConnectionAttempts* out) const {
1189 if (job_) 1194 if (job_)
1190 job_->GetConnectionAttempts(out); 1195 job_->GetConnectionAttempts(out);
1191 else 1196 else
1192 out->clear(); 1197 out->clear();
1193 } 1198 }
1194 1199
1195 } // namespace net 1200 } // namespace net
OLDNEW
« net/url_request/url_request.h ('K') | « net/url_request/url_request.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698