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

Unified Diff: net/url_request/url_request_file_job.cc

Issue 10855209: Refactoring: ProtocolHandler::MaybeCreateJob takes NetworkDelegate as argument (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 side-by-side diff with in-line comments
Download patch
Index: net/url_request/url_request_file_job.cc
diff --git a/net/url_request/url_request_file_job.cc b/net/url_request/url_request_file_job.cc
index c9378dda6b82f782cbbc92235beb7707593bc39a..da7ee611fb7512a5914a1a08e158718f2366b274 100644
--- a/net/url_request/url_request_file_job.cc
+++ b/net/url_request/url_request_file_job.cc
@@ -84,8 +84,9 @@ class URLRequestFileJob::AsyncResolver
};
URLRequestFileJob::URLRequestFileJob(URLRequest* request,
+ NetworkDelegate* network_delegate,
const FilePath& file_path)
- : URLRequestJob(request, request->context()->network_delegate()),
+ : URLRequestJob(request, network_delegate),
file_path_(file_path),
stream_(NULL),
is_directory_(false),
@@ -100,7 +101,9 @@ URLRequestJob* URLRequestFileJob::Factory(URLRequest* request,
// Check file access permissions.
if (!IsFileAccessAllowed(*request, file_path))
- return new URLRequestErrorJob(request, ERR_ACCESS_DENIED);
+ return new URLRequestErrorJob(request,
+ request->context()->network_delegate(),
+ ERR_ACCESS_DENIED);
// We need to decide whether to create URLRequestFileJob for file access or
// URLRequestFileDirJob for directory access. To avoid accessing the
@@ -115,7 +118,8 @@ URLRequestJob* URLRequestFileJob::Factory(URLRequest* request,
// Use a regular file request job for all non-directories (including invalid
// file names).
- return new URLRequestFileJob(request, file_path);
+ return new URLRequestFileJob(
+ request, request->context()->network_delegate(), file_path);
}
void URLRequestFileJob::Start() {

Powered by Google App Engine
This is Rietveld 408576698