| Index: storage/browser/blob/blob_registry_impl.h
|
| diff --git a/storage/browser/blob/blob_registry_impl.h b/storage/browser/blob/blob_registry_impl.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..c9ec6e53c83eab1806a658becb3cb78f59335964
|
| --- /dev/null
|
| +++ b/storage/browser/blob/blob_registry_impl.h
|
| @@ -0,0 +1,83 @@
|
| +// 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.
|
| +
|
| +#ifndef STORAGE_BROWSER_BLOB_BLOB_REGISTRY_IMPL_H_
|
| +#define STORAGE_BROWSER_BLOB_BLOB_REGISTRY_IMPL_H_
|
| +
|
| +#include "mojo/public/cpp/bindings/binding_set.h"
|
| +#include "services/service_manager/public/cpp/bind_source_info.h"
|
| +#include "storage/browser/blob/blob_memory_controller.h"
|
| +#include "storage/browser/storage_browser_export.h"
|
| +#include "third_party/WebKit/public/platform/blobs.mojom.h"
|
| +
|
| +namespace storage {
|
| +
|
| +class BlobDataBuilder;
|
| +class BlobStorageContext;
|
| +
|
| +class STORAGE_EXPORT BlobRegistryImpl : public mojom::BlobRegistry {
|
| + public:
|
| + explicit BlobRegistryImpl(BlobStorageContext* context);
|
| + ~BlobRegistryImpl() override;
|
| +
|
| + void Bind(const service_manager::BindSourceInfo& source_info,
|
| + mojom::BlobRegistryRequest request);
|
| +
|
| + void Register(mojom::BlobRequest blob,
|
| + const std::string& uuid,
|
| + const std::string& content_type,
|
| + const std::string& content_disposition,
|
| + std::vector<mojom::DataElementPtr> elements,
|
| + RegisterCallback callback) override;
|
| + void DeprecatedGetBlob(const std::string& uuid,
|
| + mojom::BlobRequest blob) override;
|
| +
|
| + private:
|
| + void RegisterWithBlobUUIDs(mojom::BlobRequest blob,
|
| + const std::string& uuid,
|
| + const std::string& content_type,
|
| + const std::string& content_disposition,
|
| + std::vector<mojom::DataElementPtr> elements,
|
| + std::vector<std::string> blob_uuids,
|
| + RegisterCallback callback,
|
| + const std::string& next_blob);
|
| +
|
| + void OnReadyForDataStreams(
|
| + const std::string& uuid,
|
| + std::unique_ptr<BlobDataBuilder> builder,
|
| + std::list<std::pair<size_t, mojom::BytesProviderPtr>> future_data,
|
| + std::list<size_t> file_sizes,
|
| + BlobStatus status,
|
| + std::vector<BlobMemoryController::FileCreationInfo> file_info);
|
| + void OnReadDatastream(const std::string& uuid,
|
| + base::OnceClosure next_read_callback,
|
| +
|
| + bool success);
|
| + void OnReadyForFileTransport(
|
| + const std::string& uuid,
|
| + std::unique_ptr<BlobDataBuilder> builder,
|
| + std::list<std::pair<size_t, mojom::BytesProviderPtr>> future_data,
|
| + std::list<size_t> file_sizes,
|
| + BlobStatus status,
|
| + std::vector<BlobMemoryController::FileCreationInfo> file_info);
|
| +
|
| + void OnDataStreamDone(const std::string& uuid);
|
| + void OnFileDone(const std::string& uuid,
|
| + BlobDataBuilder* builder,
|
| + size_t item_index,
|
| + mojom::BytesProviderPtr ptr,
|
| + const scoped_refptr<ShareableFileReference>& file_reference,
|
| + base::Optional<base::Time> time_file_modified);
|
| +
|
| + BlobStorageContext* context_;
|
| +
|
| + mojo::BindingSet<mojom::BlobRegistry> bindings_;
|
| +
|
| + base::WeakPtrFactory<BlobRegistryImpl> weak_ptr_factory_;
|
| + DISALLOW_COPY_AND_ASSIGN(BlobRegistryImpl);
|
| +};
|
| +
|
| +} // namespace storage
|
| +
|
| +#endif // STORAGE_BROWSER_BLOB_BLOB_REGISTRY_IMPL_H_
|
|
|