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

Unified Diff: net/ftp/ftp_network_transaction.cc

Issue 15829004: Update net/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: license twerk Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/ftp/ftp_network_layer.cc ('k') | net/http/http_auth_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ftp/ftp_network_transaction.cc
diff --git a/net/ftp/ftp_network_transaction.cc b/net/ftp/ftp_network_transaction.cc
index f218ae1af47f30fd6038ca427167c019b3ce351f..0cf42c331946fa0c797dd35eb3067cbff114a23a 100644
--- a/net/ftp/ftp_network_transaction.cc
+++ b/net/ftp/ftp_network_transaction.cc
@@ -339,7 +339,7 @@ void FtpNetworkTransaction::ResetStateForRestart() {
ctrl_response_buffer_.reset(new FtpCtrlResponseBuffer(net_log_));
read_data_buf_ = NULL;
read_data_buf_len_ = 0;
- if (write_buf_)
+ if (write_buf_.get())
write_buf_->SetOffset(0);
last_error_ = OK;
data_connection_port_ = 0;
@@ -459,8 +459,8 @@ int FtpNetworkTransaction::SendFtpCommand(const std::string& command,
// which responses are for which command.
DCHECK(!ctrl_response_buffer_->ResponseAvailable());
- DCHECK(!write_command_buf_);
- DCHECK(!write_buf_);
+ DCHECK(!write_command_buf_.get());
+ DCHECK(!write_buf_.get());
if (!IsValidFTPCommandString(command)) {
// Callers should validate the command themselves and return a more specific
@@ -472,7 +472,7 @@ int FtpNetworkTransaction::SendFtpCommand(const std::string& command,
command_sent_ = cmd;
write_command_buf_ = new IOBufferWithSize(command.length() + 2);
- write_buf_ = new DrainableIOBuffer(write_command_buf_,
+ write_buf_ = new DrainableIOBuffer(write_command_buf_.get(),
write_command_buf_->size());
memcpy(write_command_buf_->data(), command.data(), command.length());
memcpy(write_command_buf_->data() + command.length(), kCRLF, 2);
@@ -697,7 +697,7 @@ int FtpNetworkTransaction::DoCtrlConnectComplete(int result) {
int FtpNetworkTransaction::DoCtrlRead() {
next_state_ = STATE_CTRL_READ_COMPLETE;
- return ctrl_socket_->Read(read_ctrl_buf_, kCtrlBufLen, io_callback_);
+ return ctrl_socket_->Read(read_ctrl_buf_.get(), kCtrlBufLen, io_callback_);
}
int FtpNetworkTransaction::DoCtrlReadComplete(int result) {
@@ -728,9 +728,8 @@ int FtpNetworkTransaction::DoCtrlReadComplete(int result) {
int FtpNetworkTransaction::DoCtrlWrite() {
next_state_ = STATE_CTRL_WRITE_COMPLETE;
- return ctrl_socket_->Write(write_buf_,
- write_buf_->BytesRemaining(),
- io_callback_);
+ return ctrl_socket_->Write(
+ write_buf_.get(), write_buf_->BytesRemaining(), io_callback_);
}
int FtpNetworkTransaction::DoCtrlWriteComplete(int result) {
@@ -1283,7 +1282,7 @@ int FtpNetworkTransaction::DoDataConnectComplete(int result) {
}
int FtpNetworkTransaction::DoDataRead() {
- DCHECK(read_data_buf_);
+ DCHECK(read_data_buf_.get());
DCHECK_GT(read_data_buf_len_, 0);
if (data_socket_ == NULL || !data_socket_->IsConnected()) {
@@ -1304,7 +1303,8 @@ int FtpNetworkTransaction::DoDataRead() {
next_state_ = STATE_DATA_READ_COMPLETE;
read_data_buf_->data()[0] = 0;
- return data_socket_->Read(read_data_buf_, read_data_buf_len_, io_callback_);
+ return data_socket_->Read(
+ read_data_buf_.get(), read_data_buf_len_, io_callback_);
}
int FtpNetworkTransaction::DoDataReadComplete(int result) {
« no previous file with comments | « net/ftp/ftp_network_layer.cc ('k') | net/http/http_auth_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698