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); |