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

Unified Diff: net/url_request/file_protocol_handler.cc

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « net/url_request/file_protocol_handler.h ('k') | net/url_request/fraudulent_certificate_reporter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/file_protocol_handler.cc
diff --git a/net/url_request/file_protocol_handler.cc b/net/url_request/file_protocol_handler.cc
deleted file mode 100644
index ceed930985cd8514ca2d7c9b1209af5e71b5880b..0000000000000000000000000000000000000000
--- a/net/url_request/file_protocol_handler.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "net/url_request/file_protocol_handler.h"
-
-#include "base/logging.h"
-#include "base/task_runner.h"
-#include "net/base/filename_util.h"
-#include "net/base/net_errors.h"
-#include "net/url_request/url_request.h"
-#include "net/url_request/url_request_error_job.h"
-#include "net/url_request/url_request_file_dir_job.h"
-#include "net/url_request/url_request_file_job.h"
-
-namespace net {
-
-FileProtocolHandler::FileProtocolHandler(
- const scoped_refptr<base::TaskRunner>& file_task_runner)
- : file_task_runner_(file_task_runner) {}
-
-FileProtocolHandler::~FileProtocolHandler() {}
-
-URLRequestJob* FileProtocolHandler::MaybeCreateJob(
- URLRequest* request, NetworkDelegate* network_delegate) const {
- base::FilePath file_path;
- const bool is_file = FileURLToFilePath(request->url(), &file_path);
-
- // Check file access permissions.
- if (!network_delegate ||
- !network_delegate->CanAccessFile(*request, file_path)) {
- return new URLRequestErrorJob(request, 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
- // 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_path.EndsWithSeparator() &&
- file_path.IsAbsolute()) {
- return new URLRequestFileDirJob(request, network_delegate, file_path);
- }
-
- // Use a regular file request job for all non-directories (including invalid
- // file names).
- return new URLRequestFileJob(request, network_delegate, file_path,
- file_task_runner_);
-}
-
-bool FileProtocolHandler::IsSafeRedirectTarget(const GURL& location) const {
- return false;
-}
-
-} // namespace net
« no previous file with comments | « net/url_request/file_protocol_handler.h ('k') | net/url_request/fraudulent_certificate_reporter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698