New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 712473 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit 22 days ago
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Logic for whether to consider DocumentAvailableInMainFrame is inside the Offliner

Project Member Reported by chili@chromium.org, Apr 18 2017

Issue description

This logic should really be inside the SnapshotController, as that's where we are deciding when to take a snapshot.
 

Comment 1 by chili@chromium.org, Apr 19 2017

Cc: carlosk@chromium.org romax@chromium.org fgor...@chromium.org
A little more context:

PrerenderingOffliner currently has a constant for whether to consider DocumentAvailableInMainFrame as a signal for snapshotting. This is always set to false because anecdotal evidence suggest that this signal comes too soon.

RecentTabHelper *does* pass the DocumentAvailableInMainFrame signal along. Speaking with carlosk@, this could be because we are limited by user's patience in last_n and want to make sure we get *a* snapshot.

BackgroundOffliner *should* have a similar constant, but was lost in the transition from a 2-second timer to snapshot controller. I wrongly assumed that the decision of whether to use this signal or not was taken care of by the SnapshotController. In addition, since RecentTabHelper was used as a reference, we did not "sensor" this signal the way PrerenderingOffliner did.

There are (potentially) 2 issues here:
1. BackgroundOffliner is using DocumentAvailableInMainFrame + 25 seconds as a signal for snapshotting
2. SnapshotController is relying on an outside filter for signals. If its role is to determine when to snapshot, why can't it figure out what signals are needed itself?

Comment 2 by chili@chromium.org, Apr 27 2017

Additional context:
-- As part of this change, we are also removing the +25 seconds after DocumentAvailableInMainFrame from the BackgroundOffliner and PrerenderingOffliner. This is because neither was caring about DocumentAvailableInMainFrame signal anyway, so the +25 seconds is essentially void
Project Member

Comment 3 by bugdroid1@chromium.org, May 2 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5e17a9358f03488e71cba7c4b6786afba95fed6e

commit 5e17a9358f03488e71cba7c4b6786afba95fed6e
Author: chili <chili@chromium.org>
Date: Tue May 02 20:48:54 2017

[Offline pages]: Move logic for whether to consider the DocumentAvailableInMainFrame signal to the snapshot controller

Changes include:
-- moving all timing parameters (how long to wait before snapshotting) to the snapshot controller
-- introducing 2 new factory methods for obtaining a snapshot controller
-- more explicit ownership and transfer of the snapshot controller

BUG= 712473 

Review-Url: https://codereview.chromium.org/2822023002
Cr-Commit-Position: refs/heads/master@{#468765}

[modify] https://crrev.com/5e17a9358f03488e71cba7c4b6786afba95fed6e/chrome/browser/android/offline_pages/background_loader_offliner.cc
[modify] https://crrev.com/5e17a9358f03488e71cba7c4b6786afba95fed6e/chrome/browser/android/offline_pages/background_loader_offliner.h
[modify] https://crrev.com/5e17a9358f03488e71cba7c4b6786afba95fed6e/chrome/browser/android/offline_pages/background_loader_offliner_unittest.cc
[modify] https://crrev.com/5e17a9358f03488e71cba7c4b6786afba95fed6e/chrome/browser/android/offline_pages/prerendering_loader.cc
[modify] https://crrev.com/5e17a9358f03488e71cba7c4b6786afba95fed6e/chrome/browser/android/offline_pages/recent_tab_helper.cc
[modify] https://crrev.com/5e17a9358f03488e71cba7c4b6786afba95fed6e/components/offline_pages/core/snapshot_controller.cc
[modify] https://crrev.com/5e17a9358f03488e71cba7c4b6786afba95fed6e/components/offline_pages/core/snapshot_controller.h
[modify] https://crrev.com/5e17a9358f03488e71cba7c4b6786afba95fed6e/components/offline_pages/core/snapshot_controller_unittest.cc

Comment 4 by chili@chromium.org, May 3 2017

Labels: Merge-Request-59
Status: Fixed (was: Assigned)

Comment 5 by chili@chromium.org, May 3 2017

Labels: OS-Android
Project Member

Comment 6 by sheriffbot@chromium.org, May 3 2017

Labels: -Merge-Request-59 Hotlist-Merge-Approved Merge-Approved-59
Your change meets the bar and is auto-approved for M59. Please go ahead and merge the CL to branch 3071 manually. Please contact milestone owner if you have questions.
Owners: amineer@(Android), cmasso@(iOS), gkihumba@(ChromeOS), Abdul Syed@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 7 by bugdroid1@chromium.org, May 3 2017

Labels: -merge-approved-59 merge-merged-3071
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b7ff7afba5f6d89f8a9b29dd12c4a7d5d15fa655

commit b7ff7afba5f6d89f8a9b29dd12c4a7d5d15fa655
Author: Justin DeWitt <dewittj@chromium.org>
Date: Wed May 03 20:42:10 2017

[Offline pages]: Move logic for whether to consider the DocumentAvailableInMainFrame signal to the snapshot controller

Changes include:
-- moving all timing parameters (how long to wait before snapshotting) to the snapshot controller
-- introducing 2 new factory methods for obtaining a snapshot controller
-- more explicit ownership and transfer of the snapshot controller

BUG= 712473 

Review-Url: https://codereview.chromium.org/2822023002
Cr-Commit-Position: refs/heads/master@{#468765}
(cherry picked from commit 5e17a9358f03488e71cba7c4b6786afba95fed6e)

Review-Url: https://codereview.chromium.org/2861583007 .
Cr-Commit-Position: refs/branch-heads/3071@{#382}
Cr-Branched-From: a106f0abbf69dad349d4aaf4bcc4f5d376dd2377-refs/heads/master@{#464641}

[modify] https://crrev.com/b7ff7afba5f6d89f8a9b29dd12c4a7d5d15fa655/chrome/browser/android/offline_pages/background_loader_offliner.cc
[modify] https://crrev.com/b7ff7afba5f6d89f8a9b29dd12c4a7d5d15fa655/chrome/browser/android/offline_pages/background_loader_offliner.h
[modify] https://crrev.com/b7ff7afba5f6d89f8a9b29dd12c4a7d5d15fa655/chrome/browser/android/offline_pages/background_loader_offliner_unittest.cc
[modify] https://crrev.com/b7ff7afba5f6d89f8a9b29dd12c4a7d5d15fa655/chrome/browser/android/offline_pages/prerendering_loader.cc
[modify] https://crrev.com/b7ff7afba5f6d89f8a9b29dd12c4a7d5d15fa655/chrome/browser/android/offline_pages/recent_tab_helper.cc
[modify] https://crrev.com/b7ff7afba5f6d89f8a9b29dd12c4a7d5d15fa655/components/offline_pages/core/snapshot_controller.cc
[modify] https://crrev.com/b7ff7afba5f6d89f8a9b29dd12c4a7d5d15fa655/components/offline_pages/core/snapshot_controller.h
[modify] https://crrev.com/b7ff7afba5f6d89f8a9b29dd12c4a7d5d15fa655/components/offline_pages/core/snapshot_controller_unittest.cc

Sign in to add a comment