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

Issue 2469933002: Offline Pages: Replace Observer::OfflinePageModelChanged with OfflinePageAdded. (Closed)

Created:
4 years, 1 month ago by dewittj
Modified:
4 years ago
CC:
chromium-reviews, ntp-dev+reviews_chromium.org, romax+watch_chromium.org, fgorski+watch_chromium.org, dewittj+watch_chromium.org, petewil+watch_chromium.org, chili+watch_chromium.org, dimich+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Offline Pages: Replace Observer::OfflinePageModelChanged with OfflinePageAdded. The Observer API is somewhat misleading because the OfflinePageModelChanged function is not called for all model changes. This renames the function and passes the actual page that was added, which can reduce the query load for observers. BUG=565575 Committed: https://crrev.com/011a526e4b9923dd648df7b2d6914ea7e6f109fe Cr-Commit-Position: refs/heads/master@{#437114}

Patch Set 1 #

Patch Set 2 : Touch ups. #

Total comments: 16

Patch Set 3 : Address PS2 comments. #

Patch Set 4 : Rebased on query patch. #

Patch Set 5 : Fixup the tests. #

Patch Set 6 : Rebase. #

Patch Set 7 : Just do the rename, leave optimization for later. #

Patch Set 8 : clang #

Patch Set 9 : Test fix #

Total comments: 4

Patch Set 10 : Rebase. #

Total comments: 9

Patch Set 11 : bauerb comments. #

Patch Set 12 : Rename observer count accessor in tests. #

Total comments: 4

Patch Set 13 : Rebase #

Patch Set 14 : nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+153 lines, -89 lines) Patch
M chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java View 1 2 3 4 5 6 7 8 9 10 11 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 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/android/offline_pages/evaluation/offline_page_evaluation_bridge.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/android/offline_pages/evaluation/offline_page_evaluation_bridge.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -2 lines 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 1 chunk +2 lines, -1 line 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 1 chunk +5 lines, -2 lines 0 comments Download
M chrome/browser/android/offline_pages/recent_tab_helper_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 chunks +22 lines, -22 lines 0 comments Download
M chrome/browser/ntp_snippets/download_suggestions_provider.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/ntp_snippets/download_suggestions_provider.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +4 lines, -2 lines 0 comments Download
M chrome/browser/ntp_snippets/download_suggestions_provider_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 6 chunks +21 lines, -24 lines 0 comments Download
M components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -1 line 0 comments Download
M components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -2 lines 0 comments Download
M components/ntp_snippets/offline_pages/recent_tab_suggestions_provider_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 10 chunks +58 lines, -14 lines 0 comments Download
M components/offline_pages/core/downloads/download_ui_adapter.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -1 line 0 comments Download
M components/offline_pages/core/downloads/download_ui_adapter.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -1 line 0 comments Download
M components/offline_pages/core/downloads/download_ui_adapter_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M components/offline_pages/core/offline_page_model.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -3 lines 0 comments Download
M components/offline_pages/core/offline_page_model_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +7 lines, -1 line 0 comments Download
M components/offline_pages/core/offline_page_model_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +8 lines, -6 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 79 (61 generated)
dewittj
4 years, 1 month ago (2016-11-01 21:53:53 UTC) #7
Dmitry Titov
https://codereview.chromium.org/2469933002/diff/20001/chrome/browser/android/offline_pages/offline_page_bridge.cc File chrome/browser/android/offline_pages/offline_page_bridge.cc (right): https://codereview.chromium.org/2469933002/diff/20001/chrome/browser/android/offline_pages/offline_page_bridge.cc#newcode293 chrome/browser/android/offline_pages/offline_page_bridge.cc:293: // TODO(dewittj): Change the Java side to use OfflinePageAdded. ...
4 years, 1 month ago (2016-11-02 07:15:37 UTC) #10
fgorski
https://codereview.chromium.org/2469933002/diff/20001/components/ntp_snippets/offline_pages/offline_page_proxy.cc File components/ntp_snippets/offline_pages/offline_page_proxy.cc (right): https://codereview.chromium.org/2469933002/diff/20001/components/ntp_snippets/offline_pages/offline_page_proxy.cc#newcode46 components/ntp_snippets/offline_pages/offline_page_proxy.cc:46: void OfflinePageProxy::OfflinePageAdded(OfflinePageModel* model, Please ping the owners of this ...
4 years, 1 month ago (2016-11-02 15:51:07 UTC) #12
dewittj
https://codereview.chromium.org/2469933002/diff/20001/chrome/browser/android/offline_pages/offline_page_bridge.cc File chrome/browser/android/offline_pages/offline_page_bridge.cc (right): https://codereview.chromium.org/2469933002/diff/20001/chrome/browser/android/offline_pages/offline_page_bridge.cc#newcode293 chrome/browser/android/offline_pages/offline_page_bridge.cc:293: // TODO(dewittj): Change the Java side to use OfflinePageAdded. ...
4 years, 1 month ago (2016-11-02 16:34:37 UTC) #17
fgorski
lgtm
4 years, 1 month ago (2016-11-15 00:25:29 UTC) #43
Dmitry Titov
https://codereview.chromium.org/2469933002/diff/180001/components/offline_pages/downloads/download_ui_adapter.cc File components/offline_pages/downloads/download_ui_adapter.cc (right): https://codereview.chromium.org/2469933002/diff/180001/components/offline_pages/downloads/download_ui_adapter.cc#newcode86 components/offline_pages/downloads/download_ui_adapter.cc:86: model_->GetAllPages( Now the impl of this should change to ...
4 years, 1 month ago (2016-11-15 20:02:30 UTC) #44
dewittj
https://codereview.chromium.org/2469933002/diff/180001/components/offline_pages/downloads/download_ui_adapter.cc File components/offline_pages/downloads/download_ui_adapter.cc (right): https://codereview.chromium.org/2469933002/diff/180001/components/offline_pages/downloads/download_ui_adapter.cc#newcode86 components/offline_pages/downloads/download_ui_adapter.cc:86: model_->GetAllPages( On 2016/11/15 20:02:30, Dmitry Titov wrote: > Now ...
4 years, 1 month ago (2016-11-15 23:54:19 UTC) #45
Dmitry Titov
LGTM, but please do follow up with the other parts of this.
4 years, 1 month ago (2016-11-16 22:33:57 UTC) #50
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/2469933002/200001
4 years ago (2016-12-06 00:25:58 UTC) #57
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/318961)
4 years ago (2016-12-06 00:33:41 UTC) #59
dewittj
bauerb@chromium.org: Please review changes in //components/ntp_snippets //chrome/browser/ntp_snippets SuggestionsSection.java Thanks!
4 years ago (2016-12-06 00:37:31 UTC) #61
Bernhard Bauer
https://codereview.chromium.org/2469933002/diff/200001/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java File chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java (right): https://codereview.chromium.org/2469933002/diff/200001/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java#newcode152 chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java:152: public void offlinePageAdded(final OfflinePageItem addedPage) { Nit: The `final` ...
4 years ago (2016-12-06 17:17:17 UTC) #62
dewittj
https://codereview.chromium.org/2469933002/diff/200001/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java File chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java (right): https://codereview.chromium.org/2469933002/diff/200001/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java#newcode152 chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java:152: public void offlinePageAdded(final OfflinePageItem addedPage) { On 2016/12/06 17:17:17, ...
4 years ago (2016-12-06 17:49:56 UTC) #63
Bernhard Bauer
Thanks! LGTM with some nits. https://codereview.chromium.org/2469933002/diff/200001/components/ntp_snippets/offline_pages/recent_tab_suggestions_provider_unittest.cc File components/ntp_snippets/offline_pages/recent_tab_suggestions_provider_unittest.cc (right): https://codereview.chromium.org/2469933002/diff/200001/components/ntp_snippets/offline_pages/recent_tab_suggestions_provider_unittest.cc#newcode91 components/ntp_snippets/offline_pages/recent_tab_suggestions_provider_unittest.cc:91: auto end = model_.mutable_items()->end(); ...
4 years ago (2016-12-07 15:44:41 UTC) #68
dewittj
hm, might hold off on the yak shaving :) Thanks! https://codereview.chromium.org/2469933002/diff/240001/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/2469933002/diff/240001/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java#newcode81 ...
4 years ago (2016-12-07 23:28:14 UTC) #71
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/2469933002/280001
4 years ago (2016-12-07 23:29:00 UTC) #74
commit-bot: I haz the power
Committed patchset #14 (id:280001)
4 years ago (2016-12-08 01:27:56 UTC) #77
commit-bot: I haz the power
4 years ago (2016-12-08 01:33:22 UTC) #79
Message was sent while issue was closed.
Patchset 14 (id:??) landed as
https://crrev.com/011a526e4b9923dd648df7b2d6914ea7e6f109fe
Cr-Commit-Position: refs/heads/master@{#437114}

Powered by Google App Engine
This is Rietveld 408576698