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

Issue 2942513002: Allow banners to trigger on sites which don't register a service worker onload. (Closed)

Created:
3 years, 6 months ago by dominickn
Modified:
3 years, 6 months ago
Reviewers:
pkotwicz, benwells
CC:
chromium-reviews, dominickn+watch_chromium.org, pkotwicz+watch_chromium.org, zpeng+watch_chromium.org, asvitkine+watch_chromium.org, agrieve+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Allow banners to trigger on sites which don't register a service worker onload. This CL makes the InstallableManager a ServiceWorkerContextObserver, which allows it to fall back to waiting for a service worker registration event in the case where a site has not loaded its service worker when the banner check is triggered. All clients of the InstallableManager will inherit the waiting behaviour, unless they explicitly opt out via the InstallableParams passed to InstallableManager::GetData. In particular, adding WebAPKs from the add to homescreen menu item will also use the wait-for-worker behaviour. A key difference is that InstallableManager::GetData may now wait forever (or until the page is navigated) without calling the specified callback in the case where a site never registers a service worker. New browser tests for the InstallableManager are added to ensure correctness. BUG=721881 Review-Url: https://codereview.chromium.org/2942513002 Cr-Commit-Position: refs/heads/master@{#480751} Committed: https://chromium.googlesource.com/chromium/src/+/14132ac523af4ee5ee38bd5ae0166d151015a786

Patch Set 1 #

Patch Set 2 : Rebase dependency #

Patch Set 3 : Fix DCHECK failure #

Patch Set 4 : Fix unit tests #

Patch Set 5 : Fix browser_tests on ChromeOS #

Patch Set 6 : Fix windows compile #

Total comments: 14

Patch Set 7 : Rebase #

Patch Set 8 : Fix crashing Android test. Comments #

Total comments: 2

Patch Set 9 : Less flaky test #

Total comments: 4

Patch Set 10 : Don't cache NO_MATCHING_SERVICE_WORKER #

Unified diffs Side-by-side diffs Delta from patch set Stats (+433 lines, -94 lines) Patch
M chrome/browser/banners/app_banner_manager.h View 1 2 3 4 5 6 7 4 chunks +23 lines, -5 lines 0 comments Download
M chrome/browser/banners/app_banner_manager.cc View 1 2 3 4 5 6 7 9 chunks +41 lines, -14 lines 0 comments Download
M chrome/browser/installable/installable_logging.h View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/installable/installable_logging.cc View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/installable/installable_manager.h View 1 2 3 4 5 6 7 8 9 9 chunks +46 lines, -15 lines 0 comments Download
M chrome/browser/installable/installable_manager.cc View 1 2 3 4 5 6 7 8 9 16 chunks +111 lines, -51 lines 0 comments Download
M chrome/browser/installable/installable_manager_browsertest.cc View 1 2 3 4 5 6 7 8 9 9 chunks +202 lines, -6 lines 0 comments Download
M chrome/browser/installable/installable_manager_unittest.cc View 1 2 3 2 chunks +4 lines, -3 lines 0 comments Download
M tools/metrics/histograms/enums.xml View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 71 (48 generated)
dominickn
isherman: PTAL at enums.xml benwells: PTAL at everything else Thanks!
3 years, 6 months ago (2017-06-14 05:54:24 UTC) #19
benwells
https://codereview.chromium.org/2942513002/diff/100001/chrome/browser/banners/app_banner_manager.cc File chrome/browser/banners/app_banner_manager.cc (right): https://codereview.chromium.org/2942513002/diff/100001/chrome/browser/banners/app_banner_manager.cc#newcode197 chrome/browser/banners/app_banner_manager.cc:197: return is_debug_mode_ || Nit: This is a bit confusing ...
3 years, 6 months ago (2017-06-14 11:39:06 UTC) #29
pkotwicz
https://codereview.chromium.org/2942513002/diff/100001/chrome/browser/installable/installable_manager.h File chrome/browser/installable/installable_manager.h (right): https://codereview.chromium.org/2942513002/diff/100001/chrome/browser/installable/installable_manager.h#newcode54 chrome/browser/installable/installable_manager.h:54: bool wait_for_worker = true; Drive by: This should be ...
3 years, 6 months ago (2017-06-14 15:34:36 UTC) #31
Ilya Sherman
On 2017/06/14 05:54:24, dominickn wrote: > isherman: PTAL at enums.xml > > benwells: PTAL at ...
3 years, 6 months ago (2017-06-15 03:19:13 UTC) #32
dominickn
https://codereview.chromium.org/2942513002/diff/100001/chrome/browser/banners/app_banner_manager.cc File chrome/browser/banners/app_banner_manager.cc (right): https://codereview.chromium.org/2942513002/diff/100001/chrome/browser/banners/app_banner_manager.cc#newcode197 chrome/browser/banners/app_banner_manager.cc:197: return is_debug_mode_ || On 2017/06/14 11:39:06, benwells wrote: > ...
3 years, 6 months ago (2017-06-15 04:16:07 UTC) #37
benwells
Just one little question... https://codereview.chromium.org/2942513002/diff/140001/chrome/browser/installable/installable_manager_browsertest.cc File chrome/browser/installable/installable_manager_browsertest.cc (right): https://codereview.chromium.org/2942513002/diff/140001/chrome/browser/installable/installable_manager_browsertest.cc#newcode691 chrome/browser/installable/installable_manager_browsertest.cc:691: "/banners/lazy_service_worker_test_page.html?swdelay=500"); Is the 500 important ...
3 years, 6 months ago (2017-06-15 04:42:44 UTC) #40
dominickn
https://codereview.chromium.org/2942513002/diff/140001/chrome/browser/installable/installable_manager_browsertest.cc File chrome/browser/installable/installable_manager_browsertest.cc (right): https://codereview.chromium.org/2942513002/diff/140001/chrome/browser/installable/installable_manager_browsertest.cc#newcode691 chrome/browser/installable/installable_manager_browsertest.cc:691: "/banners/lazy_service_worker_test_page.html?swdelay=500"); On 2017/06/15 04:42:43, benwells wrote: > Is the ...
3 years, 6 months ago (2017-06-15 04:50:12 UTC) #41
benwells
On 2017/06/15 04:50:12, dominickn wrote: > https://codereview.chromium.org/2942513002/diff/140001/chrome/browser/installable/installable_manager_browsertest.cc > File chrome/browser/installable/installable_manager_browsertest.cc (right): > > https://codereview.chromium.org/2942513002/diff/140001/chrome/browser/installable/installable_manager_browsertest.cc#newcode691 > ...
3 years, 6 months ago (2017-06-15 05:41:50 UTC) #42
benwells
On 2017/06/15 05:41:50, benwells wrote: > On 2017/06/15 04:50:12, dominickn wrote: > > > https://codereview.chromium.org/2942513002/diff/140001/chrome/browser/installable/installable_manager_browsertest.cc ...
3 years, 6 months ago (2017-06-15 05:47:42 UTC) #43
dominickn
On 2017/06/15 05:47:42, benwells wrote: > On 2017/06/15 05:41:50, benwells wrote: > > On 2017/06/15 ...
3 years, 6 months ago (2017-06-15 05:58:16 UTC) #44
benwells
On 2017/06/15 05:58:16, dominickn wrote: > On 2017/06/15 05:47:42, benwells wrote: > > On 2017/06/15 ...
3 years, 6 months ago (2017-06-15 06:00:20 UTC) #45
dominickn
Now with less flaky test.
3 years, 6 months ago (2017-06-15 07:11:16 UTC) #48
benwells
lgtm, thanks for updating the tests!
3 years, 6 months ago (2017-06-15 11:06:38 UTC) #53
pkotwicz
https://codereview.chromium.org/2942513002/diff/100001/chrome/browser/installable/installable_manager.h File chrome/browser/installable/installable_manager.h (right): https://codereview.chromium.org/2942513002/diff/100001/chrome/browser/installable/installable_manager.h#newcode54 chrome/browser/installable/installable_manager.h:54: bool wait_for_worker = true; 2. Doesn't your change cause ...
3 years, 6 months ago (2017-06-15 15:10:04 UTC) #54
dominickn
https://codereview.chromium.org/2942513002/diff/100001/chrome/browser/installable/installable_manager.h File chrome/browser/installable/installable_manager.h (right): https://codereview.chromium.org/2942513002/diff/100001/chrome/browser/installable/installable_manager.h#newcode54 chrome/browser/installable/installable_manager.h:54: bool wait_for_worker = true; On 2017/06/15 15:10:04, pkotwicz wrote: ...
3 years, 6 months ago (2017-06-15 23:45:38 UTC) #55
pkotwicz
https://codereview.chromium.org/2942513002/diff/100001/chrome/browser/installable/installable_manager.h File chrome/browser/installable/installable_manager.h (right): https://codereview.chromium.org/2942513002/diff/100001/chrome/browser/installable/installable_manager.h#newcode54 chrome/browser/installable/installable_manager.h:54: bool wait_for_worker = true; On 2017/06/15 23:45:38, dominickn wrote: ...
3 years, 6 months ago (2017-06-16 23:07:43 UTC) #56
dominickn
https://codereview.chromium.org/2942513002/diff/100001/chrome/browser/installable/installable_manager.h File chrome/browser/installable/installable_manager.h (right): https://codereview.chromium.org/2942513002/diff/100001/chrome/browser/installable/installable_manager.h#newcode54 chrome/browser/installable/installable_manager.h:54: bool wait_for_worker = true; On 2017/06/16 23:07:43, pkotwicz wrote: ...
3 years, 6 months ago (2017-06-17 00:00:27 UTC) #57
dominickn
pkotwicz: unless you have any other concerns here, I'll land this tomorrow.
3 years, 6 months ago (2017-06-19 10:03:07 UTC) #58
pkotwicz
https://codereview.chromium.org/2942513002/diff/100001/chrome/browser/installable/installable_manager.h File chrome/browser/installable/installable_manager.h (right): https://codereview.chromium.org/2942513002/diff/100001/chrome/browser/installable/installable_manager.h#newcode54 chrome/browser/installable/installable_manager.h:54: bool wait_for_worker = true; We need to decide whether ...
3 years, 6 months ago (2017-06-19 18:46:51 UTC) #59
dominickn
Thanks! https://codereview.chromium.org/2942513002/diff/100001/chrome/browser/installable/installable_manager.h File chrome/browser/installable/installable_manager.h (right): https://codereview.chromium.org/2942513002/diff/100001/chrome/browser/installable/installable_manager.h#newcode54 chrome/browser/installable/installable_manager.h:54: bool wait_for_worker = true; On 2017/06/19 18:46:50, pkotwicz ...
3 years, 6 months ago (2017-06-20 02:26:24 UTC) #62
pkotwicz
LGTM. Thank you for addressing my concerns :)
3 years, 6 months ago (2017-06-20 06:03:36 UTC) #65
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/2942513002/180001
3 years, 6 months ago (2017-06-20 06:05:53 UTC) #68
commit-bot: I haz the power
3 years, 6 months ago (2017-06-20 06:10:49 UTC) #71
Message was sent while issue was closed.
Committed patchset #10 (id:180001) as
https://chromium.googlesource.com/chromium/src/+/14132ac523af4ee5ee38bd5ae016...

Powered by Google App Engine
This is Rietveld 408576698