chromium/components/cronet/native/io_buffer_with_cronet_buffer.h

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_CRONET_NATIVE_IO_BUFFER_WITH_CRONET_BUFFER_H_
#define COMPONENTS_CRONET_NATIVE_IO_BUFFER_WITH_CRONET_BUFFER_H_

#include <memory>

#include "components/cronet/native/generated/cronet.idl_c.h"
#include "net/base/io_buffer.h"

namespace cronet {

// net::WrappedIOBuffer subclass for a buffer owned by a Cronet_Buffer.
// Keeps the Cronet_Buffer alive until destroyed or released.
// Uses WrappedIOBuffer because data() is owned by the Cronet_Buffer.
class IOBufferWithCronet_Buffer : public net::WrappedIOBuffer {};

// Represents a Cronet_Buffer backed by a net::IOBuffer. Keeps both the
// net::IOBuffer and the Cronet_Buffer object alive until destroyed.
class Cronet_BufferWithIOBuffer {};

}  // namespace cronet

#endif  // COMPONENTS_CRONET_NATIVE_IO_BUFFER_WITH_CRONET_BUFFER_H_