summaryrefslogtreecommitdiff
path: root/chromium/net/third_party/quiche/src/quiche/spdy/core/array_output_buffer.cc
blob: 8cebea7c60cf3fd9bd7c64d6ecb699ea017b895d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "quiche/spdy/core/array_output_buffer.h"

namespace spdy {

void ArrayOutputBuffer::Next(char** data, int* size) {
  *data = current_;
  *size = capacity_ > 0 ? capacity_ : 0;
}

void ArrayOutputBuffer::AdvanceWritePtr(int64_t count) {
  current_ += count;
  capacity_ -= count;
}

uint64_t ArrayOutputBuffer::BytesFree() const {
  return capacity_;
}

}  // namespace spdy