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 2963473003: Don't block InstallableManager::GetData calls when waiting for a service worker. (Closed)

Created:
3 years, 5 months ago by dominickn
Modified:
3 years, 5 months ago
Reviewers:
benwells
CC:
chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Don't block InstallableManager::GetData calls when waiting for a service worker. If the InstallableManager is processing a task that is waiting for the site to register a service worker, all new tasks will block until the first task is complete. If the site never registers a service worker, all new calls to InstallableManager will never succeed, even if they are not requesting a service worker check. This is particularly important if installability checking on page load is enabled. Trying to add a non-PWA with a manifest and icon to homescreen will not use the manifest icon or details since the onload check is hanging waiting for a service worker. This CL addresses the bug by introducing a paused task queue to hold waiting tasks. Existing tests are amended to explicitly check the paused case. BUG=737013 Review-Url: https://codereview.chromium.org/2963473003 Cr-Commit-Position: refs/heads/master@{#482564} Committed: https://chromium.googlesource.com/chromium/src/+/ee088c9f11822f91a180217765a1f71261e24038

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+62 lines, -30 lines) Patch
M chrome/browser/installable/installable_manager.h View 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/installable/installable_manager.cc View 5 chunks +21 lines, -14 lines 0 comments Download
M chrome/browser/installable/installable_manager_browsertest.cc View 5 chunks +38 lines, -15 lines 3 comments Download

Messages

Total messages: 18 (11 generated)
dominickn
PTAL, thanks!
3 years, 5 months ago (2017-06-27 05:23:06 UTC) #4
benwells
lgtm https://codereview.chromium.org/2963473003/diff/1/chrome/browser/installable/installable_manager_browsertest.cc File chrome/browser/installable/installable_manager_browsertest.cc (right): https://codereview.chromium.org/2963473003/diff/1/chrome/browser/installable/installable_manager_browsertest.cc#newcode721 chrome/browser/installable/installable_manager_browsertest.cc:721: sw_run_loop.Run(); Unrelated to this change - do you ...
3 years, 5 months ago (2017-06-27 07:20:59 UTC) #9
dominickn
https://codereview.chromium.org/2963473003/diff/1/chrome/browser/installable/installable_manager_browsertest.cc File chrome/browser/installable/installable_manager_browsertest.cc (right): https://codereview.chromium.org/2963473003/diff/1/chrome/browser/installable/installable_manager_browsertest.cc#newcode721 chrome/browser/installable/installable_manager_browsertest.cc:721: sw_run_loop.Run(); On 2017/06/27 07:20:59, benwells wrote: > Unrelated to ...
3 years, 5 months ago (2017-06-27 07:32:50 UTC) #10
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/2963473003/1
3 years, 5 months ago (2017-06-27 07:33:02 UTC) #12
commit-bot: I haz the power
Committed patchset #1 (id:1) as https://chromium.googlesource.com/chromium/src/+/ee088c9f11822f91a180217765a1f71261e24038
3 years, 5 months ago (2017-06-27 08:03:07 UTC) #16
benwells
https://codereview.chromium.org/2963473003/diff/1/chrome/browser/installable/installable_manager_browsertest.cc File chrome/browser/installable/installable_manager_browsertest.cc (right): https://codereview.chromium.org/2963473003/diff/1/chrome/browser/installable/installable_manager_browsertest.cc#newcode721 chrome/browser/installable/installable_manager_browsertest.cc:721: sw_run_loop.Run(); On 2017/06/27 07:32:49, dominickn wrote: > On 2017/06/27 ...
3 years, 5 months ago (2017-06-27 08:31:01 UTC) #17
dominickn
3 years, 5 months ago (2017-06-27 23:51:01 UTC) #18
Message was sent while issue was closed.
On 2017/06/27 08:31:01, benwells wrote:
>
https://codereview.chromium.org/2963473003/diff/1/chrome/browser/installable/...
> File chrome/browser/installable/installable_manager_browsertest.cc (right):
> 
>
https://codereview.chromium.org/2963473003/diff/1/chrome/browser/installable/...
> chrome/browser/installable/installable_manager_browsertest.cc:721:
> sw_run_loop.Run();
> On 2017/06/27 07:32:49, dominickn wrote:
> > On 2017/06/27 07:20:59, benwells wrote:
> > > Unrelated to this change - do you need so many run loops? Can you just
have
> > the
> > > one and reset it when required?
> > 
> > base::RunLoop has no reset method, and it can only be run once (and its
> > QuitClosure can only be dispatched once).
> 
> Right, the pattern I've seen is to have a unique_ptr<> and call reset on that
> with a new one after you've called Run and need to do it again.

oic. I'll keep that in mind for the future. :)

Powered by Google App Engine
This is Rietveld 408576698