Chromium Code Reviews| Index: third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.cpp |
| diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.cpp |
| index 2022121aacc4b027b5b200a749a67e4ef3c6f685..7d9eca215848c614b4b1e83b87e054fa63e91579 100644 |
| --- a/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.cpp |
| +++ b/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.cpp |
| @@ -43,7 +43,9 @@ |
| #include "modules/indexeddb/IDBTracing.h" |
| #include "platform/Histogram.h" |
| #include "platform/SharedBuffer.h" |
| +#include "public/platform/Platform.h" |
| #include "public/platform/WebBlobInfo.h" |
| +#include "public/platform/WebBlobRegistry.h" |
| #include "public/platform/WebData.h" |
| #include "public/platform/WebVector.h" |
| #include "public/platform/modules/indexeddb/WebIDBKey.h" |
| @@ -506,6 +508,15 @@ IDBRequest* IDBObjectStore::put(ScriptState* script_state, |
| serialized_value->ToWireBytes(wire_bytes); |
| RefPtr<SharedBuffer> value_buffer = SharedBuffer::AdoptVector(wire_bytes); |
| + // Add blob refs |
| + blink::Platform* platform = blink::Platform::Current(); |
| + DCHECK(platform); |
| + blink::WebBlobRegistry* registry = platform->GetBlobRegistry(); |
| + DCHECK(registry); |
| + for (const WebBlobInfo& info : blob_info) { |
| + registry->AddBlobDataRef(info.Uuid()); |
|
michaeln
2017/04/21 01:46:10
Manual refcounting always makes me a little uneasy
|
| + } |
| + |
| BackendDB()->Put(transaction_->Id(), Id(), WebData(value_buffer), blob_info, |
| key, static_cast<WebIDBPutMode>(put_mode), |
| request->CreateWebCallbacks().release(), index_ids, |