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

Unified Diff: net/url_request/url_request.cc

Issue 51953002: [Net] Add a priority parameter to URLRequest's constructor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 7 years, 2 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 | « net/url_request/url_request.h ('k') | 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: net/url_request/url_request.cc
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
index 57e9fb83c8bea631440291bf2c3074f1a0166379..dae9d0e5339f860eb066eea982ef63061636968e 100644
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -200,8 +200,8 @@ void URLRequest::Delegate::OnSSLCertificateError(URLRequest* request,
///////////////////////////////////////////////////////////////////////////////
// URLRequest
-// TODO(shalev): Get rid of this constructor in favour of the one below it.
URLRequest::URLRequest(const GURL& url,
+ RequestPriority priority,
Delegate* delegate,
const URLRequestContext* context)
: context_(context),
@@ -216,44 +216,7 @@ URLRequest::URLRequest(const GURL& url,
is_pending_(false),
is_redirecting_(false),
redirect_limit_(kMaxRedirects),
- priority_(DEFAULT_PRIORITY),
- identifier_(GenerateURLRequestIdentifier()),
- calling_delegate_(false),
- delegate_info_usage_(DELEGATE_INFO_DEBUG_ONLY),
- before_request_callback_(base::Bind(&URLRequest::BeforeRequestComplete,
- base::Unretained(this))),
- has_notified_completion_(false),
- received_response_content_length_(0),
- creation_time_(base::TimeTicks::Now()) {
- 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);
-
- net_log_.BeginEvent(NetLog::TYPE_REQUEST_ALIVE);
-}
-
-URLRequest::URLRequest(const GURL& url,
- Delegate* delegate,
- const URLRequestContext* context,
- NetworkDelegate* network_delegate)
- : context_(context),
- network_delegate_(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_(DEFAULT_PRIORITY),
+ priority_(priority),
identifier_(GenerateURLRequestIdentifier()),
calling_delegate_(false),
delegate_info_usage_(DELEGATE_INFO_DEBUG_ONLY),
« no previous file with comments | « net/url_request/url_request.h ('k') | net/url_request/url_request_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698