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

Issue 722583002: ServiceWorker: Abort register() and getRegistration() on non-http(s) page (Closed)

Created:
6 years, 1 month ago by nhiroki
Modified:
6 years, 1 month ago
Reviewers:
falken
CC:
blink-reviews, michaeln, jsbell+serviceworker_chromium.org, tzik, serviceworker-reviews, kinuko+serviceworker, horo+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/blink.git@fix_get_registration
Project:
blink
Visibility:
Public.

Description

ServiceWorker: Abort register() and getRegistration() on non-http(s) page Currently the ServiceWorker backend does not support register() and getRegistration() calls on non-HTTP(s) page (eg, "file://"). Such calls trigger a renderer crash because SWProviderHost does not have a valid document URL and treats a request as a bad message. This patch makes SWContainer abort such calls before sending an IPC message. BUG=432048 TEST=run-webkit-tests fast/serviceworker/access-container-on-local-file.html Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=185210

Patch Set 1 #

Total comments: 8

Patch Set 2 : fix for review comments #

Patch Set 3 : fix wrong comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+59 lines, -0 lines) Patch
A LayoutTests/fast/serviceworker/access-container-on-local-file.html View 1 2 1 chunk +47 lines, -0 lines 0 comments Download
M Source/modules/serviceworkers/ServiceWorkerContainer.cpp View 1 2 chunks +12 lines, -0 lines 0 comments Download

Messages

Total messages: 11 (2 generated)
nhiroki
Hi falken@, can you review this? Thanks!
6 years, 1 month ago (2014-11-12 08:48:01 UTC) #2
falken
I'm not sure the test is testing the new codepath? In fact I'm not sure ...
6 years, 1 month ago (2014-11-12 09:04:41 UTC) #3
falken
On 2014/11/12 09:04:41, falken wrote: > I'm not sure the test is testing the new ...
6 years, 1 month ago (2014-11-12 09:05:21 UTC) #4
falken
LGTM https://codereview.chromium.org/722583002/diff/1/LayoutTests/fast/serviceworker/access-container-on-local-file.html File LayoutTests/fast/serviceworker/access-container-on-local-file.html (right): https://codereview.chromium.org/722583002/diff/1/LayoutTests/fast/serviceworker/access-container-on-local-file.html#newcode7 LayoutTests/fast/serviceworker/access-container-on-local-file.html:7: var script = 'no-such-worker'; On 2014/11/12 09:04:41, falken ...
6 years, 1 month ago (2014-11-12 09:07:03 UTC) #5
nhiroki
Thank you for reviewing! https://codereview.chromium.org/722583002/diff/1/LayoutTests/fast/serviceworker/access-container-on-local-file.html File LayoutTests/fast/serviceworker/access-container-on-local-file.html (right): https://codereview.chromium.org/722583002/diff/1/LayoutTests/fast/serviceworker/access-container-on-local-file.html#newcode10 LayoutTests/fast/serviceworker/access-container-on-local-file.html:10: assert_unreached('A returned promise should be ...
6 years, 1 month ago (2014-11-12 09:42:09 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/722583002/40001
6 years, 1 month ago (2014-11-12 14:06:15 UTC) #8
commit-bot: I haz the power
Committed patchset #3 (id:40001) as 185210
6 years, 1 month ago (2014-11-12 15:06:24 UTC) #9
falken
https://codereview.chromium.org/722583002/diff/1/LayoutTests/fast/serviceworker/access-container-on-local-file.html File LayoutTests/fast/serviceworker/access-container-on-local-file.html (right): https://codereview.chromium.org/722583002/diff/1/LayoutTests/fast/serviceworker/access-container-on-local-file.html#newcode11 LayoutTests/fast/serviceworker/access-container-on-local-file.html:11: }, function(e) { On 2014/11/12 09:42:09, nhiroki wrote: > ...
6 years, 1 month ago (2014-11-13 08:27:55 UTC) #10
nhiroki
6 years, 1 month ago (2014-11-13 08:36:49 UTC) #11
Message was sent while issue was closed.
On 2014/11/13 08:27:55, falken wrote:
>
https://codereview.chromium.org/722583002/diff/1/LayoutTests/fast/servicework...
> File LayoutTests/fast/serviceworker/access-container-on-local-file.html
(right):
> 
>
https://codereview.chromium.org/722583002/diff/1/LayoutTests/fast/servicework...
> LayoutTests/fast/serviceworker/access-container-on-local-file.html:11: },
> function(e) {
> On 2014/11/12 09:42:09, nhiroki wrote:
> > On 2014/11/12 09:07:03, falken wrote:
> > > On 2014/11/12 09:04:41, falken wrote:
> > > > Maybe we should assert on the error message contents, to be sure this
test
> > is
> > > > testing what it's intending to test?
> > > 
> > > I still think this may be a good idea, WDYT?
> > 
> > +1! Added the check.
> 
> Ah, sorry. I just realized this was bad advice since other browsers won't use
> the same error message.

Ah, good point. I'll make a patch to remove those checks.

Powered by Google App Engine
This is Rietveld 408576698