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

Issue 2578973002: Reload offline version on load failure (Closed)

Created:
4 years ago by Olivier
Modified:
4 years ago
CC:
chromium-reviews, stkhapugin, pkl (ping after 24h if needed), sdefresne+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Reload offline version on load failure Change the way we trigger offline version. The ReadingListWebStateObserver now listens for all page loads. If there is an error or the page is too slow, and if an offline page is available, show the native content instead. Offline page is displayed by reloading on the offline URL. BUG=671954, 671160, 671963 Committed: https://crrev.com/9d91357e728e0d6821b6fed7fdce60d3dfc95193 Cr-Commit-Position: refs/heads/master@{#440367}

Patch Set 1 #

Patch Set 2 : clean #

Patch Set 3 : create protocol #

Patch Set 4 : clean #

Total comments: 2

Patch Set 5 : Reload #

Patch Set 6 : clean #

Patch Set 7 : cleaner #

Total comments: 8

Patch Set 8 : add dismiss #

Total comments: 4

Patch Set 9 : feedback #

Total comments: 13

Patch Set 10 : Downstream merge + feedback #

Patch Set 11 : rebase #

Total comments: 17

Patch Set 12 : feedback #

Total comments: 31

Patch Set 13 : feedback #

Total comments: 2

Patch Set 14 : rebase + const #

Unified diffs Side-by-side diffs Delta from patch set Stats (+177 lines, -290 lines) Patch
M ios/chrome/browser/reading_list/BUILD.gn View 2 chunks +0 lines, -3 lines 0 comments Download
D ios/chrome/browser/reading_list/reading_list_entry_loading_util.h View 1 chunk +0 lines, -30 lines 0 comments Download
D ios/chrome/browser/reading_list/reading_list_entry_loading_util.mm View 1 chunk +0 lines, -55 lines 0 comments Download
D ios/chrome/browser/reading_list/reading_list_entry_loading_util_unittest.mm View 1 chunk +0 lines, -141 lines 0 comments Download
M ios/chrome/browser/reading_list/reading_list_web_state_observer.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +26 lines, -12 lines 0 comments Download
M ios/chrome/browser/reading_list/reading_list_web_state_observer.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +100 lines, -23 lines 0 comments Download
M ios/chrome/browser/tabs/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +3 lines, -0 lines 0 comments Download
M ios/chrome/browser/tabs/tab.mm View 1 2 3 4 5 6 7 8 9 3 chunks +10 lines, -0 lines 0 comments Download
M ios/chrome/browser/ui/reading_list/offline_page_native_content.mm View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +25 lines, -14 lines 0 comments Download
M ios/chrome/browser/ui/reading_list/reading_list_side_swipe_provider.mm View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +10 lines, -9 lines 0 comments Download
M ios/chrome/browser/ui/reading_list/reading_list_view_controller.mm View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -3 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 48 (19 generated)
Olivier
Can we agree on a solution like this? Tab will implement ReadingListWebStateObserverDelegate and just pass ...
4 years ago (2016-12-15 18:12:16 UTC) #2
Eugene But (OOO till 7-30)
https://codereview.chromium.org/2578973002/diff/60001/ios/chrome/browser/reading_list/reading_list_web_state_observer.mm File ios/chrome/browser/reading_list/reading_list_web_state_observer.mm (right): https://codereview.chromium.org/2578973002/diff/60001/ios/chrome/browser/reading_list/reading_list_web_state_observer.mm#newcode181 ios/chrome/browser/reading_list/reading_list_web_state_observer.mm:181: [delegate_ displayOfflineVersionForURL:url]; Is this a call of CRWWebController method? ...
4 years ago (2016-12-15 19:10:04 UTC) #3
Olivier
What about this solution?
4 years ago (2016-12-16 14:43:11 UTC) #6
Eugene But (OOO till 7-30)
On 2016/12/16 14:43:11, Olivier Robin wrote: > What about this solution? General direction is reasonable, ...
4 years ago (2016-12-16 15:30:31 UTC) #7
Olivier
Moved URL -> VirtualURL to another CL. PTAL.
4 years ago (2016-12-19 13:07:11 UTC) #8
Eugene But (OOO till 7-30)
Sorry I wrote these comments last week, but did not publish because I replied w/o ...
4 years ago (2016-12-19 17:52:32 UTC) #9
Olivier
Thanks. PTAL https://codereview.chromium.org/2578973002/diff/120001/ios/chrome/browser/reading_list/reading_list_web_state_observer.h File ios/chrome/browser/reading_list/reading_list_web_state_observer.h (right): https://codereview.chromium.org/2578973002/diff/120001/ios/chrome/browser/reading_list/reading_list_web_state_observer.h#newcode55 ios/chrome/browser/reading_list/reading_list_web_state_observer.h:55: // The item of the current navigation. ...
4 years ago (2016-12-19 18:26:38 UTC) #10
Eugene But (OOO till 7-30)
Could you please update CL description to fit 72 symbols https://codereview.chromium.org/2578973002/diff/160001/ios/chrome/browser/reading_list/reading_list_web_state_observer.mm File ios/chrome/browser/reading_list/reading_list_web_state_observer.mm (right): https://codereview.chromium.org/2578973002/diff/160001/ios/chrome/browser/reading_list/reading_list_web_state_observer.mm#newcode88 ...
4 years ago (2016-12-19 18:47:05 UTC) #12
kkhorimoto
This looks good, except for a possible error condition around transient NavigationEntries. https://codereview.chromium.org/2578973002/diff/140001/ios/chrome/browser/reading_list/reading_list_web_state_observer.mm File ios/chrome/browser/reading_list/reading_list_web_state_observer.mm ...
4 years ago (2016-12-19 20:27:49 UTC) #13
Eugene But (OOO till 7-30)
https://codereview.chromium.org/2578973002/diff/140001/ios/chrome/browser/reading_list/reading_list_web_state_observer.mm File ios/chrome/browser/reading_list/reading_list_web_state_observer.mm (right): https://codereview.chromium.org/2578973002/diff/140001/ios/chrome/browser/reading_list/reading_list_web_state_observer.mm#newcode92 ios/chrome/browser/reading_list/reading_list_web_state_observer.mm:92: web::NavigationItem* item = manager->GetTransientItem(); On 2016/12/19 20:27:49, kkhorimoto_ wrote: ...
4 years ago (2016-12-19 20:49:12 UTC) #14
kkhorimoto
https://codereview.chromium.org/2578973002/diff/140001/ios/chrome/browser/reading_list/reading_list_web_state_observer.mm File ios/chrome/browser/reading_list/reading_list_web_state_observer.mm (right): https://codereview.chromium.org/2578973002/diff/140001/ios/chrome/browser/reading_list/reading_list_web_state_observer.mm#newcode92 ios/chrome/browser/reading_list/reading_list_web_state_observer.mm:92: web::NavigationItem* item = manager->GetTransientItem(); On 2016/12/19 20:49:11, Eugene But ...
4 years ago (2016-12-19 21:18:50 UTC) #15
Olivier
https://codereview.chromium.org/2578973002/diff/120001/ios/chrome/browser/reading_list/reading_list_web_state_observer.mm File ios/chrome/browser/reading_list/reading_list_web_state_observer.mm (right): https://codereview.chromium.org/2578973002/diff/120001/ios/chrome/browser/reading_list/reading_list_web_state_observer.mm#newcode92 ios/chrome/browser/reading_list/reading_list_web_state_observer.mm:92: web::NavigationItem* item = manager->GetTransientItem(); On 2016/12/19 18:26:38, Olivier Robin ...
4 years ago (2016-12-20 12:29:47 UTC) #16
Eugene But (OOO till 7-30)
I have some questions regarding GetCurrentObservableIte and GetCurrentItem, but everything else looks good. I think ...
4 years ago (2016-12-20 18:11:04 UTC) #20
Olivier
On 2016/12/20 18:11:04, Eugene But wrote: > I have some questions regarding GetCurrentObservableIte and GetCurrentItem, ...
4 years ago (2016-12-20 18:34:22 UTC) #21
Eugene But (OOO till 7-30)
On 2016/12/20 18:34:22, Olivier Robin wrote: > On 2016/12/20 18:11:04, Eugene But wrote: > > ...
4 years ago (2016-12-20 19:24:06 UTC) #22
Olivier
On 2016/12/20 19:24:06, Eugene But wrote: > On 2016/12/20 18:34:22, Olivier Robin wrote: > > ...
4 years ago (2016-12-20 21:09:45 UTC) #23
Olivier
On 2016/12/20 21:09:45, Olivier Robin wrote: > On 2016/12/20 19:24:06, Eugene But wrote: > > ...
4 years ago (2016-12-20 21:15:02 UTC) #24
Eugene But (OOO till 7-30)
>> Sorry, pendingItem is *null* in didStartLoading when refreshing or entering address from Omnibox. Oh, ...
4 years ago (2016-12-20 22:23:43 UTC) #25
Olivier
https://codereview.chromium.org/2578973002/diff/200001/ios/chrome/browser/reading_list/reading_list_web_state_observer.h File ios/chrome/browser/reading_list/reading_list_web_state_observer.h (right): https://codereview.chromium.org/2578973002/diff/200001/ios/chrome/browser/reading_list/reading_list_web_state_observer.h#newcode45 ios/chrome/browser/reading_list/reading_list_web_state_observer.h:45: // Load the offline version of the URL in ...
4 years ago (2016-12-21 12:19:48 UTC) #26
Eugene But (OOO till 7-30)
Thank you for getting rid of custom GetCurrentItem method! lgtm https://codereview.chromium.org/2578973002/diff/240001/ios/chrome/browser/reading_list/reading_list_web_state_observer.h File ios/chrome/browser/reading_list/reading_list_web_state_observer.h (right): https://codereview.chromium.org/2578973002/diff/240001/ios/chrome/browser/reading_list/reading_list_web_state_observer.h#newcode48 ...
4 years ago (2016-12-21 15:48:46 UTC) #32
Olivier
All done! Thanks rohitrao, can you take a look to tab? https://codereview.chromium.org/2578973002/diff/240001/ios/chrome/browser/reading_list/reading_list_web_state_observer.h File ios/chrome/browser/reading_list/reading_list_web_state_observer.h (right): ...
4 years ago (2016-12-21 16:02:18 UTC) #34
Eugene But (OOO till 7-30)
Almost forgot. Could you please add unit tests for your changes. There used to be ...
4 years ago (2016-12-21 16:14:06 UTC) #35
Olivier
4 years ago (2016-12-21 17:08:02 UTC) #37
rohitrao (ping after 24h)
Tab lgtm https://codereview.chromium.org/2578973002/diff/260001/ios/chrome/browser/reading_list/reading_list_web_state_observer.mm File ios/chrome/browser/reading_list/reading_list_web_state_observer.mm (right): https://codereview.chromium.org/2578973002/diff/260001/ios/chrome/browser/reading_list/reading_list_web_state_observer.mm#newcode160 ios/chrome/browser/reading_list/reading_list_web_state_observer.mm:160: web_state()->RemoveUserData(kObserverKey); This is what disconnects from the ...
4 years ago (2016-12-21 17:10:42 UTC) #38
kkhorimoto
lgtm! Thanks for your patience through all the iterations of this CL!
4 years ago (2016-12-21 18:13:41 UTC) #39
Olivier
Thanks. Adding unittests is clearly non trivial. There is no WSO unittests anywhere, and there ...
4 years ago (2016-12-21 18:18:49 UTC) #40
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/2578973002/280001
4 years ago (2016-12-22 08:18:57 UTC) #43
commit-bot: I haz the power
Committed patchset #14 (id:280001)
4 years ago (2016-12-22 09:15:29 UTC) #46
commit-bot: I haz the power
4 years ago (2016-12-22 09:18:28 UTC) #48
Message was sent while issue was closed.
Patchset 14 (id:??) landed as
https://crrev.com/9d91357e728e0d6821b6fed7fdce60d3dfc95193
Cr-Commit-Position: refs/heads/master@{#440367}

Powered by Google App Engine
This is Rietveld 408576698