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

Issue 2649963002: Enable mojo localstorage to actually store on disk. (Closed)

Created:
3 years, 11 months ago by Marijn Kruisselbrink
Modified:
3 years, 10 months ago
CC:
Aaron Boodman, abarth-chromium, chromium-reviews, darin (slow to review), darin-cc_chromium.org, mlamouri+watch-content_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Enable mojo localstorage to actually store on disk. Includes a browser test to make sure this works, as well as some fixes needed to make it work: LevelDBMojoProxy makes sync mojo calls, but runs in the browser process, so add ScopedAllowSyncCall to all the places it makes sync calls. If the browser quits before the connection to the LevelDB database is completely setup, it isn't possible anymore to get the connection working. So we need to make sure that the connection is always ready before a renderer tries to make changes to the stored data. For most methods this was already the case as we always (sync) load all existing data for an origin, but if the first change a renderer makes is clear(), there isn't a need to actually load all the data. To make sure the connection is setup anyway, this CL adds a new sync method to LevelDBWrapper purely to block the renderer until the database is ready. BUG=586194 Review-Url: https://codereview.chromium.org/2649963002 Cr-Commit-Position: refs/heads/master@{#449021} Committed: https://chromium.googlesource.com/chromium/src/+/3ea335139f6f337d8cc46250fd86f8965f6d0a53

Patch Set 1 #

Patch Set 2 : disable test on android since PRE doesn't work there #

Patch Set 3 : self review #

Patch Set 4 : add uma #

Total comments: 5

Patch Set 5 : add sync call restrictions comment #

Patch Set 6 : Remove Sync() method, and instead make sure browser test waits long enough. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+97 lines, -2 lines) Patch
M components/leveldb/leveldb_mojo_proxy.cc View 1 2 3 4 5 11 chunks +11 lines, -0 lines 0 comments Download
M content/browser/dom_storage/dom_storage_browsertest.cc View 1 2 3 4 5 4 chunks +45 lines, -0 lines 0 comments Download
M content/browser/dom_storage/dom_storage_context_wrapper.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/dom_storage/dom_storage_context_wrapper.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/dom_storage/local_storage_context_mojo.h View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/dom_storage/local_storage_context_mojo.cc View 1 2 3 4 5 1 chunk +5 lines, -0 lines 0 comments Download
M content/renderer/dom_storage/local_storage_cached_area.cc View 1 2 3 4 5 1 chunk +0 lines, -1 line 0 comments Download
A content/test/data/dom_storage/store_data.html View 1 chunk +12 lines, -0 lines 0 comments Download
A content/test/data/dom_storage/verify_data.html View 1 chunk +14 lines, -0 lines 0 comments Download
M mojo/public/cpp/bindings/sync_call_restrictions.h View 1 2 3 4 2 chunks +6 lines, -0 lines 0 comments Download

Messages

Total messages: 51 (31 generated)
Marijn Kruisselbrink
I believe the ScopedAllowSyncCall bits in LevelDBMojoProxy should be safe (and there isn't really a ...
3 years, 11 months ago (2017-01-24 19:33:16 UTC) #14
jam
lgtm On 2017/01/24 19:33:16, Marijn Kruisselbrink wrote: > I believe the ScopedAllowSyncCall bits in LevelDBMojoProxy ...
3 years, 11 months ago (2017-01-25 00:46:55 UTC) #17
michaeln
https://codereview.chromium.org/2649963002/diff/60001/content/renderer/dom_storage/local_storage_cached_area.cc File content/renderer/dom_storage/local_storage_cached_area.cc (right): https://codereview.chromium.org/2649963002/diff/60001/content/renderer/dom_storage/local_storage_cached_area.cc#newcode158 content/renderer/dom_storage/local_storage_cached_area.cc:158: leveldb_->Sync(); that's unfortunate? would an async call to storage_partition_service->ClearLocalStorage ...
3 years, 11 months ago (2017-01-25 02:28:38 UTC) #18
yzshen1
On 2017/01/25 00:46:55, jam wrote: > lgtm > > On 2017/01/24 19:33:16, Marijn Kruisselbrink wrote: ...
3 years, 11 months ago (2017-01-25 17:41:59 UTC) #19
jam
On 2017/01/25 17:41:59, yzshen1 wrote: > On 2017/01/25 00:46:55, jam wrote: > > lgtm > ...
3 years, 11 months ago (2017-01-25 18:38:33 UTC) #20
Marijn Kruisselbrink
On 2017/01/25 at 18:38:33, jam wrote: > On 2017/01/25 17:41:59, yzshen1 wrote: > > Even ...
3 years, 11 months ago (2017-01-25 22:00:08 UTC) #22
michaeln
lgtm https://codereview.chromium.org/2649963002/diff/60001/content/renderer/dom_storage/local_storage_cached_area.cc File content/renderer/dom_storage/local_storage_cached_area.cc (right): https://codereview.chromium.org/2649963002/diff/60001/content/renderer/dom_storage/local_storage_cached_area.cc#newcode158 content/renderer/dom_storage/local_storage_cached_area.cc:158: leveldb_->Sync(); On 2017/01/25 22:00:07, Marijn Kruisselbrink wrote: > ...
3 years, 11 months ago (2017-01-25 23:53:28 UTC) #24
yzshen1
On 2017/01/25 22:00:08, Marijn Kruisselbrink wrote: > On 2017/01/25 at 18:38:33, jam wrote: > > ...
3 years, 11 months ago (2017-01-26 18:07:13 UTC) #27
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/2649963002/80001
3 years, 10 months ago (2017-01-30 19:01:28 UTC) #30
Marijn Kruisselbrink
+dcheng for content/common/leveldb_wrapper.mojom OWNERS +isherman for histograms.xml OWNERS
3 years, 10 months ago (2017-01-30 19:08:57 UTC) #32
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/353273)
3 years, 10 months ago (2017-01-30 19:12:32 UTC) #34
Ilya Sherman
Metrics LGTM
3 years, 10 months ago (2017-01-30 19:40:28 UTC) #35
dcheng
This might be a dumb question, but why don't we just return the wrapper through ...
3 years, 10 months ago (2017-01-31 05:42:58 UTC) #36
Marijn Kruisselbrink
On 2017/01/31 at 05:42:58, dcheng wrote: > This might be a dumb question, but why ...
3 years, 10 months ago (2017-01-31 23:17:39 UTC) #37
Marijn Kruisselbrink
dcheng: ping?
3 years, 10 months ago (2017-02-07 21:42:49 UTC) #38
dcheng
I don't want to block this change any longer, but I feel like we're not ...
3 years, 10 months ago (2017-02-07 23:39:10 UTC) #39
dcheng
On 2017/02/07 23:39:10, dcheng wrote: > I don't want to block this change any longer, ...
3 years, 10 months ago (2017-02-07 23:40:15 UTC) #40
Marijn Kruisselbrink
On 2017/02/07 at 23:40:15, dcheng wrote: > On 2017/02/07 23:39:10, dcheng wrote: > > I ...
3 years, 10 months ago (2017-02-08 00:33:12 UTC) #43
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/2649963002/100001
3 years, 10 months ago (2017-02-08 17:20:20 UTC) #48
commit-bot: I haz the power
3 years, 10 months ago (2017-02-08 17:26:22 UTC) #51
Message was sent while issue was closed.
Committed patchset #6 (id:100001) as
https://chromium.googlesource.com/chromium/src/+/3ea335139f6f337d8cc46250fd86...

Powered by Google App Engine
This is Rietveld 408576698