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

Side by Side Diff: net/socket/buffered_write_stream_socket.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, 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/server/http_server.cc ('k') | net/socket/client_socket_factory.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/socket/buffered_write_stream_socket.h" 5 #include "net/socket/buffered_write_stream_socket.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "net/base/io_buffer.h" 10 #include "net/base/io_buffer.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 NextProto BufferedWriteStreamSocket::GetNegotiatedProtocol() const { 118 NextProto BufferedWriteStreamSocket::GetNegotiatedProtocol() const {
119 return wrapped_socket_->GetNegotiatedProtocol(); 119 return wrapped_socket_->GetNegotiatedProtocol();
120 } 120 }
121 121
122 bool BufferedWriteStreamSocket::GetSSLInfo(SSLInfo* ssl_info) { 122 bool BufferedWriteStreamSocket::GetSSLInfo(SSLInfo* ssl_info) {
123 return wrapped_socket_->GetSSLInfo(ssl_info); 123 return wrapped_socket_->GetSSLInfo(ssl_info);
124 } 124 }
125 125
126 void BufferedWriteStreamSocket::DoDelayedWrite() { 126 void BufferedWriteStreamSocket::DoDelayedWrite() {
127 int result = wrapped_socket_->Write( 127 int result = wrapped_socket_->Write(
128 io_buffer_, io_buffer_->RemainingCapacity(), 128 io_buffer_.get(),
129 io_buffer_->RemainingCapacity(),
129 base::Bind(&BufferedWriteStreamSocket::OnIOComplete, 130 base::Bind(&BufferedWriteStreamSocket::OnIOComplete,
130 base::Unretained(this))); 131 base::Unretained(this)));
131 if (result == ERR_IO_PENDING) { 132 if (result == ERR_IO_PENDING) {
132 callback_pending_ = true; 133 callback_pending_ = true;
133 wrapped_write_in_progress_ = true; 134 wrapped_write_in_progress_ = true;
134 } else { 135 } else {
135 OnIOComplete(result); 136 OnIOComplete(result);
136 } 137 }
137 } 138 }
138 139
(...skipping 12 matching lines...) Expand all
151 io_buffer_->set_offset(io_buffer_->offset() + result); 152 io_buffer_->set_offset(io_buffer_->offset() + result);
152 if (io_buffer_->RemainingCapacity()) { 153 if (io_buffer_->RemainingCapacity()) {
153 DoDelayedWrite(); 154 DoDelayedWrite();
154 } else { 155 } else {
155 io_buffer_->SetCapacity(0); 156 io_buffer_->SetCapacity(0);
156 } 157 }
157 } 158 }
158 } 159 }
159 160
160 } // namespace net 161 } // namespace net
OLDNEW
« no previous file with comments | « net/server/http_server.cc ('k') | net/socket/client_socket_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698