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

Issue 2339933004: [BlobStorage] BlobMemoryController & tests (Closed)

Created:
4 years, 3 months ago by dmurph
Modified:
4 years, 2 months ago
CC:
chromium-reviews, jam, darin-cc_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[BlobStorage] BlobMemoryController & tests This is a split off of https://codereview.chromium.org/2055053003/. This adds the BlobMemoryController & tests, as well as any other small required changes. I avoided doing too much refactoring (like the move to BlobStatus everywhere, and removing BlobStorageRegistry::Entry for InternalBlobData) to just focus on the BlobMemoryController API. BUG=375297 R=michaeln@chromium.org,kinuko@chromium.org,mek@chromium.org Committed: https://crrev.com/0b0e36d9a68b386ab2e8e6c921122bb0f6e7e0e9 Cr-Commit-Position: refs/heads/master@{#426901}

Patch Set 1 #

Total comments: 20

Patch Set 2 : comments #

Patch Set 3 : rebase #

Total comments: 40

Patch Set 4 : round 1 comments #

Total comments: 6

Patch Set 5 : forgot new test file #

Patch Set 6 : refactor w/ tasks #

Patch Set 7 : Comments, and made task base class for hopefully more simplicity #

Total comments: 117

Patch Set 8 : comments, more tests are next #

Total comments: 28

Patch Set 9 : new tests, added catch for file deletion on IO thread #

Patch Set 10 : Simplified file object deletion #

Patch Set 11 : Fix android & windows build errors #

Total comments: 76

Patch Set 12 : comments, added MemoryAllocation, and changed memory quota bookkeeping #

Total comments: 2

Patch Set 13 : switched back from file literal for windows compile #

Total comments: 11

Patch Set 14 : Comments, MemoryAllocation struct, and new test #

Patch Set 15 : windows visibility fix #

Patch Set 16 : format and hopefully windows fix #

Total comments: 25

Patch Set 17 : memset fix, windows fix (hopefully) #

Patch Set 18 : histograms and windows fix #

Total comments: 30

Patch Set 19 : comments and in_flight limit simplification (using min_page_file_size) #

Total comments: 25

Patch Set 20 : comments, and hopefully windows fix #

Patch Set 21 : debugging logging for windows #

Patch Set 22 : Removed logging #

Patch Set 23 : rebase #

Patch Set 24 : Fixed windows bug! #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2025 lines, -69 lines) Patch
M content/browser/blob_storage/blob_async_transport_request_builder_unittest.cc View 1 2 3 4 5 6 7 8 3 chunks +4 lines, -10 lines 0 comments Download
A content/browser/blob_storage/blob_data_builder_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +31 lines, -0 lines 0 comments Download
A 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 1 chunk +681 lines, -0 lines 0 comments Download
M content/test/BUILD.gn 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, -0 lines 0 comments Download
M storage/browser/BUILD.gn 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, -0 lines 0 comments Download
M storage/browser/blob/blob_async_transport_request_builder.cc View 1 chunk +1 line, -1 line 0 comments Download
M storage/browser/blob/blob_data_builder.h View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +22 lines, -7 lines 0 comments Download
M storage/browser/blob/blob_data_builder.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 5 chunks +46 lines, -19 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 3 chunks +3 lines, -0 lines 0 comments Download
A 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 1 chunk +252 lines, -0 lines 0 comments Download
A 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 23 1 chunk +730 lines, -0 lines 0 comments Download
M storage/browser/blob/blob_storage_context.cc View 1 2 3 4 5 9 chunks +21 lines, -13 lines 0 comments Download
M storage/browser/blob/internal_blob_data.cc View 1 2 3 4 5 1 chunk +1 line, -1 line 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 1 chunk +67 lines, -10 lines 0 comments Download
M storage/browser/blob/shareable_blob_data_item.cc View 1 2 3 4 5 6 7 1 chunk +37 lines, -6 lines 0 comments Download
M storage/common/BUILD.gn View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 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 4 chunks +74 lines, -2 lines 0 comments Download
A storage/common/blob_storage/blob_storage_constants.cc View 1 chunk +19 lines, -0 lines 0 comments Download
M tools/metrics/histograms/histograms.xml 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 +31 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 129 (88 generated)
dmurph
Hey all, This is my first split-off patch from the monster patch, where I just ...
4 years, 3 months ago (2016-09-14 21:21:00 UTC) #1
dmurph
+michaeln, who somehow I didn't include here (weird)
4 years, 3 months ago (2016-09-15 23:47:24 UTC) #5
pwnall
Here are some quick things I noticed. I'll resume reading later today. https://codereview.chromium.org/2339933004/diff/1/storage/browser/blob/blob_memory_controller.cc File storage/browser/blob/blob_memory_controller.cc ...
4 years, 3 months ago (2016-09-16 22:45:24 UTC) #6
dmurph
Thanks for the comments Victor! https://codereview.chromium.org/2339933004/diff/1/storage/browser/blob/blob_memory_controller.cc File storage/browser/blob/blob_memory_controller.cc (right): https://codereview.chromium.org/2339933004/diff/1/storage/browser/blob/blob_memory_controller.cc#newcode79 storage/browser/blob/blob_memory_controller.cc:79: LOG(ERROR) << "writing to ...
4 years, 3 months ago (2016-09-20 00:00:51 UTC) #9
dmurph
Michael, can you PTAL? :) On Mon, Sep 19, 2016, 5:00 PM <dmurph@chromium.org> wrote: > ...
4 years, 3 months ago (2016-09-20 02:25:30 UTC) #12
pwnall
I still haven't taken a good look at some of the bits, but here are ...
4 years, 3 months ago (2016-09-21 09:03:35 UTC) #17
pwnall
Here are a few more thoughts. Most of them target the comments in the memory ...
4 years, 3 months ago (2016-09-21 22:56:59 UTC) #18
dmurph
Here are replies from first round of comments (and patch) It seems like the API ...
4 years, 3 months ago (2016-09-21 23:45:52 UTC) #19
pwnall
TBH I don't know enough about the Chromium side yet to be able to come ...
4 years, 3 months ago (2016-09-22 21:06:02 UTC) #20
dmurph
Victor and I had an offline discussion about changing the architecture, specifically around moving the ...
4 years, 3 months ago (2016-09-23 01:17:59 UTC) #21
dmurph
Ok, so I replied to comments and made the tasks a little more simple by ...
4 years, 3 months ago (2016-09-23 20:15:14 UTC) #24
pwnall
I don't think these comments will significantly impact your tests, but going through them might ...
4 years, 2 months ago (2016-09-26 13:18:09 UTC) #27
michaeln
Thnx for splitting this up (and thxn victor for looking at it too). I haven't ...
4 years, 2 months ago (2016-09-27 00:09:30 UTC) #28
michaeln
some .cc file comments https://codereview.chromium.org/2339933004/diff/120001/storage/browser/blob/blob_memory_controller.cc File storage/browser/blob/blob_memory_controller.cc (right): https://codereview.chromium.org/2339933004/diff/120001/storage/browser/blob/blob_memory_controller.cc#newcode50 storage/browser/blob/blob_memory_controller.cc:50: std::vector<BlobMemoryController::FileCreationInfo> CreateFiles( It wasn't clear ...
4 years, 2 months ago (2016-09-28 01:08:04 UTC) #29
michaeln
https://codereview.chromium.org/2339933004/diff/120001/storage/browser/blob/blob_memory_controller.cc File storage/browser/blob/blob_memory_controller.cc (right): https://codereview.chromium.org/2339933004/diff/120001/storage/browser/blob/blob_memory_controller.cc#newcode47 storage/browser/blob/blob_memory_controller.cc:47: void DestructFiles(std::vector<BlobMemoryController::FileCreationInfo> files) {} I don't see this being ...
4 years, 2 months ago (2016-09-28 21:19:28 UTC) #30
dmurph
Done! My next patch will start having more tests. Thanks for the comments! https://codereview.chromium.org/2339933004/diff/120001/storage/browser/blob/blob_data_builder.cc File ...
4 years, 2 months ago (2016-09-29 00:44:23 UTC) #35
michaeln
this is looking pretty good to me, i have a couple nits and am wondering ...
4 years, 2 months ago (2016-10-04 00:11:55 UTC) #36
dmurph
Hello! I added some more tests, PTAL. I'm mostly concerned w/ the new DeleteOnTaskRunnerIfControllerGone methods. ...
4 years, 2 months ago (2016-10-06 00:45:40 UTC) #43
michaeln
hey, i'll take a look this afternoon
4 years, 2 months ago (2016-10-07 20:24:30 UTC) #54
michaeln
this looks really good, i only have one substantive comment about how memory quota is ...
4 years, 2 months ago (2016-10-11 20:55:24 UTC) #55
kinuko
looks good overall to me too https://codereview.chromium.org/2339933004/diff/200001/storage/browser/blob/blob_data_builder.cc File storage/browser/blob/blob_data_builder.cc (right): https://codereview.chromium.org/2339933004/diff/200001/storage/browser/blob/blob_data_builder.cc#newcode28 storage/browser/blob/blob_data_builder.cc:28: const char kFutureFileName[] ...
4 years, 2 months ago (2016-10-12 15:26:42 UTC) #56
dmurph
Hello! The two largest changes here: I added a BlobMemoryController;:MemoryAllocation. This is just a typedef ...
4 years, 2 months ago (2016-10-13 00:39:31 UTC) #59
michaeln
mostly naming comments but also the opaqueness of the scopedclosurerunner might hurt more than it ...
4 years, 2 months ago (2016-10-14 01:53:26 UTC) #66
dmurph
Thanks! Updated, and it should build fine on windows now. https://codereview.chromium.org/2339933004/diff/200001/storage/browser/blob/blob_memory_controller.cc File storage/browser/blob/blob_memory_controller.cc (right): https://codereview.chromium.org/2339933004/diff/200001/storage/browser/blob/blob_memory_controller.cc#newcode448 ...
4 years, 2 months ago (2016-10-14 23:31:47 UTC) #73
dmurph
Thanks! Updated, and it should build fine on windows now. https://codereview.chromium.org/2339933004/diff/240001/storage/browser/blob/blob_memory_controller.cc File storage/browser/blob/blob_memory_controller.cc (right): https://codereview.chromium.org/2339933004/diff/240001/storage/browser/blob/blob_memory_controller.cc#newcode594 ...
4 years, 2 months ago (2016-10-14 23:31:48 UTC) #74
michaeln
lgtm, i see some nits but otherwise looks nice! (woohoo:) i'm not sure if kinuko ...
4 years, 2 months ago (2016-10-18 00:56:25 UTC) #79
dmurph
https://chromiumcodereview.appspot.com/2339933004/diff/300001/content/browser/blob_storage/blob_memory_controller_unittest.cc File content/browser/blob_storage/blob_memory_controller_unittest.cc (right): https://chromiumcodereview.appspot.com/2339933004/diff/300001/content/browser/blob_storage/blob_memory_controller_unittest.cc#newcode195 content/browser/blob_storage/blob_memory_controller_unittest.cc:195: EXPECT_EQ(ItemState::QUOTA_GRANTED, items[2]->state()); On 2016/10/18 00:56:24, michaeln wrote: > maybe ...
4 years, 2 months ago (2016-10-18 20:24:45 UTC) #82
dmurph
+mpearson for histogram review. I have duplicate reasons in there (explaining when we create a ...
4 years, 2 months ago (2016-10-18 21:01:00 UTC) #88
pwnall
non-owner LGTM with nits. https://codereview.chromium.org/2339933004/diff/340001/content/browser/blob_storage/blob_memory_controller_unittest.cc File content/browser/blob_storage/blob_memory_controller_unittest.cc (right): https://codereview.chromium.org/2339933004/diff/340001/content/browser/blob_storage/blob_memory_controller_unittest.cc#newcode155 content/browser/blob_storage/blob_memory_controller_unittest.cc:155: // Not too large, as ...
4 years, 2 months ago (2016-10-18 23:20:13 UTC) #91
Mark P
>>> +mpearson for histogram review. I have duplicate reasons in there (explaining when we create ...
4 years, 2 months ago (2016-10-18 23:30:49 UTC) #93
kinuko
sorry for slow review, here're some more comments. https://codereview.chromium.org/2339933004/diff/340001/storage/browser/blob/blob_memory_controller.cc File storage/browser/blob/blob_memory_controller.cc (right): https://codereview.chromium.org/2339933004/diff/340001/storage/browser/blob/blob_memory_controller.cc#newcode49 storage/browser/blob/blob_memory_controller.cc:49: return ...
4 years, 2 months ago (2016-10-19 21:08:56 UTC) #94
kinuko
https://codereview.chromium.org/2339933004/diff/200001/storage/browser/blob/blob_data_builder.cc File storage/browser/blob/blob_data_builder.cc (right): https://codereview.chromium.org/2339933004/diff/200001/storage/browser/blob/blob_data_builder.cc#newcode28 storage/browser/blob/blob_data_builder.cc:28: const char kFutureFileName[] = "_future_name_"; On 2016/10/13 00:39:29, dmurph ...
4 years, 2 months ago (2016-10-19 21:34:10 UTC) #95
dmurph
Thanks! I updated based on comments, and also removed the in_flight_memory_size field in blob limits ...
4 years, 2 months ago (2016-10-20 00:09:48 UTC) #98
Mark P
histograms.xml lgtm
4 years, 2 months ago (2016-10-20 03:59:47 UTC) #101
kinuko
Thanks, I think this lgtm (review on tests is a bit lightweight, hope they are ...
4 years, 2 months ago (2016-10-20 16:15:34 UTC) #102
michaeln
https://codereview.chromium.org/2339933004/diff/360001/storage/browser/blob/blob_memory_controller.h File storage/browser/blob/blob_memory_controller.h (right): https://codereview.chromium.org/2339933004/diff/360001/storage/browser/blob/blob_memory_controller.h#newcode167 storage/browser/blob/blob_memory_controller.h:167: class BaseQuotaAllocationTask; fyi: no longer needed
4 years, 2 months ago (2016-10-20 20:48:40 UTC) #103
dmurph
Thanks! I changed the way I append the file name to maybe fix the windows ...
4 years, 2 months ago (2016-10-20 21:05:23 UTC) #106
dmurph
Found the windows bug! It had to do with argument evaluation order, which was a ...
4 years, 2 months ago (2016-10-21 18:53:20 UTC) #121
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2339933004/460001
4 years, 2 months ago (2016-10-21 19:00:31 UTC) #125
commit-bot: I haz the power
Committed patchset #24 (id:460001)
4 years, 2 months ago (2016-10-21 21:51:58 UTC) #127
commit-bot: I haz the power
4 years, 2 months ago (2016-10-21 21:55:22 UTC) #129
Message was sent while issue was closed.
Patchset 24 (id:??) landed as
https://crrev.com/0b0e36d9a68b386ab2e8e6c921122bb0f6e7e0e9
Cr-Commit-Position: refs/heads/master@{#426901}

Powered by Google App Engine
This is Rietveld 408576698