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

Unified Diff: net/url_request/url_request_file_job.cc

Issue 10836206: Removed static factories for data, ftp, file, and about jobs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added includes for Android 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 f07e92fc565c025c189c3b4836f71663a73f44ab..77bc27ec317f47d3f24879ca33c697be3614721e 100644
--- a/net/url_request/url_request_file_job.cc
+++ b/net/url_request/url_request_file_job.cc
@@ -93,36 +93,6 @@ URLRequestFileJob::URLRequestFileJob(URLRequest* request,
remaining_bytes_(0) {
}
-// static
-URLRequestJob* URLRequestFileJob::Factory(URLRequest* request,
- const std::string& scheme) {
- FilePath file_path;
- const bool is_file = FileURLToFilePath(request->url(), &file_path);
-
- // Check file access permissions.
- if (!request->context()->network_delegate() ||
- !request->context()->network_delegate()->CanAccessFile(
- *request, file_path)) {
- return new URLRequestErrorJob(request, ERR_ACCESS_DENIED);
- }
-
- // We need to decide whether to create URLRequestFileJob for file access or
- // URLRequestFileDirJob for directory access. To avoid accessing the
- // filesystem, we only look at the path string here.
- // The code in the URLRequestFileJob::Start() method discovers that a path,
- // which doesn't end with a slash, should really be treated as a directory,
- // and it then redirects to the URLRequestFileDirJob.
- if (is_file &&
- file_util::EndsWithSeparator(file_path) &&
- file_path.IsAbsolute())
- return new URLRequestFileDirJob(request, file_path);
-
- // Use a regular file request job for all non-directories (including invalid
- // file names).
- return new URLRequestFileJob(
- request, file_path, request->context()->network_delegate());
-}
-
void URLRequestFileJob::Start() {
DCHECK(!async_resolver_);
async_resolver_ = new AsyncResolver(this);

Powered by Google App Engine
This is Rietveld 408576698