diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-16 12:40:13 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-16 12:40:13 +0000 |
commit | e7fe5282029768fd1876277b079b9923984bd410 (patch) | |
tree | 82edccde423e31549dab02ea1c76f520b9f8c3cc | |
parent | 3161a4956e12ec599aa4209eed4b1a120beb0cbb (diff) | |
download | chromium_src-e7fe5282029768fd1876277b079b9923984bd410.zip chromium_src-e7fe5282029768fd1876277b079b9923984bd410.tar.gz chromium_src-e7fe5282029768fd1876277b079b9923984bd410.tar.bz2 |
Rename url_request_new_ftp_job -> url_request_ftp_job
TEST=net_unittests
BUG=none
Review URL: http://codereview.chromium.org/960001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41713 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | net/net.gyp | 4 | ||||
-rw-r--r-- | net/url_request/url_request_ftp_job.cc (renamed from net/url_request/url_request_new_ftp_job.cc) | 56 | ||||
-rw-r--r-- | net/url_request/url_request_ftp_job.h (renamed from net/url_request/url_request_new_ftp_job.h) | 18 | ||||
-rw-r--r-- | net/url_request/url_request_job_manager.cc | 4 |
4 files changed, 41 insertions, 41 deletions
diff --git a/net/net.gyp b/net/net.gyp index c85a614..ce7ffed 100644 --- a/net/net.gyp +++ b/net/net.gyp @@ -485,6 +485,8 @@ 'url_request/url_request_file_job.h', 'url_request/url_request_filter.cc', 'url_request/url_request_filter.h', + 'url_request/url_request_ftp_job.cc', + 'url_request/url_request_ftp_job.h', 'url_request/url_request_http_job.cc', 'url_request/url_request_http_job.h', 'url_request/url_request_job.cc', @@ -495,8 +497,6 @@ 'url_request/url_request_job_metrics.h', 'url_request/url_request_job_tracker.cc', 'url_request/url_request_job_tracker.h', - 'url_request/url_request_new_ftp_job.cc', - 'url_request/url_request_new_ftp_job.h', 'url_request/url_request_redirect_job.cc', 'url_request/url_request_redirect_job.h', 'url_request/url_request_simple_job.cc', diff --git a/net/url_request/url_request_new_ftp_job.cc b/net/url_request/url_request_ftp_job.cc index 1af7eda..f8746fc 100644 --- a/net/url_request/url_request_new_ftp_job.cc +++ b/net/url_request/url_request_ftp_job.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "net/url_request/url_request_new_ftp_job.h" +#include "net/url_request/url_request_ftp_job.h" #include "base/compiler_specific.h" #include "base/message_loop.h" @@ -15,22 +15,22 @@ #include "net/url_request/url_request_context.h" #include "net/url_request/url_request_error_job.h" -URLRequestNewFtpJob::URLRequestNewFtpJob(URLRequest* request) +URLRequestFtpJob::URLRequestFtpJob(URLRequest* request) : URLRequestJob(request), ALLOW_THIS_IN_INITIALIZER_LIST( - start_callback_(this, &URLRequestNewFtpJob::OnStartCompleted)), + start_callback_(this, &URLRequestFtpJob::OnStartCompleted)), ALLOW_THIS_IN_INITIALIZER_LIST( - read_callback_(this, &URLRequestNewFtpJob::OnReadCompleted)), + read_callback_(this, &URLRequestFtpJob::OnReadCompleted)), read_in_progress_(false), context_(request->context()) { } -URLRequestNewFtpJob::~URLRequestNewFtpJob() { +URLRequestFtpJob::~URLRequestFtpJob() { } // static -URLRequestJob* URLRequestNewFtpJob::Factory(URLRequest* request, - const std::string& scheme) { +URLRequestJob* URLRequestFtpJob::Factory(URLRequest* request, + const std::string& scheme) { DCHECK_EQ(scheme, "ftp"); int port = request->url().IntPort(); @@ -40,10 +40,10 @@ URLRequestJob* URLRequestNewFtpJob::Factory(URLRequest* request, DCHECK(request->context()); DCHECK(request->context()->ftp_transaction_factory()); - return new URLRequestNewFtpJob(request); + return new URLRequestFtpJob(request); } -bool URLRequestNewFtpJob::GetMimeType(std::string* mime_type) const { +bool URLRequestFtpJob::GetMimeType(std::string* mime_type) const { if (transaction_->GetResponseInfo()->is_directory_listing) { *mime_type = "text/vnd.chromium.ftp-dir"; return true; @@ -51,25 +51,25 @@ bool URLRequestNewFtpJob::GetMimeType(std::string* mime_type) const { return false; } -void URLRequestNewFtpJob::Start() { +void URLRequestFtpJob::Start() { DCHECK(!transaction_.get()); request_info_.url = request_->url(); StartTransaction(); } -void URLRequestNewFtpJob::Kill() { +void URLRequestFtpJob::Kill() { if (!transaction_.get()) return; DestroyTransaction(); URLRequestJob::Kill(); } -net::LoadState URLRequestNewFtpJob::GetLoadState() const { +net::LoadState URLRequestFtpJob::GetLoadState() const { return transaction_.get() ? transaction_->GetLoadState() : net::LOAD_STATE_IDLE; } -bool URLRequestNewFtpJob::NeedsAuth() { +bool URLRequestFtpJob::NeedsAuth() { // Note that we only have to worry about cases where an actual FTP server // requires auth (and not a proxy), because connecting to FTP via proxy // effectively means the browser communicates via HTTP, and uses HTTP's @@ -77,7 +77,7 @@ bool URLRequestNewFtpJob::NeedsAuth() { return server_auth_ && server_auth_->state == net::AUTH_STATE_NEED_AUTH; } -void URLRequestNewFtpJob::GetAuthChallengeInfo( +void URLRequestFtpJob::GetAuthChallengeInfo( scoped_refptr<net::AuthChallengeInfo>* result) { DCHECK((server_auth_ != NULL) && (server_auth_->state == net::AUTH_STATE_NEED_AUTH)); @@ -90,8 +90,8 @@ void URLRequestNewFtpJob::GetAuthChallengeInfo( result->swap(auth_info); } -void URLRequestNewFtpJob::SetAuth(const std::wstring& username, - const std::wstring& password) { +void URLRequestFtpJob::SetAuth(const std::wstring& username, + const std::wstring& password) { DCHECK(NeedsAuth()); server_auth_->state = net::AUTH_STATE_HAVE_AUTH; server_auth_->username = username; @@ -103,7 +103,7 @@ void URLRequestNewFtpJob::SetAuth(const std::wstring& username, RestartTransactionWithAuth(); } -void URLRequestNewFtpJob::CancelAuth() { +void URLRequestFtpJob::CancelAuth() { DCHECK(NeedsAuth()); server_auth_->state = net::AUTH_STATE_CANCELED; @@ -111,12 +111,12 @@ void URLRequestNewFtpJob::CancelAuth() { // there were no auth. Schedule this for later so that we don't cause // any recursing into the caller as a result of this call. MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( - this, &URLRequestNewFtpJob::OnStartCompleted, net::OK)); + this, &URLRequestFtpJob::OnStartCompleted, net::OK)); } -bool URLRequestNewFtpJob::ReadRawData(net::IOBuffer* buf, - int buf_size, - int *bytes_read) { +bool URLRequestFtpJob::ReadRawData(net::IOBuffer* buf, + int buf_size, + int *bytes_read) { DCHECK_NE(buf_size, 0); DCHECK(bytes_read); DCHECK(!read_in_progress_); @@ -136,7 +136,7 @@ bool URLRequestNewFtpJob::ReadRawData(net::IOBuffer* buf, return false; } -void URLRequestNewFtpJob::OnStartCompleted(int result) { +void URLRequestFtpJob::OnStartCompleted(int result) { // If the request was destroyed, then there is no more work to do. if (!request_ || !request_->delegate()) return; @@ -180,7 +180,7 @@ void URLRequestNewFtpJob::OnStartCompleted(int result) { } } -void URLRequestNewFtpJob::OnReadCompleted(int result) { +void URLRequestFtpJob::OnReadCompleted(int result) { read_in_progress_ = false; if (result == 0) { NotifyDone(URLRequestStatus()); @@ -193,7 +193,7 @@ void URLRequestNewFtpJob::OnReadCompleted(int result) { NotifyReadComplete(result); } -void URLRequestNewFtpJob::RestartTransactionWithAuth() { +void URLRequestFtpJob::RestartTransactionWithAuth() { DCHECK(server_auth_ && server_auth_->state == net::AUTH_STATE_HAVE_AUTH); // No matter what, we want to report our status as IO pending since we will @@ -207,10 +207,10 @@ void URLRequestNewFtpJob::RestartTransactionWithAuth() { return; MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( - this, &URLRequestNewFtpJob::OnStartCompleted, rv)); + this, &URLRequestFtpJob::OnStartCompleted, rv)); } -void URLRequestNewFtpJob::StartTransaction() { +void URLRequestFtpJob::StartTransaction() { // Create a transaction. DCHECK(!transaction_.get()); DCHECK(request_->context()); @@ -234,10 +234,10 @@ void URLRequestNewFtpJob::StartTransaction() { // The transaction started synchronously, but we need to notify the // URLRequest delegate via the message loop. MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( - this, &URLRequestNewFtpJob::OnStartCompleted, rv)); + this, &URLRequestFtpJob::OnStartCompleted, rv)); } -void URLRequestNewFtpJob::DestroyTransaction() { +void URLRequestFtpJob::DestroyTransaction() { DCHECK(transaction_.get()); transaction_.reset(); diff --git a/net/url_request/url_request_new_ftp_job.h b/net/url_request/url_request_ftp_job.h index 9b7a1a8..453543f 100644 --- a/net/url_request/url_request_new_ftp_job.h +++ b/net/url_request/url_request_ftp_job.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef NET_URL_REQUEST_URL_REQUEST_NEW_FTP_JOB_H_ -#define NET_URL_REQUEST_URL_REQUEST_NEW_FTP_JOB_H_ +#ifndef NET_URL_REQUEST_URL_REQUEST_FTP_JOB_H_ +#define NET_URL_REQUEST_URL_REQUEST_FTP_JOB_H_ #include <string> @@ -21,10 +21,10 @@ struct list_state; // A URLRequestJob subclass that is built on top of FtpTransaction. It // provides an implementation for FTP. -class URLRequestNewFtpJob : public URLRequestJob { +class URLRequestFtpJob : public URLRequestJob { public: - explicit URLRequestNewFtpJob(URLRequest* request); + explicit URLRequestFtpJob(URLRequest* request); static URLRequestJob* Factory(URLRequest* request, const std::string& scheme); @@ -32,7 +32,7 @@ class URLRequestNewFtpJob : public URLRequestJob { virtual bool GetMimeType(std::string* mime_type) const; private: - virtual ~URLRequestNewFtpJob(); + virtual ~URLRequestFtpJob(); // URLRequestJob methods: virtual void Start(); @@ -62,8 +62,8 @@ class URLRequestNewFtpJob : public URLRequestJob { net::FtpRequestInfo request_info_; scoped_ptr<net::FtpTransaction> transaction_; - net::CompletionCallbackImpl<URLRequestNewFtpJob> start_callback_; - net::CompletionCallbackImpl<URLRequestNewFtpJob> read_callback_; + net::CompletionCallbackImpl<URLRequestFtpJob> start_callback_; + net::CompletionCallbackImpl<URLRequestFtpJob> read_callback_; bool read_in_progress_; @@ -73,7 +73,7 @@ class URLRequestNewFtpJob : public URLRequestJob { // before us. scoped_refptr<URLRequestContext> context_; - DISALLOW_COPY_AND_ASSIGN(URLRequestNewFtpJob); + DISALLOW_COPY_AND_ASSIGN(URLRequestFtpJob); }; -#endif // NET_URL_REQUEST_URL_REQUEST_NEW_FTP_JOB_H_ +#endif // NET_URL_REQUEST_URL_REQUEST_FTP_JOB_H_ diff --git a/net/url_request/url_request_job_manager.cc b/net/url_request/url_request_job_manager.cc index 7cd934e..0615280 100644 --- a/net/url_request/url_request_job_manager.cc +++ b/net/url_request/url_request_job_manager.cc @@ -14,7 +14,7 @@ #include "net/url_request/url_request_data_job.h" #include "net/url_request/url_request_error_job.h" #include "net/url_request/url_request_file_job.h" -#include "net/url_request/url_request_new_ftp_job.h" +#include "net/url_request/url_request_ftp_job.h" #include "net/url_request/url_request_http_job.h" // The built-in set of protocol factories @@ -31,7 +31,7 @@ static const SchemeToFactory kBuiltinFactories[] = { { "http", URLRequestHttpJob::Factory }, { "https", URLRequestHttpJob::Factory }, { "file", URLRequestFileJob::Factory }, - { "ftp", URLRequestNewFtpJob::Factory }, + { "ftp", URLRequestFtpJob::Factory }, { "about", URLRequestAboutJob::Factory }, { "data", URLRequestDataJob::Factory }, }; |