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

Issue 1694863003: Refactor the offline page storage to include client namespace and id. (Closed)

Created:
4 years, 10 months ago by bburns
Modified:
4 years, 9 months ago
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactor the offline page storage to include client namespace and id. BUG= Committed: https://crrev.com/16d153334496e8eb7aeeb7352515a6dbe97d95d3 Cr-Commit-Position: refs/heads/master@{#379153}

Patch Set 1 #

Total comments: 18

Patch Set 2 : address changes. #

Patch Set 3 : address comments. #

Total comments: 6

Patch Set 4 : address comments. #

Total comments: 30

Patch Set 5 : address changes. #

Total comments: 8

Patch Set 6 : address comments. #

Patch Set 7 : address comments #

Patch Set 8 : move id generation to C++, add DB migration #

Total comments: 21

Patch Set 9 : address commentswq #

Total comments: 2

Patch Set 10 : address comments #

Total comments: 37

Patch Set 11 : fix tests. #

Patch Set 12 : address comments. #

Patch Set 13 : rebase #

Patch Set 14 : fix unit tests #

Patch Set 15 : address changes #

Patch Set 16 : address comments #

Patch Set 17 : address comments #

Patch Set 18 : address comments #

Patch Set 19 : address changes #

Patch Set 20 : address changes #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+687 lines, -338 lines) Patch
M chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkEditActivity.java View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkModel.java View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 14 chunks +76 lines, -28 lines 0 comments Download
M chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridgeTest.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +2 lines, -5 lines 0 comments Download
M chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtilsTest.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/android/offline_pages/offline_page_bridge.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +19 lines, -11 lines 0 comments Download
M chrome/browser/android/offline_pages/offline_page_bridge.cc View 1 2 3 4 5 6 7 8 9 10 11 12 8 chunks +54 lines, -35 lines 0 comments Download
M chrome/browser/android/offline_pages/offline_page_tab_helper_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 6 chunks +12 lines, -5 lines 0 comments Download
M chrome/browser/android/offline_pages/offline_page_utils.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +10 lines, -1 line 0 comments Download
M chrome/browser/android/offline_pages/offline_page_utils_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 7 chunks +23 lines, -10 lines 0 comments Download
M components/offline_pages/offline_page_item.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +24 lines, -4 lines 0 comments Download
M components/offline_pages/offline_page_item.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +18 lines, -4 lines 0 comments Download
M components/offline_pages/offline_page_metadata_store.h View 1 chunk +1 line, -1 line 0 comments Download
M components/offline_pages/offline_page_metadata_store_impl.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +10 lines, -2 lines 0 comments Download
M components/offline_pages/offline_page_metadata_store_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 9 chunks +62 lines, -11 lines 2 comments Download
M components/offline_pages/offline_page_metadata_store_impl_unittest.cc View 1 2 3 4 5 6 7 8 15 chunks +21 lines, -14 lines 0 comments Download
M components/offline_pages/offline_page_model.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 7 chunks +37 lines, -23 lines 0 comments Download
M components/offline_pages/offline_page_model.cc View 1 2 3 4 5 6 7 8 9 10 11 23 chunks +127 lines, -81 lines 0 comments Download
M components/offline_pages/offline_page_model_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 33 chunks +161 lines, -89 lines 0 comments Download
M components/offline_pages/offline_page_test_store.h View 1 chunk +2 lines, -2 lines 0 comments Download
M components/offline_pages/offline_page_test_store.cc View 2 chunks +7 lines, -7 lines 0 comments Download
M components/offline_pages/proto/offline_pages.proto View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +16 lines, -2 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 45 (11 generated)
bburns
Please take a look. This is part #1, it doesn't actually enable multiple namespaces, or ...
4 years, 10 months ago (2016-02-12 21:19:46 UTC) #2
fgorski
I'll take a second look when you sort out compilation issues. But it looks pretty ...
4 years, 10 months ago (2016-02-12 21:43:41 UTC) #3
Dmitry Titov
https://codereview.chromium.org/1694863003/diff/1/components/offline_pages/offline_page_model.h File components/offline_pages/offline_page_model.h (right): https://codereview.chromium.org/1694863003/diff/1/components/offline_pages/offline_page_model.h#newcode155 components/offline_pages/offline_page_model.h:155: int64_t offline_id, I don't know if you want to ...
4 years, 10 months ago (2016-02-12 21:46:51 UTC) #4
bburns
Comments addressed. (and more...) This should now match the design doc. Please take another look. ...
4 years, 10 months ago (2016-02-20 01:14:18 UTC) #5
dewittj
If I understand correctly, we intend to just autogenerate offline_ids on behalf of clients. (My ...
4 years, 10 months ago (2016-02-22 19:23:16 UTC) #6
bburns
Comments (mostly) addressed. please take another look. https://codereview.chromium.org/1694863003/diff/40001/components/offline_pages/offline_page_item.h File components/offline_pages/offline_page_item.h (right): https://codereview.chromium.org/1694863003/diff/40001/components/offline_pages/offline_page_item.h#newcode19 components/offline_pages/offline_page_item.h:19: struct ClientId ...
4 years, 10 months ago (2016-02-22 21:02:31 UTC) #7
fgorski
https://codereview.chromium.org/1694863003/diff/60001/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java File chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java (right): https://codereview.chromium.org/1694863003/diff/60001/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java#newcode91 chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java:91: public void offlinePageDeleted(BookmarkId bookmarkId) {} I think this is ...
4 years, 10 months ago (2016-02-23 17:15:31 UTC) #8
bburns
Comments addressed. TODO'd a couple of things. Please take another look. Thanks! --brendan https://codereview.chromium.org/1694863003/diff/60001/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java File ...
4 years, 10 months ago (2016-02-23 19:25:39 UTC) #9
Dmitry Titov
https://codereview.chromium.org/1694863003/diff/80001/components/offline_pages/offline_page_model.cc File components/offline_pages/offline_page_model.cc (right): https://codereview.chromium.org/1694863003/diff/80001/components/offline_pages/offline_page_model.cc#newcode504 components/offline_pages/offline_page_model.cc:504: cid.name_space = "bookmark"; This should be pulled into a ...
4 years, 10 months ago (2016-02-23 20:35:20 UTC) #10
bburns
comments addressed, please take another look. thanks! --brendan https://codereview.chromium.org/1694863003/diff/80001/components/offline_pages/offline_page_model.cc File components/offline_pages/offline_page_model.cc (right): https://codereview.chromium.org/1694863003/diff/80001/components/offline_pages/offline_page_model.cc#newcode504 components/offline_pages/offline_page_model.cc:504: cid.name_space ...
4 years, 10 months ago (2016-02-23 20:58:30 UTC) #11
bburns
ugh, there are some more bugs to wring out. I will ping this CL when ...
4 years, 10 months ago (2016-02-23 22:06:49 UTC) #12
bburns
Ok, this has been validated to work both on the upgrade case and the clean ...
4 years, 10 months ago (2016-02-24 00:16:24 UTC) #13
Dmitry Titov
This is ok, it's better to iterate on it before it lands! Almost there. This ...
4 years, 10 months ago (2016-02-24 01:26:18 UTC) #14
bburns
Ok, I've done both of the suggestions. please take another look. Thanks! --brendan
4 years, 10 months ago (2016-02-24 18:42:26 UTC) #15
Dmitry Titov
Here we go! This can be the final round! https://codereview.chromium.org/1694863003/diff/140001/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java File chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java (right): https://codereview.chromium.org/1694863003/diff/140001/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java#newcode284 chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java:284: ...
4 years, 10 months ago (2016-02-25 03:31:53 UTC) #16
bburns
Comments addressed, please take another look. Thanks! --brendan https://codereview.chromium.org/1694863003/diff/140001/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java File chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java (right): https://codereview.chromium.org/1694863003/diff/140001/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java#newcode284 chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java:284: callback.onSavePageDone(SavePageResult.CONTENT_UNAVAILABLE, ...
4 years, 10 months ago (2016-02-26 00:14:36 UTC) #17
Dmitry Titov
LGTM You need lgtm from both fgorski and dewittj as well before landing (all reviewers ...
4 years, 10 months ago (2016-02-26 01:25:11 UTC) #18
Dmitry Titov
One tiny nit (I think it's a stray keystroke): https://codereview.chromium.org/1694863003/diff/160001/components/offline_pages/offline_page_metadata_store_impl.h File components/offline_pages/offline_page_metadata_store_impl.h (right): https://codereview.chromium.org/1694863003/diff/160001/components/offline_pages/offline_page_metadata_store_impl.h#newcode28 components/offline_pages/offline_page_metadata_store_impl.h:28: ...
4 years, 10 months ago (2016-02-26 01:27:44 UTC) #19
bburns
typo fixed. fgorski, dewittj, I can haz lgtmz? Thanks! --brendan https://codereview.chromium.org/1694863003/diff/160001/components/offline_pages/offline_page_metadata_store_impl.h File components/offline_pages/offline_page_metadata_store_impl.h (right): https://codereview.chromium.org/1694863003/diff/160001/components/offline_pages/offline_page_metadata_store_impl.h#newcode28 ...
4 years, 10 months ago (2016-02-26 17:26:39 UTC) #20
dewittj
https://codereview.chromium.org/1694863003/diff/180001/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java File chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java (right): https://codereview.chromium.org/1694863003/diff/180001/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java#newcode232 chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java:232: public Set<Long> getOfflineIdsForClientId(String clientIdNamespace, String clientId) { This can ...
4 years, 10 months ago (2016-02-26 18:42:56 UTC) #21
fgorski
lgtm https://codereview.chromium.org/1694863003/diff/180001/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java File chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java (right): https://codereview.chromium.org/1694863003/diff/180001/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java#newcode357 chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java:357: long[] ids = new long[idList.size()]; Will this work? ...
4 years, 10 months ago (2016-02-26 19:29:22 UTC) #22
dewittj
https://codereview.chromium.org/1694863003/diff/180001/components/offline_pages/offline_page_model.cc File components/offline_pages/offline_page_model.cc (right): https://codereview.chromium.org/1694863003/diff/180001/components/offline_pages/offline_page_model.cc#newcode778 components/offline_pages/offline_page_model.cc:778: int64_t result = base::RandUint64(); On 2016/02/26 19:29:22, fgorski wrote: ...
4 years, 10 months ago (2016-02-26 19:39:26 UTC) #23
bburns
comments addressed, please re-check. Thanks! --brendan https://codereview.chromium.org/1694863003/diff/180001/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java File chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java (right): https://codereview.chromium.org/1694863003/diff/180001/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java#newcode256 chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java:256: Long offlineId = ...
4 years, 10 months ago (2016-02-27 00:48:20 UTC) #24
dewittj
lgtm I'm a little wary of using a randint as a unique id, but based ...
4 years, 10 months ago (2016-02-27 01:06:39 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1694863003/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1694863003/220001
4 years, 9 months ago (2016-03-01 20:56:16 UTC) #28
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/188572)
4 years, 9 months ago (2016-03-01 21:03:27 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1694863003/380001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1694863003/380001
4 years, 9 months ago (2016-03-03 19:42:02 UTC) #33
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/153041)
4 years, 9 months ago (2016-03-03 19:53:53 UTC) #35
bburns
ianwen: for OWNERS on bookmarks
4 years, 9 months ago (2016-03-03 20:24:01 UTC) #37
Ian Wen
lgtm.
4 years, 9 months ago (2016-03-03 22:38:23 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1694863003/380001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1694863003/380001
4 years, 9 months ago (2016-03-04 00:27:04 UTC) #40
commit-bot: I haz the power
Committed patchset #20 (id:380001)
4 years, 9 months ago (2016-03-04 00:34:25 UTC) #41
commit-bot: I haz the power
Patchset 20 (id:??) landed as https://crrev.com/16d153334496e8eb7aeeb7352515a6dbe97d95d3 Cr-Commit-Position: refs/heads/master@{#379153}
4 years, 9 months ago (2016-03-04 00:36:41 UTC) #43
jianli
4 years, 9 months ago (2016-03-05 00:58:57 UTC) #45
Message was sent while issue was closed.
https://codereview.chromium.org/1694863003/diff/380001/components/offline_pag...
File components/offline_pages/offline_page_metadata_store_impl.cc (right):

https://codereview.chromium.org/1694863003/diff/380001/components/offline_pag...
components/offline_pages/offline_page_metadata_store_impl.cc:183:
keys_to_remove->push_back(item.client_id.id);
What if new auto-generated offline id happens to be same as old bookmark id,
though this should be rare? We could end up with deleting the entry instead.

https://codereview.chromium.org/1694863003/diff/380001/components/offline_pag...
components/offline_pages/offline_page_metadata_store_impl.cc:307: // If the
update failed, log and keep going.  We'll try to
We're having some sort of inconsistency between store and cache and this could
potentially cause problem.

For example, if we fail to update an entry but it still lives in the cache. If
we change a property for this item, we're going to write back to the store.
Assume the write succeeds. Next time when store is loaded, we still detect the
old entry and try to create a new one for it.

Powered by Google App Engine
This is Rietveld 408576698