#include "storage/browser/blob/blob_impl.h"
#include <limits>
#include <memory>
#include <utility>
#include <vector>
#include "base/containers/span.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/task/thread_pool.h"
#include "base/time/time.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "net/base/io_buffer.h"
#include "storage/browser/blob/blob_data_handle.h"
#include "storage/browser/blob/blob_data_item.h"
#include "storage/browser/blob/blob_data_snapshot.h"
#include "storage/browser/blob/blob_url_loader.h"
#include "storage/browser/blob/mojo_blob_reader.h"
namespace storage {
namespace {
class ReaderDelegate : public MojoBlobReader::Delegate { … };
class DataPipeGetterReaderDelegate : public MojoBlobReader::Delegate { … };
}
base::WeakPtr<BlobImpl> BlobImpl::Create(
std::unique_ptr<BlobDataHandle> handle,
mojo::PendingReceiver<blink::mojom::Blob> receiver) { … }
void BlobImpl::UpdateHandle(std::unique_ptr<BlobDataHandle> new_handle) { … }
void BlobImpl::Clone(mojo::PendingReceiver<blink::mojom::Blob> receiver) { … }
void BlobImpl::AsDataPipeGetter(
mojo::PendingReceiver<network::mojom::DataPipeGetter> receiver) { … }
void BlobImpl::ReadRange(
uint64_t offset,
uint64_t length,
mojo::ScopedDataPipeProducerHandle handle,
mojo::PendingRemote<blink::mojom::BlobReaderClient> client) { … }
void BlobImpl::ReadAll(
mojo::ScopedDataPipeProducerHandle handle,
mojo::PendingRemote<blink::mojom::BlobReaderClient> client) { … }
void BlobImpl::Load(
mojo::PendingReceiver<network::mojom::URLLoader> loader,
const std::string& method,
const net::HttpRequestHeaders& headers,
mojo::PendingRemote<network::mojom::URLLoaderClient> client) { … }
void BlobImpl::ReadSideData(ReadSideDataCallback callback) { … }
void BlobImpl::CaptureSnapshot(CaptureSnapshotCallback callback) { … }
void BlobImpl::GetInternalUUID(GetInternalUUIDCallback callback) { … }
void BlobImpl::Clone(
mojo::PendingReceiver<network::mojom::DataPipeGetter> receiver) { … }
void BlobImpl::Read(mojo::ScopedDataPipeProducerHandle handle,
ReadCallback callback) { … }
void BlobImpl::FlushForTesting() { … }
BlobImpl::BlobImpl(std::unique_ptr<BlobDataHandle> handle,
mojo::PendingReceiver<blink::mojom::Blob> receiver)
: … { … }
BlobImpl::~BlobImpl() = default;
void BlobImpl::OnMojoDisconnect() { … }
}