chromium/components/cronet/native/upload_data_sink.cc

// 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.

#include "components/cronet/native/upload_data_sink.h"

#include <inttypes.h>
#include <utility>

#include "base/check_op.h"
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/strcat.h"
#include "base/strings/stringprintf.h"
#include "base/task/single_thread_task_runner.h"
#include "components/cronet/cronet_upload_data_stream.h"
#include "components/cronet/native/engine.h"
#include "components/cronet/native/generated/cronet.idl_impl_struct.h"
#include "components/cronet/native/include/cronet_c.h"
#include "components/cronet/native/io_buffer_with_cronet_buffer.h"
#include "components/cronet/native/runnables.h"
#include "components/cronet/native/url_request.h"
#include "net/base/io_buffer.h"

namespace cronet {

// This class is called by Cronet's network stack as an implementation of
// CronetUploadDataStream::Delegate, and forwards the calls along to
// Cronet_UploadDataSinkImpl on the embedder's executor.
// This class is always called on the network thread and is destroyed in
// OnUploadDataStreamDestroyed() callback.
class Cronet_UploadDataSinkImpl::NetworkTasks
    : public CronetUploadDataStream::Delegate {};

Cronet_UploadDataSinkImpl::NetworkTasks::NetworkTasks(
    Cronet_UploadDataSinkImpl* upload_data_sink,
    Cronet_Executor* upload_data_provider_executor)
    :{}

Cronet_UploadDataSinkImpl::NetworkTasks::~NetworkTasks() = default;

Cronet_UploadDataSinkImpl::Cronet_UploadDataSinkImpl(
    Cronet_UrlRequestImpl* url_request,
    Cronet_UploadDataProvider* upload_data_provider,
    Cronet_Executor* upload_data_provider_executor)
    :{}

Cronet_UploadDataSinkImpl::~Cronet_UploadDataSinkImpl() = default;

void Cronet_UploadDataSinkImpl::InitRequest(CronetURLRequest* request) {}

void Cronet_UploadDataSinkImpl::OnReadSucceeded(uint64_t bytes_read,
                                                bool final_chunk) {}

void Cronet_UploadDataSinkImpl::OnReadError(Cronet_String error_message) {}

void Cronet_UploadDataSinkImpl::OnRewindSucceeded() {}

void Cronet_UploadDataSinkImpl::OnRewindError(Cronet_String error_message) {}

void Cronet_UploadDataSinkImpl::InitializeUploadDataStream(
    base::WeakPtr<CronetUploadDataStream> upload_data_stream,
    scoped_refptr<base::SingleThreadTaskRunner> network_task_runner) {}

void Cronet_UploadDataSinkImpl::PostCloseToExecutor() {}

void Cronet_UploadDataSinkImpl::Read(scoped_refptr<net::IOBuffer> buffer,
                                     int buf_len) {}

void Cronet_UploadDataSinkImpl::Rewind() {}

void Cronet_UploadDataSinkImpl::Close() {}

void Cronet_UploadDataSinkImpl::CheckState(UserCallback expected_state) {}

void Cronet_UploadDataSinkImpl::NetworkTasks::InitializeOnNetworkThread(
    base::WeakPtr<CronetUploadDataStream> upload_data_stream) {}

void Cronet_UploadDataSinkImpl::NetworkTasks::Read(
    scoped_refptr<net::IOBuffer> buffer,
    int buf_len) {}

void Cronet_UploadDataSinkImpl::NetworkTasks::Rewind() {}

void Cronet_UploadDataSinkImpl::NetworkTasks::OnUploadDataStreamDestroyed() {}

void Cronet_UploadDataSinkImpl::NetworkTasks::PostTaskToExecutor(
    base::OnceClosure task) {}

}  // namespace cronet