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

Unified Diff: trunk/src/net/url_request/url_request.cc

Issue 197463003: Revert 256579 "Allow the content browser client to specify a spe..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « trunk/src/net/url_request/url_request.h ('k') | trunk/src/net/url_request/url_request_context.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/net/url_request/url_request.cc
===================================================================
--- trunk/src/net/url_request/url_request.cc (revision 256581)
+++ trunk/src/net/url_request/url_request.cc (working copy)
@@ -209,17 +209,38 @@
RequestPriority priority,
Delegate* delegate,
const URLRequestContext* context)
- : identifier_(GenerateURLRequestIdentifier()) {
- Init(url, priority, delegate, context, NULL);
-}
+ : context_(context),
+ network_delegate_(context->network_delegate()),
+ net_log_(BoundNetLog::Make(context->net_log(),
+ NetLog::SOURCE_URL_REQUEST)),
+ url_chain_(1, url),
+ method_("GET"),
+ referrer_policy_(CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE),
+ load_flags_(LOAD_NORMAL),
+ delegate_(delegate),
+ is_pending_(false),
+ is_redirecting_(false),
+ redirect_limit_(kMaxRedirects),
+ priority_(priority),
+ identifier_(GenerateURLRequestIdentifier()),
+ calling_delegate_(false),
+ use_blocked_by_as_load_param_(false),
+ before_request_callback_(base::Bind(&URLRequest::BeforeRequestComplete,
+ base::Unretained(this))),
+ has_notified_completion_(false),
+ received_response_content_length_(0),
+ creation_time_(base::TimeTicks::Now()),
+ notified_before_network_start_(false) {
+ SIMPLE_STATS_COUNTER("URLRequestCount");
-URLRequest::URLRequest(const GURL& url,
- RequestPriority priority,
- Delegate* delegate,
- const URLRequestContext* context,
- CookieStore* cookie_store)
- : identifier_(GenerateURLRequestIdentifier()) {
- Init(url, priority, delegate, context, cookie_store);
+ // Sanity check out environment.
+ DCHECK(base::MessageLoop::current())
+ << "The current base::MessageLoop must exist";
+
+ CHECK(context);
+ context->url_requests()->insert(this);
+
+ net_log_.BeginEvent(NetLog::TYPE_REQUEST_ALIVE);
}
URLRequest::~URLRequest() {
@@ -263,47 +284,6 @@
interceptor);
}
-void URLRequest::Init(const GURL& url,
- RequestPriority priority,
- Delegate* delegate,
- const URLRequestContext* context,
- CookieStore* cookie_store) {
- context_ = context;
- network_delegate_ = context->network_delegate();
- net_log_ = BoundNetLog::Make(context->net_log(), NetLog::SOURCE_URL_REQUEST);
- url_chain_.push_back(url);
- method_ = "GET";
- referrer_policy_ = CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE;
- load_flags_ = LOAD_NORMAL;
- delegate_ = delegate;
- is_pending_ = false;
- is_redirecting_ = false;
- redirect_limit_ = kMaxRedirects;
- priority_ = priority;
- calling_delegate_ = false;
- use_blocked_by_as_load_param_ =false;
- before_request_callback_ = base::Bind(&URLRequest::BeforeRequestComplete,
- base::Unretained(this));
- has_notified_completion_ = false;
- received_response_content_length_ = 0;
- creation_time_ = base::TimeTicks::Now();
- notified_before_network_start_ = false;
-
- SIMPLE_STATS_COUNTER("URLRequestCount");
-
- // Sanity check out environment.
- DCHECK(base::MessageLoop::current())
- << "The current base::MessageLoop must exist";
-
- CHECK(context);
- context->url_requests()->insert(this);
- cookie_store_ = cookie_store;
- if (cookie_store_ == NULL)
- cookie_store_ = context->cookie_store();
-
- net_log_.BeginEvent(NetLog::TYPE_REQUEST_ALIVE);
-}
-
void URLRequest::EnableChunkedUpload() {
DCHECK(!upload_data_stream_ || upload_data_stream_->is_chunked());
if (!upload_data_stream_) {
« no previous file with comments | « trunk/src/net/url_request/url_request.h ('k') | trunk/src/net/url_request/url_request_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698