OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/spdy/array_output_buffer.h" | 5 #include "net/spdy/core/array_output_buffer.h" |
6 | 6 |
7 namespace net { | 7 namespace net { |
8 | 8 |
9 void ArrayOutputBuffer::Next(char** data, int* size) { | 9 void ArrayOutputBuffer::Next(char** data, int* size) { |
10 *data = current_; | 10 *data = current_; |
11 *size = capacity_ > 0 ? capacity_ : 0; | 11 *size = capacity_ > 0 ? capacity_ : 0; |
12 } | 12 } |
13 | 13 |
14 void ArrayOutputBuffer::AdvanceWritePtr(int64_t count) { | 14 void ArrayOutputBuffer::AdvanceWritePtr(int64_t count) { |
15 current_ += count; | 15 current_ += count; |
16 capacity_ -= count; | 16 capacity_ -= count; |
17 } | 17 } |
18 | 18 |
19 uint64_t ArrayOutputBuffer::BytesFree() const { | 19 uint64_t ArrayOutputBuffer::BytesFree() const { |
20 return capacity_; | 20 return capacity_; |
21 } | 21 } |
22 | 22 |
23 } // namespace net | 23 } // namespace net |
OLD | NEW |