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

Unified Diff: content/child/webblobregistry_impl.cc

Issue 895933007: [Storage] Blob items are now shared between blobs. Ready for disk swap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup and added one more histogram 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/webblobregistry_impl.cc
diff --git a/content/child/webblobregistry_impl.cc b/content/child/webblobregistry_impl.cc
index 7b4ec421eb6308bedc5254c3fd5861abcb141a20..3bece44e01aa03acc0194b38793e89c0301c8590 100644
--- a/content/child/webblobregistry_impl.cc
+++ b/content/child/webblobregistry_impl.cc
@@ -50,6 +50,13 @@ void WebBlobRegistryImpl::registerBlobData(
size_t i = 0;
WebBlobData::Item data_item;
while (data.itemAt(i++, data_item)) {
+ // NOTE: data_item.length == -1 when we want to use the whole file. This
+ // only happens when we are creating a file object in Blink, and the file
+ // object is the only item in the 'blob'. If we use that file blob to
+ // create another blob, it is sent here as a 'file' item and not a blob,
+ // and the correct size is populated.
+ // static_cast<uint64>(-1) == kuint64max, which is what DataElement uses
+ // to specificy "use the whole file".
if (data_item.length == 0) {
continue;
}

Powered by Google App Engine
This is Rietveld 408576698