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

Side by Side Diff: net/url_request/url_request_file_job.cc

Issue 10830124: Removed checks that verify URLRequest has a Context (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/url_request/url_request.cc ('k') | net/url_request/url_request_http_job.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 // For loading files, we make use of overlapped i/o to ensure that reading from 5 // For loading files, we make use of overlapped i/o to ensure that reading from
6 // the filesystem (e.g., a network filesystem) does not block the calling 6 // the filesystem (e.g., a network filesystem) does not block the calling
7 // thread. An alternative approach would be to use a background thread or pool 7 // thread. An alternative approach would be to use a background thread or pool
8 // of threads, but it seems better to leverage the operating system's ability 8 // of threads, but it seems better to leverage the operating system's ability
9 // to do background file reads for us. 9 // to do background file reads for us.
10 // 10 //
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, 246 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED,
247 ERR_REQUEST_RANGE_NOT_SATISFIABLE)); 247 ERR_REQUEST_RANGE_NOT_SATISFIABLE));
248 } 248 }
249 } 249 }
250 } 250 }
251 } 251 }
252 252
253 // static 253 // static
254 bool URLRequestFileJob::IsFileAccessAllowed(const URLRequest& request, 254 bool URLRequestFileJob::IsFileAccessAllowed(const URLRequest& request,
255 const FilePath& path) { 255 const FilePath& path) {
256 const URLRequestContext* context = request.context(); 256 const NetworkDelegate* delegate = request.context()->network_delegate();
257 if (!context)
258 return false;
259 const NetworkDelegate* delegate = context->network_delegate();
260 if (delegate) 257 if (delegate)
261 return delegate->CanAccessFile(request, path); 258 return delegate->CanAccessFile(request, path);
262 return false; 259 return false;
263 } 260 }
264 261
265 URLRequestFileJob::~URLRequestFileJob() { 262 URLRequestFileJob::~URLRequestFileJob() {
266 DCHECK(!async_resolver_); 263 DCHECK(!async_resolver_);
267 } 264 }
268 265
269 void URLRequestFileJob::DidResolve( 266 void URLRequestFileJob::DidResolve(
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, result)); 338 NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, result));
342 } 339 }
343 340
344 remaining_bytes_ -= result; 341 remaining_bytes_ -= result;
345 DCHECK_GE(remaining_bytes_, 0); 342 DCHECK_GE(remaining_bytes_, 0);
346 343
347 NotifyReadComplete(result); 344 NotifyReadComplete(result);
348 } 345 }
349 346
350 } // namespace net 347 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request.cc ('k') | net/url_request/url_request_http_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698