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

Issue 1721103002: Switch between online and offline version per network connection (Closed)

Created:
4 years, 10 months ago by jianli
Modified:
4 years, 10 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

Switch between online and offline version of saved page per network connection: If the user is navigating to an online version of saved page and there is no network connection, we should load the offline copy instead. If the user is loading an offline copy and there is network connection, we should load the online version instead. BUG=584417 Committed: https://crrev.com/03b1a6f719fc5016260be23a6d8593d89e06da68 Cr-Commit-Position: refs/heads/master@{#378073}

Patch Set 1 : Patch #

Total comments: 3

Patch Set 2 : Patch #

Total comments: 10

Patch Set 3 : Address feedback #

Total comments: 17

Patch Set 4 : Fix #

Total comments: 4

Patch Set 5 : Changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+389 lines, -0 lines) Patch
A chrome/browser/android/offline_pages/offline_page_tab_helper.h View 1 2 3 4 1 chunk +54 lines, -0 lines 0 comments Download
A chrome/browser/android/offline_pages/offline_page_tab_helper.cc View 1 2 3 4 1 chunk +117 lines, -0 lines 0 comments Download
A chrome/browser/android/offline_pages/offline_page_tab_helper_unittest.cc View 1 2 3 4 1 chunk +195 lines, -0 lines 0 comments Download
M chrome/browser/ui/tab_helpers.cc View 1 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 1 chunk +1 line, -0 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 1 chunk +18 lines, -0 lines 0 comments Download

Messages

Total messages: 33 (13 generated)
Pete Williamson
https://codereview.chromium.org/1721103002/diff/20001/chrome/browser/android/offline_pages/offline_page_tab_helper.cc File chrome/browser/android/offline_pages/offline_page_tab_helper.cc (right): https://codereview.chromium.org/1721103002/diff/20001/chrome/browser/android/offline_pages/offline_page_tab_helper.cc#newcode21 chrome/browser/android/offline_pages/offline_page_tab_helper.cc:21: return connection != net::NetworkChangeNotifier::CONNECTION_NONE && Let's replace this IsOnline ...
4 years, 10 months ago (2016-02-23 23:13:47 UTC) #3
Pete Williamson
https://codereview.chromium.org/1721103002/diff/20001/chrome/browser/android/offline_pages/offline_page_tab_helper.cc File chrome/browser/android/offline_pages/offline_page_tab_helper.cc (right): https://codereview.chromium.org/1721103002/diff/20001/chrome/browser/android/offline_pages/offline_page_tab_helper.cc#newcode41 chrome/browser/android/offline_pages/offline_page_tab_helper.cc:41: if (!IsOnline() || On 2016/02/23 23:13:47, Pete Williamson wrote: ...
4 years, 10 months ago (2016-02-24 00:35:33 UTC) #4
jianli
petewil for offline pages creis for web contents rkaplow for UMA
4 years, 10 months ago (2016-02-25 02:21:35 UTC) #8
Pete Williamson
https://codereview.chromium.org/1721103002/diff/40001/chrome/browser/android/offline_pages/offline_page_tab_helper.cc File chrome/browser/android/offline_pages/offline_page_tab_helper.cc (right): https://codereview.chromium.org/1721103002/diff/40001/chrome/browser/android/offline_pages/offline_page_tab_helper.cc#newcode46 chrome/browser/android/offline_pages/offline_page_tab_helper.cc:46: net::NetworkChangeNotifier::CONNECTION_NONE) { Why not use if (!NetworkChangeNotifier::IsOnline()) here instead? ...
4 years, 10 months ago (2016-02-25 18:05:31 UTC) #9
jianli
https://codereview.chromium.org/1721103002/diff/40001/chrome/browser/android/offline_pages/offline_page_tab_helper.cc File chrome/browser/android/offline_pages/offline_page_tab_helper.cc (right): https://codereview.chromium.org/1721103002/diff/40001/chrome/browser/android/offline_pages/offline_page_tab_helper.cc#newcode46 chrome/browser/android/offline_pages/offline_page_tab_helper.cc:46: net::NetworkChangeNotifier::CONNECTION_NONE) { On 2016/02/25 18:05:30, Pete Williamson wrote: > ...
4 years, 10 months ago (2016-02-25 21:34:52 UTC) #11
Pete Williamson
lgtm
4 years, 10 months ago (2016-02-25 21:58:17 UTC) #12
nasko
A bunch of comments, mostly on the unit test. https://codereview.chromium.org/1721103002/diff/60001/chrome/browser/android/offline_pages/offline_page_tab_helper.cc File chrome/browser/android/offline_pages/offline_page_tab_helper.cc (right): https://codereview.chromium.org/1721103002/diff/60001/chrome/browser/android/offline_pages/offline_page_tab_helper.cc#newcode50 chrome/browser/android/offline_pages/offline_page_tab_helper.cc:50: ...
4 years, 10 months ago (2016-02-26 00:12:19 UTC) #13
jianli
Also switched to using DidStartNavigation and DidFinishNavigation. https://codereview.chromium.org/1721103002/diff/60001/chrome/browser/android/offline_pages/offline_page_tab_helper.cc File chrome/browser/android/offline_pages/offline_page_tab_helper.cc (right): https://codereview.chromium.org/1721103002/diff/60001/chrome/browser/android/offline_pages/offline_page_tab_helper.cc#newcode50 chrome/browser/android/offline_pages/offline_page_tab_helper.cc:50: web_contents()->GetBrowserContext(), validated_url); ...
4 years, 10 months ago (2016-02-26 03:03:22 UTC) #14
nasko
https://codereview.chromium.org/1721103002/diff/80001/chrome/browser/android/offline_pages/offline_page_tab_helper_unittest.cc File chrome/browser/android/offline_pages/offline_page_tab_helper_unittest.cc (right): https://codereview.chromium.org/1721103002/diff/80001/chrome/browser/android/offline_pages/offline_page_tab_helper_unittest.cc#newcode54 chrome/browser/android/offline_pages/offline_page_tab_helper_unittest.cc:54: //public content::RenderViewHostImplTestHarness, Remove commented out inheritance.
4 years, 10 months ago (2016-02-26 15:42:57 UTC) #15
Pete Williamson
On 2016/02/26 15:42:57, nasko wrote: > https://codereview.chromium.org/1721103002/diff/80001/chrome/browser/android/offline_pages/offline_page_tab_helper_unittest.cc > File chrome/browser/android/offline_pages/offline_page_tab_helper_unittest.cc > (right): > > https://codereview.chromium.org/1721103002/diff/80001/chrome/browser/android/offline_pages/offline_page_tab_helper_unittest.cc#newcode54 ...
4 years, 10 months ago (2016-02-26 17:16:04 UTC) #16
rkaplow
lgtm lgtm for histograms ( with unit) https://codereview.chromium.org/1721103002/diff/80001/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/1721103002/diff/80001/tools/metrics/histograms/histograms.xml#newcode31778 tools/metrics/histograms/histograms.xml:31778: +<histogram name="OfflinePages.RedirectToOfflineCount"> ...
4 years, 10 months ago (2016-02-26 22:08:46 UTC) #17
jianli
Changed back to use DidFailProvisionalLoad instead of DidFinishNavigation since SimulateNavigationError does not trigger the latter. ...
4 years, 10 months ago (2016-02-26 23:02:41 UTC) #18
jianli
avi, could you please review adding a new tab helper? thanks.
4 years, 10 months ago (2016-02-26 23:03:29 UTC) #20
Avi (use Gerrit)
tab_helpers.cc change LGTM
4 years, 10 months ago (2016-02-26 23:06:24 UTC) #21
nasko
LGTM with the understanding that the code will still have some changes to move to ...
4 years, 10 months ago (2016-02-26 23:10:08 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1721103002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1721103002/100001
4 years, 10 months ago (2016-02-26 23:17:43 UTC) #25
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/188216)
4 years, 10 months ago (2016-02-27 00:43:41 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1721103002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1721103002/100001
4 years, 10 months ago (2016-02-27 00:53:03 UTC) #29
commit-bot: I haz the power
Committed patchset #5 (id:100001)
4 years, 10 months ago (2016-02-27 01:58:07 UTC) #31
commit-bot: I haz the power
4 years, 10 months ago (2016-02-27 01:59:02 UTC) #33
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/03b1a6f719fc5016260be23a6d8593d89e06da68
Cr-Commit-Position: refs/heads/master@{#378073}

Powered by Google App Engine
This is Rietveld 408576698