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

Side by Side Diff: net/url_request/url_request_new_ftp_job.cc

Issue 194057: Check in patch for pierre.lafayette, http://codereview.chromium.org/178059/sh... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « net/url_request/url_request_http_job.cc ('k') | net/url_request/url_request_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/url_request/url_request_new_ftp_job.h" 5 #include "net/url_request/url_request_new_ftp_job.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/file_version_info.h" 8 #include "base/file_version_info.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/sys_string_conversions.h" 10 #include "base/sys_string_conversions.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } 73 }
74 74
75 URLRequestNewFtpJob::~URLRequestNewFtpJob() { 75 URLRequestNewFtpJob::~URLRequestNewFtpJob() {
76 } 76 }
77 77
78 // static 78 // static
79 URLRequestJob* URLRequestNewFtpJob::Factory(URLRequest* request, 79 URLRequestJob* URLRequestNewFtpJob::Factory(URLRequest* request,
80 const std::string& scheme) { 80 const std::string& scheme) {
81 DCHECK_EQ(scheme, "ftp"); 81 DCHECK_EQ(scheme, "ftp");
82 82
83 int port = request->url().IntPort();
83 if (request->url().has_port() && 84 if (request->url().has_port() &&
84 !net::IsPortAllowedByFtp(request->url().IntPort())) 85 !net::IsPortAllowedByFtp(port) && !net::IsPortAllowedByOverride(port))
85 return new URLRequestErrorJob(request, net::ERR_UNSAFE_PORT); 86 return new URLRequestErrorJob(request, net::ERR_UNSAFE_PORT);
86 87
87 DCHECK(request->context()); 88 DCHECK(request->context());
88 DCHECK(request->context()->ftp_transaction_factory()); 89 DCHECK(request->context()->ftp_transaction_factory());
89 return new URLRequestNewFtpJob(request); 90 return new URLRequestNewFtpJob(request);
90 } 91 }
91 92
92 void URLRequestNewFtpJob::Start() { 93 void URLRequestNewFtpJob::Start() {
93 DCHECK(!transaction_.get()); 94 DCHECK(!transaction_.get());
94 request_info_.url = request_->url(); 95 request_info_.url = request_->url();
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( 400 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
400 this, &URLRequestNewFtpJob::OnStartCompleted, rv)); 401 this, &URLRequestNewFtpJob::OnStartCompleted, rv));
401 } 402 }
402 403
403 void URLRequestNewFtpJob::DestroyTransaction() { 404 void URLRequestNewFtpJob::DestroyTransaction() {
404 DCHECK(transaction_.get()); 405 DCHECK(transaction_.get());
405 406
406 transaction_.reset(); 407 transaction_.reset();
407 response_info_ = NULL; 408 response_info_ = NULL;
408 } 409 }
OLDNEW
« no previous file with comments | « net/url_request/url_request_http_job.cc ('k') | net/url_request/url_request_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698