|
|
Chromium Code Reviews|
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, jam, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionDelete and try to recreate localstorage database on invalid schema version.
BUG=586194
Review-Url: https://codereview.chromium.org/2625873004
Cr-Commit-Position: refs/heads/master@{#444147}
Committed: https://chromium.googlesource.com/chromium/src/+/3cf31809c9d342cfa7c1ae2844bdacf342dd39b9
Patch Set 1 #
Total comments: 4
Patch Set 2 : fix windows build #
Total comments: 2
Patch Set 3 : use an associated interface for the leveldb database #Patch Set 4 : add unit test for Destroy #
Total comments: 2
Patch Set 5 : 80 cols, and fix typo #
Dependent Patchsets: Messages
Total messages: 41 (32 generated)
The CQ bit was checked by mek@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by mek@chromium.org to run a CQ dry run
Patchset #1 (id:1) has been deleted
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
mek@chromium.org changed reviewers: + jam@chromium.org, michaeln@chromium.org
Not sure how to best ensure that the database is closed before an attempt is made to destroy it though... https://codereview.chromium.org/2625873004/diff/20001/content/browser/dom_sto... File content/browser/dom_storage/local_storage_context_mojo.cc (right): https://codereview.chromium.org/2625873004/diff/20001/content/browser/dom_sto... content/browser/dom_storage/local_storage_context_mojo.cc:332: // TODO(mek): Somehow ensure closing is processed before Destroy is called. This TODO is somewhat problematic, since I'm not sure how to accomplish such a thing. Maybe the Destroy call should be part of the LevelDBDatabase interface rather than LevelDBService (where it could make sure to close itself before destroying itself), but then you'd lose the ability to destroy a database without opening it first. Anything else seems like it will have the problem that the leveldb service and leveldb database are separate mojo pipes and thus relying on something on one pipe to have finished before calling a method on the other pipe is processed is dangerous. Any thoughts?
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_compile_dbg_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_comp...)
The CQ bit was checked by mek@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_compile_dbg on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_comp...)
https://codereview.chromium.org/2625873004/diff/20001/content/browser/dom_sto... File content/browser/dom_storage/local_storage_context_mojo.cc (right): https://codereview.chromium.org/2625873004/diff/20001/content/browser/dom_sto... content/browser/dom_storage/local_storage_context_mojo.cc:332: // TODO(mek): Somehow ensure closing is processed before Destroy is called. On 2017/01/11 19:10:58, Marijn Kruisselbrink wrote: > This TODO is somewhat problematic, since I'm not sure how to accomplish such a > thing. Maybe the Destroy call should be part of the LevelDBDatabase interface > rather than LevelDBService (where it could make sure to close itself before > destroying itself), but then you'd lose the ability to destroy a database > without opening it first. Anything else seems like it will have the problem that > the leveldb service and leveldb database are separate mojo pipes and thus > relying on something on one pipe to have finished before calling a method on the > other pipe is processed is dangerous. Any thoughts? If Destroy is on LevelDBInterface, won't there be the same issue for ordering since the Open is on LevelDBService? To solve the ordering issue, we could use associated interfaces. wdyt? https://www.chromium.org/developers/design-documents/mojo/associated-interfaces https://codereview.chromium.org/2625873004/diff/40001/components/leveldb/publ... File components/leveldb/public/interfaces/leveldb.mojom (right): https://codereview.chromium.org/2625873004/diff/40001/components/leveldb/publ... components/leveldb/public/interfaces/leveldb.mojom:76: string dbname) => (DatabaseError status); nit: indentation also please add documentation to this method. we should have had some on the few before but maybe skipped because it seemed obvious.
The CQ bit was checked by mek@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by mek@chromium.org to run a CQ dry run
https://codereview.chromium.org/2625873004/diff/20001/content/browser/dom_sto... File content/browser/dom_storage/local_storage_context_mojo.cc (right): https://codereview.chromium.org/2625873004/diff/20001/content/browser/dom_sto... content/browser/dom_storage/local_storage_context_mojo.cc:332: // TODO(mek): Somehow ensure closing is processed before Destroy is called. On 2017/01/12 at 17:24:42, jam wrote: > On 2017/01/11 19:10:58, Marijn Kruisselbrink wrote: > > This TODO is somewhat problematic, since I'm not sure how to accomplish such a > > thing. Maybe the Destroy call should be part of the LevelDBDatabase interface > > rather than LevelDBService (where it could make sure to close itself before > > destroying itself), but then you'd lose the ability to destroy a database > > without opening it first. Anything else seems like it will have the problem that > > the leveldb service and leveldb database are separate mojo pipes and thus > > relying on something on one pipe to have finished before calling a method on the > > other pipe is processed is dangerous. Any thoughts? > > If Destroy is on LevelDBInterface, won't there be the same issue for ordering since the Open is on LevelDBService? I suppose so, although it seemed less likely that you'd be trying to open a database while simultaneously trying to destroy it than that you'd want to destroy a database that you had open already. > To solve the ordering issue, we could use associated interfaces. wdyt? https://www.chromium.org/developers/design-documents/mojo/associated-interfaces Yes, that would work. Changed it to do so. Somehow using associated interface does kind of always feel like doing it the wrong way to me, with it being a c++ only feature and all (or did that change recently?)... https://codereview.chromium.org/2625873004/diff/40001/components/leveldb/publ... File components/leveldb/public/interfaces/leveldb.mojom (right): https://codereview.chromium.org/2625873004/diff/40001/components/leveldb/publ... components/leveldb/public/interfaces/leveldb.mojom:76: string dbname) => (DatabaseError status); On 2017/01/12 at 17:24:42, jam wrote: > nit: indentation > > also please add documentation to this method. we should have had some on the few before but maybe skipped because it seemed obvious. Fixed, also added (minimal) documentation to the various Open methods.
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
lgtm https://codereview.chromium.org/2625873004/diff/20001/content/browser/dom_sto... File content/browser/dom_storage/local_storage_context_mojo.cc (right): https://codereview.chromium.org/2625873004/diff/20001/content/browser/dom_sto... content/browser/dom_storage/local_storage_context_mojo.cc:332: // TODO(mek): Somehow ensure closing is processed before Destroy is called. On 2017/01/13 19:25:11, Marijn Kruisselbrink wrote: > On 2017/01/12 at 17:24:42, jam wrote: > > On 2017/01/11 19:10:58, Marijn Kruisselbrink wrote: > > > This TODO is somewhat problematic, since I'm not sure how to accomplish such > a > > > thing. Maybe the Destroy call should be part of the LevelDBDatabase > interface > > > rather than LevelDBService (where it could make sure to close itself before > > > destroying itself), but then you'd lose the ability to destroy a database > > > without opening it first. Anything else seems like it will have the problem > that > > > the leveldb service and leveldb database are separate mojo pipes and thus > > > relying on something on one pipe to have finished before calling a method on > the > > > other pipe is processed is dangerous. Any thoughts? > > > > If Destroy is on LevelDBInterface, won't there be the same issue for ordering > since the Open is on LevelDBService? > I suppose so, although it seemed less likely that you'd be trying to open a > database while simultaneously trying to destroy it than that you'd want to > destroy a database that you had open already. > > > To solve the ordering issue, we could use associated interfaces. wdyt? > https://www.chromium.org/developers/design-documents/mojo/associated-interfaces > > Yes, that would work. Changed it to do so. Somehow using associated interface > does kind of always feel like doing it the wrong way to me, with it being a c++ > only feature and all (or did that change recently?)... JavaScript support is being worked on :) Associated interfaces shouldn't be viewed negatively, it's very useful to split logically separate methods into separate interfaces, while still maintaining order. Otherwise things that don't belong together are grouped. https://codereview.chromium.org/2625873004/diff/80001/components/leveldb/leve... File components/leveldb/leveldb_service_unittest.cc (right): https://codereview.chromium.org/2625873004/diff/80001/components/leveldb/leve... components/leveldb/leveldb_service_unittest.cc:344: leveldb()->Destroy(std::move(directory), "test", Capture(&error, run_loop.QuitClosure())); nit: 80 chars, also below https://codereview.chromium.org/2625873004/diff/80001/components/leveldb/leve... components/leveldb/leveldb_service_unittest.cc:353: // Reconnect to the database shuold fail. nit: should
The CQ bit was checked by mek@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by mek@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from jam@chromium.org Link to the patchset: https://codereview.chromium.org/2625873004/#ps100001 (title: "80 cols, and fix typo")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch.
Bot data: {"patchset_id": 100001, "attempt_start_ts": 1484686051133110,
"parent_rev": "f0d53a35191a6c7e748dd789e85b1ab98e42c2a1", "commit_rev":
"9b1c496fb33eae3e6c647730d1c67444eb3e3925"}
CQ is committing da patch.
Bot data: {"patchset_id": 100001, "attempt_start_ts": 1484686051133110,
"parent_rev": "f0d53a35191a6c7e748dd789e85b1ab98e42c2a1", "commit_rev":
"9b1c496fb33eae3e6c647730d1c67444eb3e3925"}
CQ is committing da patch.
Bot data: {"patchset_id": 100001, "attempt_start_ts": 1484686051133110,
"parent_rev": "f0d53a35191a6c7e748dd789e85b1ab98e42c2a1", "commit_rev":
"9b1c496fb33eae3e6c647730d1c67444eb3e3925"}
The CQ bit was unchecked by commit-bot@chromium.org
Prior attempt to commit was detected, but we were not able to check whether the issue was successfully committed. Please check Git history manually and re-check CQ or close this issue as needed.
The CQ bit was checked by mek@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch.
Bot data: {"patchset_id": 100001, "attempt_start_ts": 1484687624102070,
"parent_rev": "064f04c82c2f6cd3e9a77703362f9373034c248a", "commit_rev":
"3cf31809c9d342cfa7c1ae2844bdacf342dd39b9"}
Message was sent while issue was closed.
Description was changed from ========== Delete and try to recreate localstorage database on invalid schema version. BUG=586194 ========== to ========== Delete and try to recreate localstorage database on invalid schema version. BUG=586194 Review-Url: https://codereview.chromium.org/2625873004 Cr-Commit-Position: refs/heads/master@{#444147} Committed: https://chromium.googlesource.com/chromium/src/+/3cf31809c9d342cfa7c1ae2844bd... ==========
Message was sent while issue was closed.
Committed patchset #5 (id:100001) as https://chromium.googlesource.com/chromium/src/+/3cf31809c9d342cfa7c1ae2844bd...
Message was sent while issue was closed.
wez@chromium.org changed reviewers: + mbarbella@chromium.org
Message was sent while issue was closed.
Hallo mbarbella@chromium.org! Due to a depot_tools patch which mistakenly removed the OWNERS check for non-source files (see crbug.com/684270), the following files landed in this CL and need a retrospective review from you: components/leveldb/public/interfaces/leveldb.mojom Thanks, Wez |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
