OLD | NEW |
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/message_loop.h" |
10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
11 #include "net/base/net_errors.h" | 11 #include "net/base/net_errors.h" |
12 | 12 |
13 namespace net { | 13 namespace net { |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 void AppendBuffer(GrowableIOBuffer* dst, IOBuffer* src, int src_len) { | 17 void AppendBuffer(GrowableIOBuffer* dst, IOBuffer* src, int src_len) { |
18 int old_capacity = dst->capacity(); | 18 int old_capacity = dst->capacity(); |
19 dst->SetCapacity(old_capacity + src_len); | 19 dst->SetCapacity(old_capacity + src_len); |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 io_buffer_->set_offset(io_buffer_->offset() + result); | 152 io_buffer_->set_offset(io_buffer_->offset() + result); |
153 if (io_buffer_->RemainingCapacity()) { | 153 if (io_buffer_->RemainingCapacity()) { |
154 DoDelayedWrite(); | 154 DoDelayedWrite(); |
155 } else { | 155 } else { |
156 io_buffer_->SetCapacity(0); | 156 io_buffer_->SetCapacity(0); |
157 } | 157 } |
158 } | 158 } |
159 } | 159 } |
160 | 160 |
161 } // namespace net | 161 } // namespace net |
OLD | NEW |