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

Unified Diff: components/cronet/android/url_request_adapter.cc

Issue 500193002: Fix Cronet compilation and test errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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
Index: components/cronet/android/url_request_adapter.cc
diff --git a/components/cronet/android/url_request_adapter.cc b/components/cronet/android/url_request_adapter.cc
index 4b0b38dbb708cfab42bb90287b869156cfbc1443..2e40945e5ccaae8315014ab9dd067abb132194e6 100644
--- a/components/cronet/android/url_request_adapter.cc
+++ b/components/cronet/android/url_request_adapter.cc
@@ -25,7 +25,6 @@ URLRequestAdapter::URLRequestAdapter(URLRequestContextAdapter* context,
GURL url,
net::RequestPriority priority)
: method_("GET"),
- url_request_(NULL),
read_buffer_(new net::GrowableIOBuffer()),
bytes_read_(0),
total_bytes_read_(0),
@@ -121,8 +120,8 @@ void URLRequestAdapter::OnInitiateConnection() {
VLOG(1) << "Starting chromium request: "
<< url_.possibly_invalid_spec().c_str()
<< " priority: " << RequestPriorityToString(priority_);
- url_request_ = new net::URLRequest(
- url_, net::DEFAULT_PRIORITY, this, context_->GetURLRequestContext());
+ url_request_ = context_->GetURLRequestContext()->CreateRequest(
+ url_, net::DEFAULT_PRIORITY, this, NULL);
url_request_->SetLoadFlags(net::LOAD_DISABLE_CACHE |
net::LOAD_DO_NOT_SAVE_COOKIES |
net::LOAD_DO_NOT_SEND_COOKIES);
@@ -281,10 +280,7 @@ void URLRequestAdapter::OnRequestCanceled() {
void URLRequestAdapter::OnRequestCompleted() {
VLOG(1) << "Completed: " << url_.possibly_invalid_spec();
- if (url_request_ != NULL) {
- delete url_request_;
- url_request_ = NULL;
- }
+ url_request_.reset();
mmenke 2014/08/25 19:46:44 Amusingly, I made this exact change in my CL to fi
mef 2014/08/25 20:26:18 Excellent!
delegate_->OnBytesRead(this);
delegate_->OnRequestFinished(this);

Powered by Google App Engine
This is Rietveld 408576698