| Index: storage/browser/blob/blob_storage_context.h
|
| diff --git a/storage/browser/blob/blob_storage_context.h b/storage/browser/blob/blob_storage_context.h
|
| index fb593e4e47ed5109cfd499823e424f575cfb1a70..3a2ffcfba77c21b95aec4a9758ae6e44f84a210d 100644
|
| --- a/storage/browser/blob/blob_storage_context.h
|
| +++ b/storage/browser/blob/blob_storage_context.h
|
| @@ -5,14 +5,17 @@
|
| #ifndef STORAGE_BROWSER_BLOB_BLOB_STORAGE_CONTEXT_H_
|
| #define STORAGE_BROWSER_BLOB_BLOB_STORAGE_CONTEXT_H_
|
|
|
| +#include <list>
|
| #include <map>
|
| #include <string>
|
| #include <vector>
|
|
|
| #include "base/callback_forward.h"
|
| +#include "base/containers/mru_cache.h"
|
| #include "base/memory/ref_counted.h"
|
| #include "base/memory/weak_ptr.h"
|
| #include "storage/browser/blob/blob_data_handle.h"
|
| +#include "storage/browser/blob/blob_memory_controller.h"
|
| #include "storage/browser/blob/blob_storage_registry.h"
|
| #include "storage/browser/blob/internal_blob_data.h"
|
| #include "storage/browser/storage_browser_export.h"
|
| @@ -36,6 +39,7 @@ namespace storage {
|
| class BlobDataBuilder;
|
| class BlobDataItem;
|
| class BlobDataSnapshot;
|
| +class BlobMemoryController;
|
| class ShareableBlobDataItem;
|
|
|
| // This class handles the logistics of blob Storage within the browser process,
|
| @@ -46,6 +50,9 @@ class STORAGE_EXPORT BlobStorageContext
|
| : public base::SupportsWeakPtr<BlobStorageContext> {
|
| public:
|
| BlobStorageContext();
|
| + BlobStorageContext(bool enable_disk,
|
| + const base::FilePath& blob_storage_dir,
|
| + scoped_refptr<base::TaskRunner> file_runner);
|
| ~BlobStorageContext();
|
|
|
| scoped_ptr<BlobDataHandle> GetBlobDataFromUUID(const std::string& uuid);
|
| @@ -74,12 +81,9 @@ class STORAGE_EXPORT BlobStorageContext
|
|
|
| const BlobStorageRegistry& registry() { return registry_; }
|
|
|
| - private:
|
| - typedef BlobStorageRegistry::Entry BlobRegistryEntry;
|
| - friend class content::BlobStorageHost;
|
| - friend class content::BlobStorageContextTest;
|
| + protected:
|
| + friend class BlobAsyncBuilderHost;
|
| friend class BlobDataHandle::BlobDataHandleShared;
|
| - friend class ViewBlobInternalsJob;
|
|
|
| void BuildAndStoreBlob(const BlobDataBuilder& external_builder);
|
|
|
| @@ -91,6 +95,15 @@ class STORAGE_EXPORT BlobStorageContext
|
| const base::Callback<void(bool)>& done);
|
| // ##################################
|
|
|
| + private:
|
| + typedef BlobStorageRegistry::Entry BlobRegistryEntry;
|
| +
|
| + friend class content::BlobStorageHost;
|
| + friend class content::BlobStorageContextTest;
|
| + friend class ViewBlobInternalsJob;
|
| +
|
| + void BuildAndStoreBlob(BlobDataBuilder* external_builder);
|
| +
|
| // ### Methods called by BlobStorageHost ###
|
| void RegisterBlobUUID(const std::string& uuid);
|
| bool MaybeStartAsyncBlobTransfer(const std::string& uuid);
|
| @@ -132,12 +145,17 @@ class STORAGE_EXPORT BlobStorageContext
|
| uint64_t length,
|
| InternalBlobData::Builder* target_blob_data);
|
|
|
| + uint64_t GetAndIncrementItemId();
|
| + void UpdateItemsInRecents(BlobRegistryEntry* entry);
|
| +
|
| BlobStorageRegistry registry_;
|
| + BlobMemoryController memory_controller_;
|
| + uint64_t next_item_id_ = 0;
|
|
|
| // Used to keep track of how much memory is being utilized for blob data,
|
| // we count only the items of TYPE_DATA which are held in memory and not
|
| // items of TYPE_FILE.
|
| - size_t memory_usage_;
|
| + size_t memory_usage_ = 0;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(BlobStorageContext);
|
| };
|
|
|