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

Issue 2564163002: [Offline Pages] Remove load state from public OfflinePageModel API. (Closed)

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

Description

[Offline Pages] Remove load state from public OfflinePageModel API. The only consumer of this bit is in the New Tab Page, where it is used to guard against delaying load of the NTP while the offline page model is loaded. Median time to load in stable is currently 200ms. See https://goto.google.com/ltwxu for full distribution. If this is too long we need to modify the NTP UI before landing this. BUG=673412

Patch Set 1 #

Patch Set 2 : Fix broken tests. #

Total comments: 11
Unified diffs Side-by-side diffs Delta from patch set Stats (+13 lines, -270 lines) Patch
M chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java View 1 chunk +1 line, -1 line 6 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java View 2 chunks +0 lines, -6 lines 1 comment Download
M chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java View 8 chunks +1 line, -25 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/offlinepages/evaluation/OfflinePageEvaluationBridge.java View 4 chunks +0 lines, -22 lines 0 comments Download
M chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridgeTest.java View 3 chunks +1 line, -15 lines 0 comments Download
M chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageRequestTest.java View 3 chunks +0 lines, -14 lines 0 comments Download
M chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageSavePageLaterEvaluationTest.java View 2 chunks +1 line, -15 lines 0 comments Download
M chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtilsTest.java View 3 chunks +0 lines, -14 lines 0 comments Download
M chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/FakeOfflinePageBridge.java View 1 3 chunks +4 lines, -14 lines 0 comments Download
M chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSectionTest.java View 1 2 chunks +1 line, -3 lines 0 comments Download
M chrome/browser/android/offline_pages/evaluation/offline_page_evaluation_bridge.h View 2 chunks +0 lines, -3 lines 0 comments Download
M chrome/browser/android/offline_pages/evaluation/offline_page_evaluation_bridge.cc View 3 chunks +0 lines, -14 lines 0 comments Download
M chrome/browser/android/offline_pages/offline_page_bridge.h View 2 chunks +0 lines, -3 lines 0 comments Download
M chrome/browser/android/offline_pages/offline_page_bridge.cc View 3 chunks +0 lines, -14 lines 0 comments Download
M chrome/browser/android/offline_pages/recent_tab_helper_unittest.cc View 11 chunks +0 lines, -11 lines 0 comments Download
M chrome/browser/ntp_snippets/download_suggestions_provider.h View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/ntp_snippets/download_suggestions_provider.cc View 3 chunks +0 lines, -17 lines 2 comments Download
M chrome/browser/ntp_snippets/download_suggestions_provider_unittest.cc View 1 2 chunks +0 lines, -24 lines 1 comment Download
M components/ntp_snippets/offline_pages/offline_pages_test_utils.h View 1 chunk +0 lines, -4 lines 0 comments Download
M components/ntp_snippets/offline_pages/offline_pages_test_utils.cc View 2 chunks +0 lines, -10 lines 1 comment Download
M components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.h View 1 chunk +0 lines, -1 line 0 comments Download
M components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.cc View 1 chunk +0 lines, -3 lines 0 comments Download
M components/offline_pages/core/downloads/download_ui_adapter.h View 1 chunk +0 lines, -1 line 0 comments Download
M components/offline_pages/core/downloads/download_ui_adapter.cc View 1 chunk +0 lines, -4 lines 0 comments Download
M components/offline_pages/core/offline_page_model.h View 3 chunks +4 lines, -10 lines 0 comments Download
M components/offline_pages/core/offline_page_model_impl.h View 1 chunk +0 lines, -2 lines 0 comments Download
M components/offline_pages/core/offline_page_model_impl.cc View 2 chunks +0 lines, -8 lines 0 comments Download
M components/offline_pages/core/offline_page_model_impl_unittest.cc View 4 chunks +0 lines, -7 lines 0 comments Download
M components/offline_pages/core/stub_offline_page_model.h View 1 chunk +0 lines, -1 line 0 comments Download
M components/offline_pages/core/stub_offline_page_model.cc View 1 chunk +0 lines, -3 lines 0 comments Download

Messages

Total messages: 23 (14 generated)
dewittj
Hi all, PTAL. vitalii/treib: NTP/Zine code dimich: all Thanks! https://codereview.chromium.org/2564163002/diff/20001/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 (left): https://codereview.chromium.org/2564163002/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java#oldcode151 chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java:151: ...
4 years ago (2016-12-12 19:41:53 UTC) #14
Marc Treib
https://codereview.chromium.org/2564163002/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java File chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java (right): https://codereview.chromium.org/2564163002/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java#newcode560 chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java:560: // fully loaded. Hm. I'd be more comfortable with ...
4 years ago (2016-12-13 10:11:02 UTC) #16
Bernhard Bauer
https://codereview.chromium.org/2564163002/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java File chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java (right): https://codereview.chromium.org/2564163002/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java#newcode560 chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java:560: // fully loaded. On 2016/12/13 10:11:02, Marc Treib wrote: ...
4 years ago (2016-12-14 15:55:07 UTC) #17
vitaliii
Zine providers comments. https://codereview.chromium.org/2564163002/diff/20001/chrome/browser/ntp_snippets/download_suggestions_provider.cc File chrome/browser/ntp_snippets/download_suggestions_provider.cc (left): https://codereview.chromium.org/2564163002/diff/20001/chrome/browser/ntp_snippets/download_suggestions_provider.cc#oldcode306 chrome/browser/ntp_snippets/download_suggestions_provider.cc:306: AsynchronouslyFetchOfflinePagesDownloads(/*notify=*/true); On 2016/12/13 10:11:02, Marc Treib ...
4 years ago (2016-12-15 10:20:37 UTC) #18
Marc Treib
https://codereview.chromium.org/2564163002/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java File chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java (right): https://codereview.chromium.org/2564163002/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java#newcode560 chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java:560: // fully loaded. On 2016/12/14 15:55:07, Bernhard Bauer wrote: ...
4 years ago (2016-12-15 10:36:29 UTC) #19
Bernhard Bauer
https://codereview.chromium.org/2564163002/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java File chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java (right): https://codereview.chromium.org/2564163002/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java#newcode560 chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java:560: // fully loaded. On 2016/12/15 10:36:29, Marc Treib wrote: ...
4 years ago (2016-12-15 17:48:00 UTC) #20
vitaliii
Drive-by comment. https://codereview.chromium.org/2564163002/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java File chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java (right): https://codereview.chromium.org/2564163002/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java#newcode560 chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java:560: // fully loaded. On 2016/12/15 17:48:00, Bernhard ...
4 years ago (2016-12-16 08:28:04 UTC) #21
Dmitry Titov
lgtm, from OfflinePages pov.
4 years ago (2016-12-17 02:57:35 UTC) #22
Marc Treib
4 years ago (2016-12-19 11:10:26 UTC) #23
https://codereview.chromium.org/2564163002/diff/20001/chrome/android/java/src...
File chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
(right):

https://codereview.chromium.org/2564163002/diff/20001/chrome/android/java/src...
chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java:560: //
fully loaded.
On 2016/12/15 17:48:00, Bernhard Bauer wrote:
> On 2016/12/15 10:36:29, Marc Treib wrote:
> > On 2016/12/14 15:55:07, Bernhard Bauer wrote:
> > > On 2016/12/13 10:11:02, Marc Treib wrote:
> > > > Hm. I'd be more comfortable with resolving this first, i.e. making the
> > badges
> > > > appear asynchronously. The median load time is okay, but there is quite
a
> > long
> > > > tail. +bauerb WDYT?
> > > 
> > > What is the current state exactly? Don't we already make the badges
appears
> > > asynchronously, just via explicitly listening for when the model is
loaded?
> > 
> > IIUC, the current state is: If, during NTP creation, the OfflinePageModel
> isn't
> > loaded yet, then we just don't show offline badges.
> > After this CL, we would instead block until it is loaded. (Probably the NTP
> > itself would still load, but the tiles wouldn't.)
> > We don't (yet) have the plumbing to make the offline badges appear after the
> > initial load.
> 
> What does the code in
>
https://codereview.chromium.org/2564163002/diff/20001/chrome/android/java/src...
> do then?

That handles the offline badges on article suggestions. This here is for NTP
tiles (pka MostVisited). As far as I can tell, we still don't have the plumbing
here to add the badges after the tiles themselves.

Powered by Google App Engine
This is Rietveld 408576698