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

Unified Diff: trunk/src/net/url_request/url_request_ftp_job.cc

Issue 12605011: Revert 188912 "Removed static factories for data, ftp, file, and..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 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
Index: trunk/src/net/url_request/url_request_ftp_job.cc
===================================================================
--- trunk/src/net/url_request/url_request_ftp_job.cc (revision 188924)
+++ trunk/src/net/url_request/url_request_ftp_job.cc (working copy)
@@ -12,7 +12,6 @@
#include "net/base/load_flags.h"
#include "net/base/net_errors.h"
#include "net/base/net_util.h"
-#include "net/ftp/ftp_auth_cache.h"
#include "net/ftp/ftp_response_info.h"
#include "net/ftp/ftp_transaction_factory.h"
#include "net/http/http_response_headers.h"
@@ -39,6 +38,26 @@
DCHECK(ftp_auth_cache);
}
+// static
+URLRequestJob* URLRequestFtpJob::Factory(URLRequest* request,
+ NetworkDelegate* network_delegate,
+ const std::string& scheme) {
+ DCHECK_EQ(scheme, "ftp");
+
+ int port = request->url().IntPort();
+ if (request->url().has_port() &&
+ !IsPortAllowedByFtp(port) && !IsPortAllowedByOverride(port)) {
+ return new URLRequestErrorJob(request,
+ network_delegate,
+ ERR_UNSAFE_PORT);
+ }
+
+ return new URLRequestFtpJob(request,
+ network_delegate,
+ request->context()->ftp_transaction_factory(),
+ request->context()->ftp_auth_cache());
+}
+
bool URLRequestFtpJob::IsSafeRedirect(const GURL& location) {
// Disallow all redirects.
return false;
« no previous file with comments | « trunk/src/net/url_request/url_request_ftp_job.h ('k') | trunk/src/net/url_request/url_request_ftp_job_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698