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

Issue 1953703004: Purge browser cache for dom storage in a smarter way (Closed)

Created:
4 years, 7 months ago by ssid
Modified:
4 years, 7 months ago
Reviewers:
michaeln, Mark P, jsbell
CC:
chromium-reviews, darin-cc_chromium.org, jam
Base URL:
https://chromium.googlesource.com/chromium/src.git@dom_storage
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Purge browser cache for dom storage in a smarter way This CL does: 1. Use the total cache size to decide when to purge memory from in memory caches. 2. Use different limits on databases and cache sizes based on the platform and the ram available. 3. For low memory devices do not keep any cache around for closed databases (closed tabs). 4. Add a memory pressure listener to dom storage. This listener is supposed to construct and destruct in same thread. So, it is constructed and destructed on UI thread by DOMStorageContextWrapper and post tasks purge to the dom task runner. BUG=610551, 607449 Committed: https://crrev.com/454f3cefe1b33de5a422778e5cf09d6311bb7fa7 Cr-Commit-Position: refs/heads/master@{#395418}

Patch Set 1 : #

Total comments: 16

Patch Set 2 : fixes. #

Patch Set 3 : Fixes. #

Total comments: 1

Patch Set 4 : Nits. #

Patch Set 5 : Add UMA to track savings. #

Patch Set 6 : Purge all namespaces and use total cache size. #

Total comments: 2

Patch Set 7 : without unittest. #

Patch Set 8 : Add unittest. #

Total comments: 4

Patch Set 9 : Add content_export. #

Total comments: 6

Patch Set 10 : Fix limit and description for UMA. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+200 lines, -33 lines) Patch
M content/browser/dom_storage/dom_storage_area.h View 1 2 3 4 5 6 7 8 5 chunks +4 lines, -2 lines 0 comments Download
M content/browser/dom_storage/dom_storage_context_impl.h View 1 2 3 4 5 5 chunks +23 lines, -2 lines 0 comments Download
M content/browser/dom_storage/dom_storage_context_impl.cc View 1 2 3 4 5 6 7 8 9 4 chunks +72 lines, -3 lines 0 comments Download
M content/browser/dom_storage/dom_storage_context_impl_unittest.cc View 1 2 3 4 5 6 7 1 chunk +31 lines, -0 lines 0 comments Download
M content/browser/dom_storage/dom_storage_context_wrapper.h View 1 2 3 4 5 3 chunks +8 lines, -0 lines 0 comments Download
M content/browser/dom_storage/dom_storage_context_wrapper.cc View 1 2 3 4 5 3 chunks +17 lines, -0 lines 0 comments Download
M content/browser/dom_storage/dom_storage_database.cc View 1 2 3 4 5 6 2 chunks +7 lines, -0 lines 0 comments Download
M content/browser/dom_storage/dom_storage_host.cc View 1 2 3 4 5 2 chunks +1 line, -6 lines 0 comments Download
M content/browser/dom_storage/dom_storage_namespace.h View 1 2 3 4 5 2 chunks +8 lines, -10 lines 0 comments Download
M content/browser/dom_storage/dom_storage_namespace.cc View 1 2 3 4 5 3 chunks +13 lines, -7 lines 0 comments Download
M content/common/dom_storage/dom_storage_types.h View 1 chunk +0 lines, -3 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 6 7 8 9 1 chunk +16 lines, -0 lines 0 comments Download

Messages

Total messages: 47 (22 generated)
ssid
Hi, I have drafted a CL to purge memory better in dom databases from what ...
4 years, 7 months ago (2016-05-06 03:28:52 UTC) #4
michaeln
I haven't looked closely yet, but thanx for getting the itch to make it better ...
4 years, 7 months ago (2016-05-06 20:07:44 UTC) #6
michaeln
https://codereview.chromium.org/1953703004/diff/20001/content/browser/dom_storage/dom_storage_area.cc File content/browser/dom_storage/dom_storage_area.cc (right): https://codereview.chromium.org/1953703004/diff/20001/content/browser/dom_storage/dom_storage_area.cc#newcode307 content/browser/dom_storage/dom_storage_area.cc:307: if (backing_) There are some complications that i think ...
4 years, 7 months ago (2016-05-09 21:50:31 UTC) #7
michaeln
https://codereview.chromium.org/1953703004/diff/20001/content/browser/dom_storage/dom_storage_namespace.cc File content/browser/dom_storage/dom_storage_namespace.cc (right): https://codereview.chromium.org/1953703004/diff/20001/content/browser/dom_storage/dom_storage_namespace.cc#newcode177 content/browser/dom_storage/dom_storage_namespace.cc:177: #if defined(OS_ANDROID) This might be more complicated then it ...
4 years, 7 months ago (2016-05-09 22:12:17 UTC) #8
ssid
Thanks for your patient review. I have updated the CL based on your suggestions. PTAL. ...
4 years, 7 months ago (2016-05-10 02:04:16 UTC) #10
ssid
I changed the logic a bit to include all namespaces and purge all if needed. ...
4 years, 7 months ago (2016-05-11 22:50:10 UTC) #16
ssid
On 2016/05/11 22:50:10, ssid wrote: > I changed the logic a bit to include all ...
4 years, 7 months ago (2016-05-12 22:22:30 UTC) #17
michaeln
This looks good to me, thanx for doing this! I'm wondering if we should wait ...
4 years, 7 months ago (2016-05-14 00:42:52 UTC) #19
jsbell
On 2016/05/14 00:42:52, michaeln wrote: > I'm wondering if we should wait till after the ...
4 years, 7 months ago (2016-05-16 16:20:45 UTC) #20
ssid
Thanks for review. I added unittest. ptal. Makes sense to wait till branch point. I ...
4 years, 7 months ago (2016-05-16 20:51:57 UTC) #24
michaeln
https://codereview.chromium.org/1953703004/diff/300001/content/browser/dom_storage/dom_storage_context_impl_unittest.cc File content/browser/dom_storage/dom_storage_context_impl_unittest.cc (right): https://codereview.chromium.org/1953703004/diff/300001/content/browser/dom_storage/dom_storage_context_impl_unittest.cc#newcode271 content/browser/dom_storage/dom_storage_context_impl_unittest.cc:271: TEST_F(DOMStorageContextImplTest, PurgeMemory) { Thanx for adding the tests!
4 years, 7 months ago (2016-05-16 21:32:42 UTC) #25
michaeln
https://codereview.chromium.org/1953703004/diff/300001/content/browser/dom_storage/dom_storage_area.h File content/browser/dom_storage/dom_storage_area.h (right): https://codereview.chromium.org/1953703004/diff/300001/content/browser/dom_storage/dom_storage_area.h#newcode148 content/browser/dom_storage/dom_storage_area.h:148: struct CommitBatch { needs a CONTENT_EXPORT here now
4 years, 7 months ago (2016-05-16 21:34:39 UTC) #26
ssid
https://codereview.chromium.org/1953703004/diff/300001/content/browser/dom_storage/dom_storage_area.h File content/browser/dom_storage/dom_storage_area.h (right): https://codereview.chromium.org/1953703004/diff/300001/content/browser/dom_storage/dom_storage_area.h#newcode148 content/browser/dom_storage/dom_storage_area.h:148: struct CommitBatch { On 2016/05/16 21:34:39, michaeln wrote: > ...
4 years, 7 months ago (2016-05-16 23:02:26 UTC) #27
ssid
Friendly ping.
4 years, 7 months ago (2016-05-20 08:24:47 UTC) #28
michaeln
LGTM!
4 years, 7 months ago (2016-05-20 19:41:57 UTC) #29
ssid
+ rkaplow for uma histogram change. ptal, thanks
4 years, 7 months ago (2016-05-20 22:55:25 UTC) #31
ssid
+mpearson since Robert is on holiday
4 years, 7 months ago (2016-05-23 18:22:39 UTC) #33
Mark P
https://codereview.chromium.org/1953703004/diff/320001/content/browser/dom_storage/dom_storage_context_impl.cc File content/browser/dom_storage/dom_storage_context_impl.cc (right): https://codereview.chromium.org/1953703004/diff/320001/content/browser/dom_storage/dom_storage_context_impl.cc#newcode438 content/browser/dom_storage/dom_storage_context_impl.cc:438: initial_stats.total_cache_size / 1024, 0, 100000, There is already an ...
4 years, 7 months ago (2016-05-23 18:27:15 UTC) #34
ssid
Thanks, made changes suggested. ptal. https://codereview.chromium.org/1953703004/diff/320001/content/browser/dom_storage/dom_storage_context_impl.cc File content/browser/dom_storage/dom_storage_context_impl.cc (right): https://codereview.chromium.org/1953703004/diff/320001/content/browser/dom_storage/dom_storage_context_impl.cc#newcode438 content/browser/dom_storage/dom_storage_context_impl.cc:438: initial_stats.total_cache_size / 1024, 0, ...
4 years, 7 months ago (2016-05-23 18:42:17 UTC) #35
Mark P
histograms.xml lgtm
4 years, 7 months ago (2016-05-23 19:02:56 UTC) #36
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1953703004/340001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1953703004/340001
4 years, 7 months ago (2016-05-23 19:03:59 UTC) #38
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 7 months ago (2016-05-23 20:25:03 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1953703004/340001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1953703004/340001
4 years, 7 months ago (2016-05-23 21:27:59 UTC) #43
commit-bot: I haz the power
Committed patchset #10 (id:340001)
4 years, 7 months ago (2016-05-23 21:34:04 UTC) #45
commit-bot: I haz the power
4 years, 7 months ago (2016-05-23 21:35:39 UTC) #47
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/454f3cefe1b33de5a422778e5cf09d6311bb7fa7
Cr-Commit-Position: refs/heads/master@{#395418}

Powered by Google App Engine
This is Rietveld 408576698