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

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

Issue 344026: Add LoadLog to ClientSocket::Connect(). (Closed)
Patch Set: Minor build fixups and fixed mac bug. Created 11 years, 1 month 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/flip/flip_session.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/connection_type_histograms.h" 9 #include "net/base/connection_type_histograms.h"
10 #include "net/base/escape.h" 10 #include "net/base/escape.h"
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 497
498 int FtpNetworkTransaction::DoCtrlResolveHostComplete(int result) { 498 int FtpNetworkTransaction::DoCtrlResolveHostComplete(int result) {
499 if (result == OK) 499 if (result == OK)
500 next_state_ = STATE_CTRL_CONNECT; 500 next_state_ = STATE_CTRL_CONNECT;
501 return result; 501 return result;
502 } 502 }
503 503
504 int FtpNetworkTransaction::DoCtrlConnect() { 504 int FtpNetworkTransaction::DoCtrlConnect() {
505 next_state_ = STATE_CTRL_CONNECT_COMPLETE; 505 next_state_ = STATE_CTRL_CONNECT_COMPLETE;
506 ctrl_socket_.reset(socket_factory_->CreateTCPClientSocket(addresses_)); 506 ctrl_socket_.reset(socket_factory_->CreateTCPClientSocket(addresses_));
507 return ctrl_socket_->Connect(&io_callback_); 507 return ctrl_socket_->Connect(&io_callback_, load_log_);
508 } 508 }
509 509
510 int FtpNetworkTransaction::DoCtrlConnectComplete(int result) { 510 int FtpNetworkTransaction::DoCtrlConnectComplete(int result) {
511 if (result == OK) 511 if (result == OK)
512 next_state_ = STATE_CTRL_READ; 512 next_state_ = STATE_CTRL_READ;
513 return result; 513 return result;
514 } 514 }
515 515
516 int FtpNetworkTransaction::DoCtrlRead() { 516 int FtpNetworkTransaction::DoCtrlRead() {
517 next_state_ = STATE_CTRL_READ_COMPLETE; 517 next_state_ = STATE_CTRL_READ_COMPLETE;
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
1055 int FtpNetworkTransaction::DoDataConnect() { 1055 int FtpNetworkTransaction::DoDataConnect() {
1056 next_state_ = STATE_DATA_CONNECT_COMPLETE; 1056 next_state_ = STATE_DATA_CONNECT_COMPLETE;
1057 AddressList data_addresses; 1057 AddressList data_addresses;
1058 // TODO(phajdan.jr): Use exactly same IP address as the control socket. 1058 // TODO(phajdan.jr): Use exactly same IP address as the control socket.
1059 // If the DNS name resolves to several different IPs, and they are different 1059 // If the DNS name resolves to several different IPs, and they are different
1060 // physical servers, this will break. However, that configuration is very rare 1060 // physical servers, this will break. However, that configuration is very rare
1061 // in practice. 1061 // in practice.
1062 data_addresses.Copy(addresses_.head()); 1062 data_addresses.Copy(addresses_.head());
1063 data_addresses.SetPort(data_connection_port_); 1063 data_addresses.SetPort(data_connection_port_);
1064 data_socket_.reset(socket_factory_->CreateTCPClientSocket(data_addresses)); 1064 data_socket_.reset(socket_factory_->CreateTCPClientSocket(data_addresses));
1065 return data_socket_->Connect(&io_callback_); 1065 return data_socket_->Connect(&io_callback_, load_log_);
1066 } 1066 }
1067 1067
1068 int FtpNetworkTransaction::DoDataConnectComplete(int result) { 1068 int FtpNetworkTransaction::DoDataConnectComplete(int result) {
1069 if (retr_failed_) { 1069 if (retr_failed_) {
1070 next_state_ = STATE_CTRL_WRITE_CWD; 1070 next_state_ = STATE_CTRL_WRITE_CWD;
1071 } else { 1071 } else {
1072 next_state_ = STATE_CTRL_WRITE_SIZE; 1072 next_state_ = STATE_CTRL_WRITE_SIZE;
1073 } 1073 }
1074 return OK; 1074 return OK;
1075 } 1075 }
(...skipping 16 matching lines...) Expand all
1092 read_data_buf_->data()[0] = 0; 1092 read_data_buf_->data()[0] = 0;
1093 return data_socket_->Read(read_data_buf_, read_data_buf_len_, 1093 return data_socket_->Read(read_data_buf_, read_data_buf_len_,
1094 &io_callback_); 1094 &io_callback_);
1095 } 1095 }
1096 1096
1097 int FtpNetworkTransaction::DoDataReadComplete(int result) { 1097 int FtpNetworkTransaction::DoDataReadComplete(int result) {
1098 return result; 1098 return result;
1099 } 1099 }
1100 1100
1101 } // namespace net 1101 } // namespace net
OLDNEW
« no previous file with comments | « net/flip/flip_session.cc ('k') | net/http/http_network_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698