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

Issue 622508 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Feature



Sign in to add a comment

Allow Prerendering for ORIGIN_OFFLINE request on low end devices

Project Member Reported by dougarnett@chromium.org, Jun 22 2016

Issue description

We want to be able to develop and evaluate background offlining support on low end (svelte) devices since they are common in the EM countries.

Currently, PrerenderManagerFactory::BuildServiceInstanceFor(...) returns null if base::SysInfo::IsLowEndDevice() so it is not possible to try prerendering. 

Possibly this condition might be modified with a developer flag for now to go ahead and create the PrerenderManager instance if it is set (to avoid this instance creation for production clients) or perhaps some other way to trigger instance creation when the Offline feature gets used.

I don't know if there are other places in the prerender stack that need modification (certainly could be some other policy considerations) but I was able to successfully offline a page on a svelte device in a dev build in which I disable the IsLowEndDevice check in the factory.
 

Comment 1 by pasko@chromium.org, Jun 23 2016

Status: Assigned (was: Untriaged)
I believe this should be easy

Comment 2 by pasko@chromium.org, Jun 27 2016

One question: what is the bigger story? Can we rely on upper layers to behave "properly", like always killing prerender when we go to foreground or off the battery? What is our definition of proper behavior?
Summary: Allow Prerendering for ORIGIN_OFFLINE request on low end devices - via Development flag (was: Allow Prerendering for ORIGIN_OFFLINE request on low end devices)
Yes, we do want the upper layer to be responsible for foreground detection, battery level, and some other feature policy concerns too (user-requested, network type allowed). Probably makes sense for me to write a 1-2 pager on this. 

We might want to constrain the scope of this Issue to be developer flag support and then later enable broadly via different Issue once we have landed and evaluated the upper level policy support. I'm appending to this Issue's Summary.

Comment 4 by pasko@chromium.org, Jun 27 2016

> Probably makes sense for me to write a 1-2 pager on this.

This would certainly help. Perhaps we can also figure out upfront how we are going to test it. This would make it easier to agree on review with mmenke@, I think. If you start a paragraph about testing with a braindump of what you know, I can add my braindump for the Android land (even though I am not a huge expert on android-side testing).

> We might want to constrain the scope of this Issue to be developer flag

Do you mean a commandline flag? I think it only can be worth extra complexity if you want to launch the non-svelte version first, which I thought is not what you want? ..
True - makes sense to focus on svelte use case first and extra flag not necessary.

Comment 8 by pasko@chromium.org, Jul 29 2016

Status: Started (was: Assigned)

Comment 9 by pasko@chromium.org, Aug 1 2016

Summary: Allow Prerendering for ORIGIN_OFFLINE request on low end devices (was: Allow Prerendering for ORIGIN_OFFLINE request on low end devices - via Development flag)
Project Member

Comment 10 by bugdroid1@chromium.org, Aug 3 2016

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

commit 63b429af6ac2e1a0835e30ddd962fc4ebad2cd1b
Author: pasko <pasko@chromium.org>
Date: Wed Aug 03 16:27:27 2016

Prerender: Allow on low end devices for ORIGIN_OFFLINE

TL;DR: Prerendering cannot keep track of all child processes, and only allows
prerendering when asked by the offliner.

Low end devices require (best effort at) keeping no more than one renderer
process at any time. Prerendering has been disabled on low end devices because
of this.

Offliner should be able to create prerenders, and it needs to ensure that
these prerenders are:
* not created when another renderer is alive
* killed when Chrome another renderer is created

We identified additional cases when to prevent offlining, among which:
* Chrome is in foreground (even though may not have a renderer)
* Battery level is low

Since the foreground checks should be in place anyway, we decided that while
Chrome is in background having two background renderers is OK, and we can rely
on one (or both) of them being killed by the system.  For simplicity the
offliner does not actually watch for renderers specifically, only:
* Prevents offlining when any Chrome activity is visible
* Kills its prerenders when a transition to foreground happens

BUG= 622508 

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

[modify] https://crrev.com/63b429af6ac2e1a0835e30ddd962fc4ebad2cd1b/chrome/browser/prerender/prerender_manager.cc
[modify] https://crrev.com/63b429af6ac2e1a0835e30ddd962fc4ebad2cd1b/chrome/browser/prerender/prerender_manager.h
[modify] https://crrev.com/63b429af6ac2e1a0835e30ddd962fc4ebad2cd1b/chrome/browser/prerender/prerender_manager_factory.cc
[modify] https://crrev.com/63b429af6ac2e1a0835e30ddd962fc4ebad2cd1b/chrome/browser/prerender/prerender_unittest.cc

Status: Fixed (was: Started)

Sign in to add a comment