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

Side by Side Diff: net/proxy/proxy_script_fetcher_impl.cc

Issue 15829004: Update net/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: license twerk Created 7 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
« no previous file with comments | « net/proxy/proxy_resolver_v8_tracing.cc ('k') | net/proxy/proxy_script_fetcher_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/proxy/proxy_script_fetcher_impl.h" 5 #include "net/proxy/proxy_script_fetcher_impl.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/i18n/icu_string_conversions.h" 8 #include "base/i18n/icu_string_conversions.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 if (ConsumeBytesRead(request, num_bytes)) { 243 if (ConsumeBytesRead(request, num_bytes)) {
244 // Keep reading. 244 // Keep reading.
245 ReadBody(request); 245 ReadBody(request);
246 } 246 }
247 } 247 }
248 248
249 void ProxyScriptFetcherImpl::ReadBody(URLRequest* request) { 249 void ProxyScriptFetcherImpl::ReadBody(URLRequest* request) {
250 // Read as many bytes as are available synchronously. 250 // Read as many bytes as are available synchronously.
251 while (true) { 251 while (true) {
252 int num_bytes; 252 int num_bytes;
253 if (!request->Read(buf_, kBufSize, &num_bytes)) { 253 if (!request->Read(buf_.get(), kBufSize, &num_bytes)) {
254 // Check whether the read failed synchronously. 254 // Check whether the read failed synchronously.
255 if (!request->status().is_io_pending()) 255 if (!request->status().is_io_pending())
256 OnResponseCompleted(request); 256 OnResponseCompleted(request);
257 return; 257 return;
258 } 258 }
259 if (!ConsumeBytesRead(request, num_bytes)) 259 if (!ConsumeBytesRead(request, num_bytes))
260 return; 260 return;
261 } 261 }
262 } 262 }
263 263
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 // is still applicable. 313 // is still applicable.
314 if (cur_request_id_ != id) 314 if (cur_request_id_ != id)
315 return; 315 return;
316 316
317 DCHECK(cur_request_.get()); 317 DCHECK(cur_request_.get());
318 result_code_ = ERR_TIMED_OUT; 318 result_code_ = ERR_TIMED_OUT;
319 cur_request_->Cancel(); 319 cur_request_->Cancel();
320 } 320 }
321 321
322 } // namespace net 322 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/proxy_resolver_v8_tracing.cc ('k') | net/proxy/proxy_script_fetcher_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698