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

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

Issue 332833003: net: Make URLRequestJobFactories mandatory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Switch some tests to TestURLRequestContext Created 6 years, 6 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 | Annotate | Revision Log
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 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 void URLRequest::set_referrer_policy(ReferrerPolicy referrer_policy) { 607 void URLRequest::set_referrer_policy(ReferrerPolicy referrer_policy) {
608 DCHECK(!is_pending_); 608 DCHECK(!is_pending_);
609 referrer_policy_ = referrer_policy; 609 referrer_policy_ = referrer_policy;
610 } 610 }
611 611
612 void URLRequest::set_delegate(Delegate* delegate) { 612 void URLRequest::set_delegate(Delegate* delegate) {
613 delegate_ = delegate; 613 delegate_ = delegate;
614 } 614 }
615 615
616 void URLRequest::Start() { 616 void URLRequest::Start() {
617 // Some values can be NULL, but the job factory must not be.
618 DCHECK(context_->job_factory());
619
617 DCHECK_EQ(network_delegate_, context_->network_delegate()); 620 DCHECK_EQ(network_delegate_, context_->network_delegate());
618 // Anything that sets |blocked_by_| before start should have cleaned up after 621 // Anything that sets |blocked_by_| before start should have cleaned up after
619 // itself. 622 // itself.
620 DCHECK(blocked_by_.empty()); 623 DCHECK(blocked_by_.empty());
621 624
622 g_url_requests_started = true; 625 g_url_requests_started = true;
623 response_info_.request_time = base::Time::Now(); 626 response_info_.request_time = base::Time::Now();
624 627
625 load_timing_info_ = LoadTimingInfo(); 628 load_timing_info_ = LoadTimingInfo();
626 load_timing_info_.request_start_time = response_info_.request_time; 629 load_timing_info_.request_start_time = response_info_.request_time;
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
1232 new base::debug::StackTrace(NULL, 0); 1235 new base::debug::StackTrace(NULL, 0);
1233 *stack_trace_copy = stack_trace; 1236 *stack_trace_copy = stack_trace;
1234 stack_trace_.reset(stack_trace_copy); 1237 stack_trace_.reset(stack_trace_copy);
1235 } 1238 }
1236 1239
1237 const base::debug::StackTrace* URLRequest::stack_trace() const { 1240 const base::debug::StackTrace* URLRequest::stack_trace() const {
1238 return stack_trace_.get(); 1241 return stack_trace_.get();
1239 } 1242 }
1240 1243
1241 } // namespace net 1244 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698