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

Issue 702843004: Transfer serviceworker state during cross site navigations too. (Closed)

Created:
6 years, 1 month ago by michaeln
Modified:
6 years ago
CC:
chromium-reviews, jsbell+serviceworker_chromium.org, tzik, serviceworker-reviews, jam, nhiroki, darin-cc_chromium.org, horo+watch_chromium.org, kinuko+serviceworker, erikwright+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Transfer serviceworker state during cross site navigations too. The ServiceWorkerProviderHost is an object that persist across the lifetime of a document. It's created prior to the document and prior to the initiation of the resource load for the documents main resource. Today, when a cross-site xfer occurs the host is deleted and a new host is created that knows nothing of whats going on... so not surprisingly things are broken. The change is to retain the original ServiceworkerProviderHost and transfer ownership of it to the process in which the document finally lands. BUG=438005 Committed: https://crrev.com/bfea6ecef56cba8beb9816e8e9674a9dc456b20e Cr-Commit-Position: refs/heads/master@{#307579}

Patch Set 1 #

Total comments: 6

Patch Set 2 : #

Total comments: 1

Patch Set 3 : #

Total comments: 1

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Patch Set 7 : #

Total comments: 16

Patch Set 8 : #

Total comments: 2

Patch Set 9 : #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+324 lines, -37 lines) Patch
M base/id_map.h View 1 2 3 4 5 6 7 8 3 chunks +23 lines, -3 lines 0 comments Download
M base/id_map_unittest.cc View 1 2 3 4 5 6 7 1 chunk +3 lines, -0 lines 0 comments Download
M content/browser/appcache/appcache_interceptor.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M content/browser/appcache/appcache_interceptor.cc View 1 2 3 1 chunk +9 lines, -0 lines 0 comments Download
M content/browser/appcache/appcache_request_handler.h View 1 2 3 2 chunks +3 lines, -0 lines 0 comments Download
M content/browser/appcache/appcache_request_handler.cc View 1 2 3 3 chunks +14 lines, -1 line 0 comments Download
M content/browser/loader/cross_site_resource_handler.cc View 1 2 3 4 5 6 7 1 chunk +0 lines, -3 lines 0 comments Download
M content/browser/loader/resource_dispatcher_host_impl.cc View 1 2 3 4 2 chunks +8 lines, -1 line 0 comments Download
M content/browser/loader/resource_loader.cc View 1 2 3 4 2 chunks +19 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_browsertest.cc View 1 2 3 4 2 chunks +28 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_context_core.h View 1 chunk +9 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_context_core.cc View 1 2 3 4 5 6 7 1 chunk +33 lines, -0 lines 1 comment Download
M content/browser/service_worker/service_worker_provider_host.h View 1 2 3 4 5 6 4 chunks +17 lines, -3 lines 0 comments Download
M content/browser/service_worker/service_worker_provider_host.cc View 1 2 3 4 5 6 7 5 chunks +68 lines, -21 lines 0 comments Download
M content/browser/service_worker/service_worker_request_handler.h View 1 2 3 2 chunks +11 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_request_handler.cc View 1 2 3 2 chunks +36 lines, -1 line 0 comments Download
A + content/test/data/service_worker/cross_site_xfer.html View 1 2 3 4 5 6 7 2 chunks +5 lines, -5 lines 0 comments Download
A content/test/data/service_worker/cross_site_xfer.js View 1 2 3 4 5 6 7 1 chunk +15 lines, -0 lines 0 comments Download
A + content/test/data/service_worker/cross_site_xfer.js.mock-http-headers View 1 2 3 4 0 chunks +-1 lines, --1 lines 0 comments Download
A content/test/data/service_worker/cross_site_xfer_confirm.html View 1 2 3 4 5 6 7 1 chunk +21 lines, -0 lines 0 comments Download

Messages

Total messages: 30 (4 generated)
michaeln
i need to do testing yet, but here's the change
6 years, 1 month ago (2014-11-11 01:58:18 UTC) #2
michaeln
and here's some history about why a change like this is needed https://code.google.com/p/chromium/issues/detail?id=331270
6 years, 1 month ago (2014-11-11 02:01:16 UTC) #3
falken
Code looks good though I'm not totally sure I understand the bug being fixed (even ...
6 years, 1 month ago (2014-11-11 08:38:57 UTC) #4
michaeln
> Currently, if there's a redirect, Service Worker just doesn't work? What state > does ...
6 years, 1 month ago (2014-11-11 21:14:10 UTC) #5
michaeln
> I have to do some more testing to look more closely at what state ...
6 years, 1 month ago (2014-11-13 00:03:55 UTC) #6
michaeln
no new upload yet, but done locally https://codereview.chromium.org/702843004/diff/1/content/browser/service_worker/service_worker_context_core.cc File content/browser/service_worker/service_worker_context_core.cc (right): https://codereview.chromium.org/702843004/diff/1/content/browser/service_worker/service_worker_context_core.cc#newcode410 content/browser/service_worker/service_worker_context_core.cc:410: return scoped_ptr<ServiceWorkerProviderHost>(); ...
6 years, 1 month ago (2014-11-13 00:05:08 UTC) #7
michaeln
https://codereview.chromium.org/702843004/diff/20001/content/browser/cross_site_transfer_browsertest.cc File content/browser/cross_site_transfer_browsertest.cc (right): https://codereview.chromium.org/702843004/diff/20001/content/browser/cross_site_transfer_browsertest.cc#newcode463 content/browser/cross_site_transfer_browsertest.cc:463: // TODO: write me I think i have two ...
6 years, 1 month ago (2014-11-13 01:51:22 UTC) #8
michaeln
new upload, but missing tests
6 years, 1 month ago (2014-11-13 01:53:25 UTC) #9
falken
On 2014/11/13 01:53:25, michaeln wrote: > new upload, but missing tests Thanks for the updates. ...
6 years, 1 month ago (2014-11-14 04:15:26 UTC) #10
michaeln1
> To help me understand, when does this cross-site navigation as opposed to a > ...
6 years, 1 month ago (2014-11-14 20:46:03 UTC) #11
falken
On 2014/11/14 20:46:03, michaeln1 wrote: > > To help me understand, when does this cross-site ...
6 years, 1 month ago (2014-11-17 03:19:00 UTC) #12
falken
Sorry if you were blocked on feedback. The code looks good to me, just needs ...
6 years ago (2014-11-27 05:00:13 UTC) #13
michaeln
On 2014/11/27 05:00:13, falken wrote: > Sorry if you were blocked on feedback. The code ...
6 years ago (2014-12-03 00:44:27 UTC) #14
michaeln
Ok, added a browser tests for this now. @mmenke, can you take a look at ...
6 years ago (2014-12-05 01:55:14 UTC) #15
mmenke
On 2014/12/05 01:55:14, michaeln wrote: > Ok, added a browser tests for this now. > ...
6 years ago (2014-12-05 15:17:10 UTC) #17
michaeln
ping: falken ptal > Note that I didn't get an email with your review request, ...
6 years ago (2014-12-05 20:42:28 UTC) #18
michaeln
@rvargas, ptal at the new Replace() method on IDMap
6 years ago (2014-12-05 23:48:18 UTC) #20
rvargas (doing something else)
base lgtm https://codereview.chromium.org/702843004/diff/120001/base/id_map.h File base/id_map.h (right): https://codereview.chromium.org/702843004/diff/120001/base/id_map.h#newcode100 base/id_map.h:100: // nullptr is returned. The OwnershipSemantics of ...
6 years ago (2014-12-06 00:37:03 UTC) #21
falken
i think this looks good, just have one question https://codereview.chromium.org/702843004/diff/120001/content/browser/loader/cross_site_resource_handler.cc File content/browser/loader/cross_site_resource_handler.cc (right): https://codereview.chromium.org/702843004/diff/120001/content/browser/loader/cross_site_resource_handler.cc#newcode18 content/browser/loader/cross_site_resource_handler.cc:18: ...
6 years ago (2014-12-08 07:32:16 UTC) #22
michaeln
https://codereview.chromium.org/702843004/diff/120001/base/id_map.h File base/id_map.h (right): https://codereview.chromium.org/702843004/diff/120001/base/id_map.h#newcode100 base/id_map.h:100: // nullptr is returned. The OwnershipSemantics of the map ...
6 years ago (2014-12-08 23:56:44 UTC) #23
falken
LGTM https://codereview.chromium.org/702843004/diff/140001/base/id_map.h File base/id_map.h (right): https://codereview.chromium.org/702843004/diff/140001/base/id_map.h#newcode56 base/id_map.h:56: // Sets whether Add and Replace should CHECK ...
6 years ago (2014-12-09 01:19:32 UTC) #24
michaeln
https://codereview.chromium.org/702843004/diff/140001/base/id_map.h File base/id_map.h (right): https://codereview.chromium.org/702843004/diff/140001/base/id_map.h#newcode56 base/id_map.h:56: // Sets whether Add and Replace should CHECK if ...
6 years ago (2014-12-09 02:26:42 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/702843004/160001
6 years ago (2014-12-09 21:12:42 UTC) #27
commit-bot: I haz the power
Committed patchset #9 (id:160001)
6 years ago (2014-12-09 23:16:21 UTC) #28
commit-bot: I haz the power
Patchset 9 (id:??) landed as https://crrev.com/bfea6ecef56cba8beb9816e8e9674a9dc456b20e Cr-Commit-Position: refs/heads/master@{#307579}
6 years ago (2014-12-09 23:17:31 UTC) #29
michaeln
6 years ago (2014-12-10 00:39:27 UTC) #30
Message was sent while issue was closed.
https://codereview.chromium.org/702843004/diff/160001/content/browser/service...
File content/browser/service_worker/service_worker_context_core.cc (right):

https://codereview.chromium.org/702843004/diff/160001/content/browser/service...
content/browser/service_worker/service_worker_context_core.cc:417:
transferee->dispatcher_host());
ooops, i see a bug here, dispatcher_host() will always be null here

uploading a small followup patch soon

Powered by Google App Engine
This is Rietveld 408576698