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

Issue 2055053003: [BlobAsync] Disk support for blob storage (Closed)

Created:
4 years, 6 months ago by dmurph
Modified:
4 years ago
CC:
chromium-reviews, darin-cc_chromium.org, jam, kinuko+fileapi, nhiroki, tzik
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Blob] Disk support for blob storage. This is the final patch to enable disk support for Blob storage. This includes: * Saving large blobs to disk right away * Paging old blobs to disk The new system operates like the following: * Blobs are registered with metadata & descriptions of items in one message/call. * The async transport host asks the memory manager how it should transfer the data, and from that creates a BlobDataBuilder. * This builder is handed to the BlobStorageContext in BuildBlob, along with a callback that the transport host will wait for before kicking off transport. * The BuildBlob call immediately constructs the internal blob data with all ShareableBlobDataItems that will eventually be populated. This work includes: * Decomposing all blobs we depend upon and either copying over or creating new shareable items for partial data items. * The new shareable item data will be copied over after the dependent blob is complete, and we have enough memory for it. * This involves using the new BlobFlattener and BlobSlice stucts. * This results in us knowing the total amount of memory we need to build this blob (new memory + copies from other blobs). We ask the memory controller to reserve quota for these items in separate calls. * We now wait for the following before completing our blob: 1. Blobs that we referenced are finished building, 2. We have been granted memory quota for any copies from referenced blobs, and 3. We have been granted memory or disk quota for blob memory coming from the renderer. * When all of these conditions have been satisfied we finish the blob: 1. Perform any copies that we need to do from referenced blobs. 2. Change our state to DONE. 3. Report to listeners that we've finished constructing. New data stored: * We've combined error and states into one BlobStatus. * Building state has been consolidated into a BuildingState struct in InternalBlobData. * ShareableBlobDataItems now have state so the memory controller can keep track of which items to grant/release quota. STATUS: Debugging logging & lots of DCHECKs are present. BUG=375297, 612261

Patch Set 1 #

Patch Set 2 : PAging working! #

Patch Set 3 : fixes, working w/ Layout tests #

Total comments: 9

Patch Set 4 : Added back transport controller test, small cleanups #

Total comments: 24

Patch Set 5 : WIP don't review this one #

Patch Set 6 : comments, simplifications #

Total comments: 48

Patch Set 7 : comments, simplification of enums into ONE #

Total comments: 37

Patch Set 8 : halfway done with comments #

Patch Set 9 : comments #

Total comments: 77

Patch Set 10 : comments, new tests, bug fixes #

Patch Set 11 : rebase #

Total comments: 6

Patch Set 12 : build and browsertest fixes #

Total comments: 18

Patch Set 13 : More tests, got through half of the comments #

Patch Set 14 : Finished comments, added new pending enum state #

Total comments: 70

Patch Set 15 : comments, moved Entry to InternalBlobData #

Patch Set 16 : Fixed layout tests, cleaned up test visibility #

Total comments: 7

Patch Set 17 : BlobMemoryController refactor #

Patch Set 18 : Combined BlobSlice & BlobFlattener files, more comments, a little cleanup. #

Patch Set 19 : Combined BlobSlice & BlobFlattener files, more comments, a little cleanup. #

Total comments: 120

Patch Set 20 : memory controller pass #

Patch Set 21 : half of comments #

Total comments: 5

Patch Set 22 : Rebase w/ BlobMemoryController patch #

Patch Set 23 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3141 lines, -2188 lines) Patch
M content/browser/blob_storage/blob_async_builder_host_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 19 chunks +104 lines, -218 lines 0 comments Download
M content/browser/blob_storage/blob_dispatcher_host.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 4 chunks +12 lines, -26 lines 0 comments Download
M content/browser/blob_storage/blob_dispatcher_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 13 chunks +55 lines, -135 lines 0 comments Download
M content/browser/blob_storage/blob_dispatcher_host_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 36 chunks +217 lines, -342 lines 0 comments Download
A content/browser/blob_storage/blob_flattener_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +230 lines, -0 lines 0 comments Download
M content/browser/blob_storage/blob_memory_controller_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +2 lines, -3 lines 0 comments Download
M content/browser/blob_storage/blob_reader_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 7 chunks +33 lines, -9 lines 0 comments Download
A content/browser/blob_storage/blob_slice_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +228 lines, -0 lines 0 comments Download
M content/browser/blob_storage/blob_storage_context_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 19 chunks +418 lines, -94 lines 0 comments Download
M content/browser/blob_storage/blob_storage_registry_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 3 chunks +7 lines, -10 lines 0 comments Download
M content/browser/blob_storage/chrome_blob_storage_context.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 3 chunks +5 lines, -1 line 0 comments Download
M content/browser/blob_storage/chrome_blob_storage_context.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 4 chunks +65 lines, -5 lines 0 comments Download
M content/browser/service_worker/service_worker_url_request_job.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/service_worker/service_worker_url_request_job.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 8 chunks +82 lines, -106 lines 0 comments Download
M content/child/blob_storage/blob_consolidation.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +16 lines, -35 lines 0 comments Download
M content/child/blob_storage/blob_message_filter.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -4 lines 0 comments Download
M content/child/blob_storage/blob_message_filter.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +4 lines, -10 lines 0 comments Download
M content/child/blob_storage/blob_transport_controller.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 3 chunks +4 lines, -6 lines 0 comments Download
M content/child/blob_storage/blob_transport_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 9 chunks +20 lines, -31 lines 0 comments Download
M content/child/blob_storage/blob_transport_controller_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 6 chunks +12 lines, -18 lines 0 comments Download
M content/child/blob_storage/webblobregistry_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +2 lines, -0 lines 0 comments Download
M content/child/blob_storage/webblobregistry_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 3 chunks +2 lines, -3 lines 0 comments Download
M content/common/fileapi/webblob_messages.h View 1 2 3 4 5 6 3 chunks +8 lines, -15 lines 0 comments Download
M net/log/net_log_event_type_list.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -1 line 0 comments Download
M storage/browser/blob/blob_async_builder_host.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 6 chunks +73 lines, -96 lines 0 comments Download
M storage/browser/blob/blob_async_builder_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 3 chunks +363 lines, -306 lines 0 comments Download
M storage/browser/blob/blob_async_transport_request_builder.h View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
M storage/browser/blob/blob_async_transport_request_builder.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +0 lines, -20 lines 0 comments Download
M storage/browser/blob/blob_data_handle.h View 1 2 3 4 5 6 7 chunks +13 lines, -5 lines 0 comments Download
M storage/browser/blob/blob_data_handle.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 20 21 5 chunks +16 lines, -7 lines 0 comments Download
M storage/browser/blob/blob_data_item.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 2 chunks +2 lines, -0 lines 0 comments Download
M storage/browser/blob/blob_memory_controller.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 2 chunks +2 lines, -2 lines 0 comments Download
M storage/browser/blob/blob_memory_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +5 lines, -3 lines 0 comments Download
M storage/browser/blob/blob_reader.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -2 lines 0 comments Download
M storage/browser/blob/blob_reader.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +15 lines, -11 lines 0 comments Download
M storage/browser/blob/blob_storage_context.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 2 chunks +166 lines, -82 lines 0 comments Download
M storage/browser/blob/blob_storage_context.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 4 chunks +678 lines, -343 lines 0 comments Download
M storage/browser/blob/blob_storage_registry.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +12 lines, -50 lines 0 comments Download
M storage/browser/blob/blob_storage_registry.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 5 chunks +11 lines, -28 lines 0 comments Download
D storage/browser/blob/blob_transport_result.h View 1 2 3 4 5 6 1 chunk +0 lines, -27 lines 0 comments Download
M storage/browser/blob/internal_blob_data.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +128 lines, -37 lines 0 comments Download
M storage/browser/blob/internal_blob_data.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +49 lines, -52 lines 0 comments Download
M storage/browser/blob/shareable_blob_data_item.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 4 chunks +7 lines, -5 lines 0 comments Download
M storage/browser/blob/shareable_blob_data_item.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +0 lines, -2 lines 0 comments Download
M storage/browser/blob/view_blob_internals_job.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +11 lines, -9 lines 0 comments Download
M storage/common/blob_storage/blob_storage_constants.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 3 chunks +6 lines, -24 lines 0 comments Download
M storage/common/blob_storage/blob_storage_constants.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +6 lines, -0 lines 0 comments Download
M storage/common/data_element.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/files/blob-paging.html View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +45 lines, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 67 (32 generated)
dmurph
THIS IS IT GUYS. I have blob paging working, and it's passing all of the ...
4 years, 6 months ago (2016-06-24 20:33:43 UTC) #3
michaeln
Wooohoooo!!! I'll take a look this afternoon.
4 years, 5 months ago (2016-06-27 21:52:42 UTC) #5
dmurph
+Marijn for some more eyes
4 years, 5 months ago (2016-06-28 23:45:18 UTC) #7
Marijn Kruisselbrink
Just some random comments https://codereview.chromium.org/2055053003/diff/60001/storage/browser/blob/blob_flattener.cc File storage/browser/blob/blob_flattener.cc (right): https://codereview.chromium.org/2055053003/diff/60001/storage/browser/blob/blob_flattener.cc#newcode34 storage/browser/blob/blob_flattener.cc:34: size_t blob_flattening_index_offset = 0; You're ...
4 years, 5 months ago (2016-06-29 22:42:21 UTC) #8
dmurph
Thanks for taking a look! I simplified the memory requesting logic, moved all of that ...
4 years, 5 months ago (2016-07-06 23:44:29 UTC) #9
kinuko
Random-ish minor comments to start with... (have only done very partial review yet) https://codereview.chromium.org/2055053003/diff/90001/content/browser/blob_storage/blob_async_builder_host_unittest.cc File ...
4 years, 5 months ago (2016-07-07 16:11:44 UTC) #10
michaeln
not a complete review, i'm still sorting thru it https://codereview.chromium.org/2055053003/diff/40001/content/browser/blob_storage/blob_dispatcher_host.cc File content/browser/blob_storage/blob_dispatcher_host.cc (right): https://codereview.chromium.org/2055053003/diff/40001/content/browser/blob_storage/blob_dispatcher_host.cc#newcode83 content/browser/blob_storage/blob_dispatcher_host.cc:83: ...
4 years, 5 months ago (2016-07-07 20:05:23 UTC) #11
dmurph
Hello! I didn't have a chance to get to all comments but I did make ...
4 years, 5 months ago (2016-07-08 01:22:12 UTC) #12
Marijn Kruisselbrink
Some more random comments, hopefully not duplicating anybody else's comments. https://codereview.chromium.org/2055053003/diff/110001/content/browser/blob_storage/chrome_blob_storage_context.cc File content/browser/blob_storage/chrome_blob_storage_context.cc (right): https://codereview.chromium.org/2055053003/diff/110001/content/browser/blob_storage/chrome_blob_storage_context.cc#newcode115 ...
4 years, 5 months ago (2016-07-08 23:37:38 UTC) #13
dmurph
Thanks for the reviews everyone! QUESTION: Is this architected enough for me to start writing ...
4 years, 5 months ago (2016-07-11 23:33:29 UTC) #14
Marijn Kruisselbrink
https://codereview.chromium.org/2055053003/diff/110001/storage/browser/blob/blob_flattener.cc File storage/browser/blob/blob_flattener.cc (right): https://codereview.chromium.org/2055053003/diff/110001/storage/browser/blob/blob_flattener.cc#newcode98 storage/browser/blob/blob_flattener.cc:98: output_blob->AppendSharedBlobItem(uuid, std::move(shareable_item)); On 2016/07/11 at 23:33:28, dmurph wrote: > ...
4 years, 5 months ago (2016-07-12 21:33:07 UTC) #15
dmurph
Alrighty! I added a fuzzer style test for BlobStorageContext, which found a bunch of bugs. ...
4 years, 5 months ago (2016-07-14 01:04:31 UTC) #16
michaeln
some more comments i still haven't tackled the BlobMemoryController class which i see as the ...
4 years, 5 months ago (2016-07-14 01:44:44 UTC) #17
michaeln
I apologize for being so slow in this review. When I first looked, I was ...
4 years, 5 months ago (2016-07-15 02:12:08 UTC) #26
dmurph
Alrighty, I added a ton of tests and I'm replies to half of the comments ...
4 years, 5 months ago (2016-07-15 02:45:27 UTC) #27
dmurph
Michael's analysis was slightly off, so I updated the description to outline how blobs are ...
4 years, 5 months ago (2016-07-15 18:11:05 UTC) #29
dmurph
Alright, so I made the enum change to include the two pending states. This simplifies ...
4 years, 5 months ago (2016-07-15 20:18:16 UTC) #30
kinuko
Still haven't gotten half way through, but I have more comments now with possibly a ...
4 years, 5 months ago (2016-07-17 16:15:47 UTC) #31
dmurph
I still need to do the de-friendify of tests, but replied to all other comments. ...
4 years, 5 months ago (2016-07-19 02:26:28 UTC) #32
dmurph
I added a necessary change to ServiceURLRequestJob (and removed some unneeded code) that fetches file ...
4 years, 5 months ago (2016-07-19 18:53:11 UTC) #37
dmurph
Kinuko: Michael & I chatted a lot today, and he had some good feedback on ...
4 years, 5 months ago (2016-07-19 23:56:36 UTC) #40
kinuko
On 2016/07/19 23:56:36, dmurph wrote: > Kinuko: > > Michael & I chatted a lot ...
4 years, 5 months ago (2016-07-20 08:07:57 UTC) #41
falken
service worker lgtm https://codereview.chromium.org/2055053003/diff/290001/content/browser/service_worker/service_worker_url_request_job.cc File content/browser/service_worker/service_worker_url_request_job.cc (left): https://codereview.chromium.org/2055053003/diff/290001/content/browser/service_worker/service_worker_url_request_job.cc#oldcode621 content/browser/service_worker/service_worker_url_request_job.cc:621: total_size = std::numeric_limits<uint64_t>::max(); Seems we can ...
4 years, 5 months ago (2016-07-22 04:22:19 UTC) #42
dmurph
Hello everyone! I finished the refactor that Michael discussed with me, and added a ton ...
4 years, 4 months ago (2016-08-02 00:58:02 UTC) #48
dmurph
Ping on patch. Also +Victor for some more eyes.
4 years, 4 months ago (2016-08-05 20:46:39 UTC) #52
Marijn Kruisselbrink
Didn't look at everything yet, but some comments anyway: https://codereview.chromium.org/2055053003/diff/350001/content/browser/service_worker/service_worker_url_request_job.cc File content/browser/service_worker/service_worker_url_request_job.cc (right): https://codereview.chromium.org/2055053003/diff/350001/content/browser/service_worker/service_worker_url_request_job.cc#newcode176 content/browser/service_worker/service_worker_url_request_job.cc:176: ...
4 years, 4 months ago (2016-08-05 23:23:55 UTC) #54
michaeln
here's a bunch of comments, the cl is very large and unwieldy, breaking it up ...
4 years, 4 months ago (2016-08-15 22:44:45 UTC) #55
pwnall
https://codereview.chromium.org/2055053003/diff/350001/storage/common/blob_storage/blob_storage_constants.h File storage/common/blob_storage/blob_storage_constants.h (right): https://codereview.chromium.org/2055053003/diff/350001/storage/common/blob_storage/blob_storage_constants.h#newcode22 storage/common/blob_storage/blob_storage_constants.h:22: const uint64_t kBlobStorageMinFileSizeBytes = 5 * 1024 * 1024; ...
4 years, 4 months ago (2016-08-17 22:01:55 UTC) #56
michaeln
Here's a rough sketch of what an independent cut at 'controller' api might look like? ...
4 years, 4 months ago (2016-08-18 21:54:01 UTC) #57
michaeln
and in a subsequent cl, ShareableBlobDataItems would own block a ReservedSpace if needed On 2016/08/18 ...
4 years, 4 months ago (2016-08-18 22:05:30 UTC) #58
dmurph
I got through most of the comments, end of the day so I wanted to ...
4 years, 4 months ago (2016-08-19 00:18:34 UTC) #59
michaeln
I continue to think we should split this CL up. Some ideas on that split? ...
4 years, 4 months ago (2016-08-23 01:31:55 UTC) #60
dmurph
per request this has been split up, first patch is the BlobMemoryController located here: https://codereview.chromium.org/2339933004/ ...
4 years, 3 months ago (2016-09-20 19:53:26 UTC) #61
dmurph
Hey Kinuko, Michael, Marijn, and Victor, I have this patch updated to the recently committed ...
4 years, 2 months ago (2016-10-21 22:21:32 UTC) #66
dmurph
4 years, 2 months ago (2016-10-21 22:27:14 UTC) #67
Michael and I had an idea about doing all the non-memory controller
changes, where we don't need file state stuff, before integrating that
memory controller. My main concern is that removing the file quota
completely serializes our state, so it's a WAY simpler problem. So we may
oversimplify the solution to just recomplicate it again. But maybe we'll
then be able to focus on getting the other bits well? Idk.

-- 
You received this message because you are subscribed to the Google Groups
"Chromium-reviews" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698