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

Unified Diff: net/http/http_stream_parser.cc

Issue 8824006: Migrate net/socket/socket.h, net/socket/stream_socket.h to base::Bind(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 9 years 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/http/http_stream_parser.h ('k') | net/socket/client_socket_pool_base_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_stream_parser.cc
diff --git a/net/http/http_stream_parser.cc b/net/http/http_stream_parser.cc
index cd3c9faffd509ede4c495045c128e48b4f4515fe..8969d73ca87b63fe6d983eb17e58eed1bcf67c63 100644
--- a/net/http/http_stream_parser.cc
+++ b/net/http/http_stream_parser.cc
@@ -81,7 +81,9 @@ HttpStreamParser::HttpStreamParser(ClientSocketHandle* connection,
connection_(connection),
net_log_(net_log),
ALLOW_THIS_IN_INITIALIZER_LIST(
- io_callback_(this, &HttpStreamParser::OnIOComplete)),
+ io_callback_(
+ base::Bind(&HttpStreamParser::OnIOComplete,
+ base::Unretained(this)))),
chunk_length_(0),
chunk_length_without_encoding_(0),
sent_last_chunk_(false) {
@@ -314,7 +316,7 @@ int HttpStreamParser::DoSendHeaders(int result) {
}
result = connection_->socket()->Write(request_headers_,
bytes_remaining,
- &io_callback_);
+ io_callback_);
} else if (request_body_ != NULL &&
(request_body_->is_chunked() || request_body_->size())) {
io_state_ = STATE_SENDING_BODY;
@@ -331,7 +333,7 @@ int HttpStreamParser::DoSendBody(int result) {
if (chunk_length_) {
memmove(chunk_buf_->data(), chunk_buf_->data() + result, chunk_length_);
return connection_->socket()->Write(chunk_buf_, chunk_length_,
- &io_callback_);
+ io_callback_);
}
if (sent_last_chunk_) {
@@ -366,7 +368,7 @@ int HttpStreamParser::DoSendBody(int result) {
return ERR_IO_PENDING;
return connection_->socket()->Write(chunk_buf_, chunk_length_,
- &io_callback_);
+ io_callback_);
}
// Non-chunked request body.
@@ -375,7 +377,7 @@ int HttpStreamParser::DoSendBody(int result) {
if (!request_body_->eof()) {
int buf_len = static_cast<int>(request_body_->buf_len());
result = connection_->socket()->Write(request_body_->buf(), buf_len,
- &io_callback_);
+ io_callback_);
} else {
io_state_ = STATE_REQUEST_SENT;
}
@@ -395,7 +397,7 @@ int HttpStreamParser::DoReadHeaders() {
return connection_->socket()->Read(read_buf_,
read_buf_->RemainingCapacity(),
- &io_callback_);
+ io_callback_);
}
int HttpStreamParser::DoReadHeadersComplete(int result) {
@@ -526,7 +528,7 @@ int HttpStreamParser::DoReadBody() {
DCHECK_EQ(0, read_buf_->offset());
return connection_->socket()->Read(user_read_buf_, user_read_buf_len_,
- &io_callback_);
+ io_callback_);
}
int HttpStreamParser::DoReadBodyComplete(int result) {
« no previous file with comments | « net/http/http_stream_parser.h ('k') | net/socket/client_socket_pool_base_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698