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

Side by Side Diff: net/url_request/ftp_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 unified diff | Download patch
« no previous file with comments | « net/url_request/ftp_protocol_handler.h ('k') | net/url_request/http_user_agent_settings.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "net/url_request/ftp_protocol_handler.h"
6
7 #include "base/logging.h"
8 #include "net/base/net_errors.h"
9 #include "net/base/net_util.h"
10 #include "net/ftp/ftp_auth_cache.h"
11 #include "net/url_request/url_request.h"
12 #include "net/url_request/url_request_error_job.h"
13 #include "net/url_request/url_request_ftp_job.h"
14 #include "url/gurl.h"
15
16 namespace net {
17
18 FtpProtocolHandler::FtpProtocolHandler(
19 FtpTransactionFactory* ftp_transaction_factory)
20 : ftp_transaction_factory_(ftp_transaction_factory),
21 ftp_auth_cache_(new FtpAuthCache) {
22 DCHECK(ftp_transaction_factory_);
23 }
24
25 FtpProtocolHandler::~FtpProtocolHandler() {
26 }
27
28 URLRequestJob* FtpProtocolHandler::MaybeCreateJob(
29 URLRequest* request, NetworkDelegate* network_delegate) const {
30 int port = request->url().IntPort();
31 if (request->url().has_port() &&
32 !IsPortAllowedByFtp(port) && !IsPortAllowedByOverride(port)) {
33 return new URLRequestErrorJob(request, network_delegate, ERR_UNSAFE_PORT);
34 }
35
36 return new URLRequestFtpJob(request,
37 network_delegate,
38 ftp_transaction_factory_,
39 ftp_auth_cache_.get());
40 }
41
42 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/ftp_protocol_handler.h ('k') | net/url_request/http_user_agent_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698