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

Issue 2602473004: Offline Page Cache uses user interaction triggers for saving pages. (Closed)

Created:
4 years ago by carlosk
Modified:
3 years, 11 months ago
Reviewers:
Dmitry Titov, dewittj
CC:
chromium-reviews, dewittj+watch_chromium.org, fgorski+watch_chromium.org, romax+watch_chromium.org, petewil+watch_chromium.org, chili+watch_chromium.org, asvitkine+watch_chromium.org, dimich+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Offline Page Cache uses user interaction triggers for saving pages. This switches Offline Page Cache (aka last_n) to listen to user interaction triggers instead of navigation events for starting page snapshots. The latter are still monitored and important to allow the quality estimation of the page being loaded but they just don't cause snapshot creation by themselves anymore. Tests were also updated to work with this new mechanism. BUG=678367 Review-Url: https://codereview.chromium.org/2602473004 Cr-Commit-Position: refs/heads/master@{#445183} Committed: https://chromium.googlesource.com/chromium/src/+/6b26b7a9ba6b62730399c632dac0fcbfce0a15bd

Patch Set 1 #

Patch Set 2 : Added missing histogram.xml entry for new feature; minor changes. #

Patch Set 3 : Rebased and added the other missing histogram.xml entry... #

Total comments: 11

Patch Set 4 : Rebase. #

Patch Set 5 : Address comments before fully removing the navitation triggers for last N. #

Patch Set 6 : Rebase. #

Patch Set 7 : Fully implemented the new user interaction triggers. Updated tests. #

Total comments: 3

Patch Set 8 : Minor changes. #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+559 lines, -260 lines) Patch
M chrome/browser/android/offline_pages/recent_tab_helper.h View 1 2 3 4 5 6 7 5 chunks +36 lines, -15 lines 2 comments Download
M chrome/browser/android/offline_pages/recent_tab_helper.cc View 1 2 3 4 5 6 7 6 chunks +146 lines, -85 lines 4 comments Download
M chrome/browser/android/offline_pages/recent_tab_helper_unittest.cc View 1 2 3 4 5 6 11 chunks +347 lines, -156 lines 0 comments Download
M components/offline_pages/core/snapshot_controller.h View 1 3 chunks +22 lines, -1 line 0 comments Download
M components/offline_pages/core/snapshot_controller.cc View 3 chunks +8 lines, -3 lines 0 comments Download

Messages

Total messages: 37 (26 generated)
carlosk
dimich@, dewittj@: PTAL. You might consider this is not land-able on its current form. Let's ...
3 years, 11 months ago (2017-01-04 20:52:48 UTC) #12
Dmitry Titov
Initial comments. I like the idea of adding a second separate flag for trigger-based capture. ...
3 years, 11 months ago (2017-01-05 21:50:03 UTC) #13
dewittj
agree with dmitry that some logic separation would be a big win here. https://codereview.chromium.org/2602473004/diff/40001/chrome/browser/android/offline_pages/recent_tab_helper.cc File ...
3 years, 11 months ago (2017-01-07 00:50:09 UTC) #14
carlosk
Thanks. Just replying to comments and uploading last minor changes before fully removing the listening ...
3 years, 11 months ago (2017-01-17 23:16:27 UTC) #15
carlosk
dimich@: PTAL. dewittj@: FYI. This patch set implements the new triggers and fully removes the ...
3 years, 11 months ago (2017-01-20 02:56:03 UTC) #25
Dmitry Titov
As far as I can see it's LGTM. I tried to 'simulate' several scenarios through ...
3 years, 11 months ago (2017-01-20 06:25:36 UTC) #28
carlosk
Thanks. https://codereview.chromium.org/2602473004/diff/160001/chrome/browser/android/offline_pages/recent_tab_helper.cc File chrome/browser/android/offline_pages/recent_tab_helper.cc (right): https://codereview.chromium.org/2602473004/diff/160001/chrome/browser/android/offline_pages/recent_tab_helper.cc#newcode153 chrome/browser/android/offline_pages/recent_tab_helper.cc:153: weak_ptr_factory_.InvalidateWeakPtrs(); Note that now this is the only ...
3 years, 11 months ago (2017-01-20 07:49:41 UTC) #29
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/2602473004/180001
3 years, 11 months ago (2017-01-20 21:20:15 UTC) #32
commit-bot: I haz the power
Committed patchset #8 (id:180001) as https://chromium.googlesource.com/chromium/src/+/6b26b7a9ba6b62730399c632dac0fcbfce0a15bd
3 years, 11 months ago (2017-01-20 22:21:50 UTC) #35
dewittj
generally lgtm https://codereview.chromium.org/2602473004/diff/180001/chrome/browser/android/offline_pages/recent_tab_helper.cc File chrome/browser/android/offline_pages/recent_tab_helper.cc (right): https://codereview.chromium.org/2602473004/diff/180001/chrome/browser/android/offline_pages/recent_tab_helper.cc#newcode191 chrome/browser/android/offline_pages/recent_tab_helper.cc:191: downloads_latest_snapshot_info_.get()); reset both snapshot infos? https://codereview.chromium.org/2602473004/diff/180001/chrome/browser/android/offline_pages/recent_tab_helper.cc#newcode197 chrome/browser/android/offline_pages/recent_tab_helper.cc:197: ...
3 years, 11 months ago (2017-01-20 22:41:26 UTC) #36
carlosk
3 years, 11 months ago (2017-01-20 23:04:35 UTC) #37
Message was sent while issue was closed.
Thanks.

https://codereview.chromium.org/2602473004/diff/180001/chrome/browser/android...
File chrome/browser/android/offline_pages/recent_tab_helper.cc (right):

https://codereview.chromium.org/2602473004/diff/180001/chrome/browser/android...
chrome/browser/android/offline_pages/recent_tab_helper.cc:191:
downloads_latest_snapshot_info_.get());
On 2017/01/20 22:41:26, dewittj wrote:
> reset both snapshot infos?

This would be a 2nd step safe guard.

The line below is the 1st step safeguard as this instance should be destroyed
anyway along with the WebContents. I added it just in case the destruction
process takes more than one posted-task so we interrupt any ongoing operations.
Resetting those would only help if yet another request happened in the meantime.

https://codereview.chromium.org/2602473004/diff/180001/chrome/browser/android...
chrome/browser/android/offline_pages/recent_tab_helper.cc:197: // saving a
snapshot is probably useless (low probability of the user undoing
On 2017/01/20 22:41:26, dewittj wrote:
> Do you have a metric to back up your parenthetical?

Yes. Metrics show that tab closures are undone less than .5% of times.

https://codereview.chromium.org/2602473004/diff/180001/chrome/browser/android...
File chrome/browser/android/offline_pages/recent_tab_helper.h (right):

https://codereview.chromium.org/2602473004/diff/180001/chrome/browser/android...
chrome/browser/android/offline_pages/recent_tab_helper.h:25: using PageQuality =
SnapshotController::PageQuality;
On 2017/01/20 22:41:26, dewittj wrote:
> Does this pollute the namespace? in other words, could someone else refer to
> offline_pages::PageQuality?  If so we should not alias this here.

I'm unsure but I agree it's a problem. I'll move this into the .CC and use the
full namespace name here.

Powered by Google App Engine
This is Rietveld 408576698