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

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

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.h
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBValue.h b/third_party/WebKit/Source/modules/indexeddb/IDBValue.h
index a0be459aaa9be7b3c69a69b5be173627d230c28e..ef6ae3c7f892b2867f974820b3cc6ab3df845c7a 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBValue.h
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBValue.h
@@ -10,6 +10,7 @@
#include "modules/indexeddb/IDBKey.h"
#include "modules/indexeddb/IDBKeyPath.h"
#include "platform/SharedBuffer.h"
+#include "platform/wtf/PassRefPtr.h"
#include "platform/wtf/RefPtr.h"
#include "public/platform/WebVector.h"
@@ -27,6 +28,12 @@ class MODULES_EXPORT IDBValue final : public RefCounted<IDBValue> {
static PassRefPtr<IDBValue> Create(const IDBValue*,
IDBKey*,
const IDBKeyPath&);
+ // Used by IDBValueUnwrapper and its tests.
+ static PassRefPtr<IDBValue> Create(
+ PassRefPtr<SharedBuffer> unwrapped_data,
+ std::unique_ptr<Vector<RefPtr<BlobDataHandle>>>,
+ std::unique_ptr<Vector<WebBlobInfo>>);
+
~IDBValue();
bool IsNull() const;
@@ -37,6 +44,8 @@ class MODULES_EXPORT IDBValue final : public RefCounted<IDBValue> {
const IDBKeyPath& KeyPath() const { return key_path_; }
private:
+ friend class IDBValueUnwrapper;
+
IDBValue();
IDBValue(const WebIDBValue&, v8::Isolate*);
IDBValue(PassRefPtr<SharedBuffer>,
@@ -44,6 +53,9 @@ class MODULES_EXPORT IDBValue final : public RefCounted<IDBValue> {
IDBKey*,
const IDBKeyPath&);
IDBValue(const IDBValue*, IDBKey*, const IDBKeyPath&);
+ IDBValue(PassRefPtr<SharedBuffer> unwrapped_data,
+ std::unique_ptr<Vector<RefPtr<BlobDataHandle>>>,
+ std::unique_ptr<Vector<WebBlobInfo>>);
// Keep this private to prevent new refs because we manually bookkeep the
// memory to V8.

Powered by Google App Engine
This is Rietveld 408576698