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

Side by Side Diff: net/ftp/ftp_network_transaction.cc

Issue 125107: * Move the global "DnsResolutionObserver" code depended on by DNS prefetcher,... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Address jar's comments Created 11 years, 6 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/base/tcp_pinger_unittest.cc ('k') | net/http/http_network_transaction.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) 2008 The Chromium Authors. All rights reserved. Use of this 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the 2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file. 3 // LICENSE file.
4 4
5 #include "net/ftp/ftp_network_transaction.h" 5 #include "net/ftp/ftp_network_transaction.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "net/base/client_socket.h" 9 #include "net/base/client_socket.h"
10 #include "net/base/client_socket_factory.h" 10 #include "net/base/client_socket_factory.h"
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 332
333 int FtpNetworkTransaction::DoCtrlResolveHost() { 333 int FtpNetworkTransaction::DoCtrlResolveHost() {
334 next_state_ = STATE_CTRL_RESOLVE_HOST_COMPLETE; 334 next_state_ = STATE_CTRL_RESOLVE_HOST_COMPLETE;
335 335
336 std::string host; 336 std::string host;
337 int port; 337 int port;
338 338
339 host = request_->url.host(); 339 host = request_->url.host();
340 port = request_->url.EffectiveIntPort(); 340 port = request_->url.EffectiveIntPort();
341 341
342 DidStartDnsResolution(host, this); 342 HostResolver::RequestInfo info(host, port);
343 return resolver_.Resolve(host, port, &addresses_, &io_callback_); 343 // No known referrer.
344 return resolver_.Resolve(info, &addresses_, &io_callback_);
344 } 345 }
345 346
346 int FtpNetworkTransaction::DoCtrlResolveHostComplete(int result) { 347 int FtpNetworkTransaction::DoCtrlResolveHostComplete(int result) {
347 bool ok = (result == OK); 348 bool ok = (result == OK);
348 DidFinishDnsResolutionWithStatus(ok, GURL(), this);
349 if (ok) { 349 if (ok) {
350 next_state_ = STATE_CTRL_CONNECT; 350 next_state_ = STATE_CTRL_CONNECT;
351 return result; 351 return result;
352 } 352 }
353 return ERR_FAILED; 353 return ERR_FAILED;
354 } 354 }
355 355
356 int FtpNetworkTransaction::DoCtrlConnect() { 356 int FtpNetworkTransaction::DoCtrlConnect() {
357 next_state_ = STATE_CTRL_CONNECT_COMPLETE; 357 next_state_ = STATE_CTRL_CONNECT_COMPLETE;
358 ctrl_socket_.reset(socket_factory_->CreateTCPClientSocket(addresses_)); 358 ctrl_socket_.reset(socket_factory_->CreateTCPClientSocket(addresses_));
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 } 825 }
826 826
827 // Data Connection 827 // Data Connection
828 828
829 int FtpNetworkTransaction::DoDataResolveHost() { 829 int FtpNetworkTransaction::DoDataResolveHost() {
830 if (data_socket_ != NULL && data_socket_->IsConnected()) 830 if (data_socket_ != NULL && data_socket_->IsConnected())
831 data_socket_->Disconnect(); 831 data_socket_->Disconnect();
832 832
833 next_state_ = STATE_DATA_RESOLVE_HOST_COMPLETE; 833 next_state_ = STATE_DATA_RESOLVE_HOST_COMPLETE;
834 834
835 DidStartDnsResolution(data_connection_ip_, this); 835 HostResolver::RequestInfo info(data_connection_ip_,
836 return resolver_.Resolve(data_connection_ip_, data_connection_port_, 836 data_connection_port_);
837 &addresses_, &io_callback_); 837 // No known referrer.
838 return resolver_.Resolve(info, &addresses_, &io_callback_);
838 } 839 }
839 840
840 int FtpNetworkTransaction::DoDataResolveHostComplete(int result) { 841 int FtpNetworkTransaction::DoDataResolveHostComplete(int result) {
841 bool ok = (result == OK); 842 bool ok = (result == OK);
842 DidFinishDnsResolutionWithStatus(ok, GURL(), this);
843 if (ok) { 843 if (ok) {
844 next_state_ = STATE_DATA_CONNECT; 844 next_state_ = STATE_DATA_CONNECT;
845 return result; 845 return result;
846 } 846 }
847 return ERR_FAILED; 847 return ERR_FAILED;
848 } 848 }
849 849
850 int FtpNetworkTransaction::DoDataConnect() { 850 int FtpNetworkTransaction::DoDataConnect() {
851 next_state_ = STATE_DATA_CONNECT_COMPLETE; 851 next_state_ = STATE_DATA_CONNECT_COMPLETE;
852 data_socket_.reset(socket_factory_->CreateTCPClientSocket(addresses_)); 852 data_socket_.reset(socket_factory_->CreateTCPClientSocket(addresses_));
(...skipping 19 matching lines...) Expand all
872 &io_callback_); 872 &io_callback_);
873 } 873 }
874 874
875 int FtpNetworkTransaction::DoDataReadComplete(int result) { 875 int FtpNetworkTransaction::DoDataReadComplete(int result) {
876 DLOG(INFO) << read_data_buf_->data(); // The read_data_buf_ is NULL 876 DLOG(INFO) << read_data_buf_->data(); // The read_data_buf_ is NULL
877 // terminated string. 877 // terminated string.
878 return result; 878 return result;
879 } 879 }
880 880
881 } // namespace net 881 } // namespace net
OLDNEW
« no previous file with comments | « net/base/tcp_pinger_unittest.cc ('k') | net/http/http_network_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698