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

Unified Diff: content/child/indexed_db/webidbcursor_impl.cc

Issue 924033003: IndexedDB: Ensure that blobs in unused prefetches are acked (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tweak store name Created 5 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: content/child/indexed_db/webidbcursor_impl.cc
diff --git a/content/child/indexed_db/webidbcursor_impl.cc b/content/child/indexed_db/webidbcursor_impl.cc
index c3d97ba3eca6e5254caa3f6c36ca37ae65fdef15..4f458050f824ea7970e6458641e89b1bab71381a 100644
--- a/content/child/indexed_db/webidbcursor_impl.cc
+++ b/content/child/indexed_db/webidbcursor_impl.cc
@@ -4,6 +4,7 @@
#include "content/child/indexed_db/webidbcursor_impl.h"
+#include <string>
#include <vector>
#include "content/child/indexed_db/indexed_db_dispatcher.h"
@@ -194,10 +195,22 @@ void WebIDBCursorImpl::ResetPrefetchCache() {
return;
}
+ // Ack any unused blobs.
+ std::vector<std::string> uuids;
+ for (const auto& blobs : prefetch_blob_info_) {
+ for (size_t i = 0, size = blobs.size(); i < size; ++i)
+ uuids.push_back(blobs[i].uuid().latin1());
+ }
+ if (!uuids.empty())
+ thread_safe_sender_->Send(new IndexedDBHostMsg_AckReceivedBlobs(uuids));
+
+ // Reset the back-end cursor.
IndexedDBDispatcher* dispatcher =
IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get());
dispatcher->RequestIDBCursorPrefetchReset(
used_prefetches_, prefetch_keys_.size(), ipc_cursor_id_);
+
+ // Reset the prefetch cache.
prefetch_keys_.clear();
prefetch_primary_keys_.clear();
prefetch_values_.clear();
« no previous file with comments | « content/browser/indexed_db/indexed_db_browsertest.cc ('k') | content/test/data/indexeddb/blob_did_ack_prefetch.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698