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

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

Issue 2694283002: IndexedDB: Added external memory counting for IDBValue. (Closed)
Patch Set: Created 3 years, 10 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 7fccf5615848f8db168373100619a96883d0b879..e536cc8159eaeeaba5125860751109713daef971 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBValue.h
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBValue.h
@@ -16,6 +16,7 @@
namespace blink {
class BlobDataHandle;
+class SerializedScriptValue;
class WebBlobInfo;
struct WebIDBValue;
@@ -30,7 +31,7 @@ class MODULES_EXPORT IDBValue final : public RefCounted<IDBValue> {
bool isNull() const;
Vector<String> getUUIDs() const;
- const SharedBuffer* data() const;
+ RefPtr<SerializedScriptValue> createSerializedValue() const;
Vector<WebBlobInfo>* blobInfo() const { return m_blobInfo.get(); }
const IDBKey* primaryKey() const { return m_primaryKey; }
const IDBKeyPath& keyPath() const { return m_keyPath; }
@@ -44,11 +45,14 @@ class MODULES_EXPORT IDBValue final : public RefCounted<IDBValue> {
const IDBKeyPath&);
IDBValue(const IDBValue*, IDBKey*, const IDBKeyPath&);
+ // Keep this private to prevent new refs because we manually bookkeep the
+ // memory to V8.
const RefPtr<SharedBuffer> m_data;
const std::unique_ptr<Vector<RefPtr<BlobDataHandle>>> m_blobData;
const std::unique_ptr<Vector<WebBlobInfo>> m_blobInfo;
const Persistent<IDBKey> m_primaryKey;
const IDBKeyPath m_keyPath;
+ int64_t m_externalAllocatedSize = 0;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698