Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(745)

Unified Diff: third_party/WebKit/Source/modules/indexeddb/IDBValue.cpp

Issue 2822453003: Wrap large IndexedDB values into Blobs before writing to LevelDB. (Closed)
Patch Set: Addressed last round of feedback. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/indexeddb/IDBValue.cpp
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBValue.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBValue.cpp
index 0b9f5c880a9b29684c7c84ab984c92cfa426f63d..d0d166935a0c1519484f83132c75546f159e2992 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBValue.cpp
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBValue.cpp
@@ -60,6 +60,13 @@ IDBValue::IDBValue(const IDBValue* value,
}
}
+IDBValue::IDBValue(PassRefPtr<SharedBuffer> unwrapped_data,
+ std::unique_ptr<Vector<RefPtr<BlobDataHandle>>> blob_data,
+ std::unique_ptr<Vector<WebBlobInfo>> blob_info)
+ : data_(std::move(unwrapped_data)),
+ blob_data_(std::move(blob_data)),
+ blob_info_(std::move(blob_info)) {}
+
IDBValue::~IDBValue() {
if (isolate_)
isolate_->AdjustAmountOfExternalAllocatedMemory(-external_allocated_size_);
@@ -80,6 +87,14 @@ PassRefPtr<IDBValue> IDBValue::Create(const IDBValue* value,
return AdoptRef(new IDBValue(value, primary_key, key_path));
}
+PassRefPtr<IDBValue> IDBValue::Create(
+ PassRefPtr<SharedBuffer> unwrapped_data,
+ std::unique_ptr<Vector<RefPtr<BlobDataHandle>>> blob_data,
+ std::unique_ptr<Vector<WebBlobInfo>> blob_info) {
+ return AdoptRef(new IDBValue(std::move(unwrapped_data), std::move(blob_data),
+ std::move(blob_info)));
+}
+
Vector<String> IDBValue::GetUUIDs() const {
Vector<String> uuids;
uuids.ReserveCapacity(blob_info_->size());
« no previous file with comments | « third_party/WebKit/Source/modules/indexeddb/IDBValue.h ('k') | third_party/WebKit/Source/modules/indexeddb/IDBValueWrapping.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698