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

Issue 375513002: [ServiceWorker] Propagates ServiceWorker fetched response's URL and wasFetchedViaServiceWorker flag. (Closed)

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

Description

[ServiceWorker] Propagates ServiceWorker fetched response's URL and wasFetchedViaServiceWorker flag. If the request was fetched via a ServiceWorker, the URL of the response could be different from the URL of the original request. The URL must be checked in the renderer process for CSP and CORS. So in this patch I introduce was_fetched_via_service_worker flag and original_url_via_service_worker which are set in ServiceWorkerURLRequestJob and propagated to the renderer process. This change depends on http://crrev.com/370733002 and http://crrev.com/378473002. BUG=373120 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=284627

Patch Set 1 : #

Total comments: 2

Patch Set 2 : responce -> response #

Patch Set 3 : #

Total comments: 14

Patch Set 4 : fix comment #

Total comments: 8

Patch Set 5 : incorporated tyoshino's comment #

Total comments: 4

Patch Set 6 : rebase #

Total comments: 6

Patch Set 7 : via -> by #

Patch Set 8 : via -> by #

Total comments: 1

Patch Set 9 : incorporated michaeln's comment #

Patch Set 10 : add const #

Total comments: 2

Patch Set 11 : *original_url_via_service_worker = GURL(); #

Unified diffs Side-by-side diffs Delta from patch set Stats (+95 lines, -6 lines) Patch
M content/browser/loader/resource_loader.cc View 1 2 3 4 5 6 7 8 2 chunks +7 lines, -0 lines 0 comments Download
M content/browser/service_worker/embedded_worker_test_helper.cc View 1 2 3 4 5 1 chunk +3 lines, -1 line 0 comments Download
M content/browser/service_worker/service_worker_context_request_handler.h View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_context_request_handler.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +7 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_controllee_request_handler.h View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_controllee_request_handler.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +12 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_request_handler.h View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_url_request_job.h View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_url_request_job.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +14 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_url_request_job_unittest.cc View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
M content/child/resource_dispatcher.cc View 1 2 3 4 5 6 7 1 chunk +7 lines, -0 lines 0 comments Download
M content/child/web_url_loader_impl.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +7 lines, -0 lines 0 comments Download
M content/common/resource_messages.h View 7 1 chunk +2 lines, -0 lines 0 comments Download
M content/common/service_worker/service_worker_messages.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M content/common/service_worker/service_worker_types.h View 1 2 3 4 5 1 chunk +3 lines, -1 line 0 comments Download
M content/common/service_worker/service_worker_types.cc View 1 2 3 4 5 1 chunk +3 lines, -1 line 0 comments Download
M content/public/common/resource_response_info.h View 1 2 3 4 5 6 7 1 chunk +7 lines, -0 lines 0 comments Download
M content/public/common/resource_response_info.cc View 7 1 chunk +2 lines, -1 line 0 comments Download
M content/renderer/service_worker/embedded_worker_context_client.cc View 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 38 (0 generated)
horo
The values are propagated in the following ways. --Browser process-- ServiceWorkerURLRequestJob::CommitResponseHeader() http_response_info_->was_fetched_via_service_worker = true; http_response_info_->original_url_via_service_worker ...
6 years, 5 months ago (2014-07-07 06:18:54 UTC) #1
horo
tyoshino@ Could you please review this patch?
6 years, 5 months ago (2014-07-07 06:32:55 UTC) #2
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/375513002/diff/40001/content/browser/service_worker/service_worker_url_request_job.h File content/browser/service_worker/service_worker_url_request_job.h (right): https://codereview.chromium.org/375513002/diff/40001/content/browser/service_worker/service_worker_url_request_job.h#newcode124 content/browser/service_worker/service_worker_url_request_job.h:124: GURL responce_url_; responce -> response
6 years, 5 months ago (2014-07-07 06:48:38 UTC) #3
horo
https://codereview.chromium.org/375513002/diff/40001/content/browser/service_worker/service_worker_url_request_job.h File content/browser/service_worker/service_worker_url_request_job.h (right): https://codereview.chromium.org/375513002/diff/40001/content/browser/service_worker/service_worker_url_request_job.h#newcode124 content/browser/service_worker/service_worker_url_request_job.h:124: GURL responce_url_; On 2014/07/07 06:48:37, tyoshino wrote: > responce ...
6 years, 5 months ago (2014-07-07 06:58:10 UTC) #4
dominicc (has gone to gerrit)
Nit: The description contains reqonse -> response
6 years, 5 months ago (2014-07-08 02:08:31 UTC) #5
horo
On 2014/07/08 02:08:31, dominicc wrote: > Nit: The description contains reqonse -> response done. thank ...
6 years, 5 months ago (2014-07-08 02:16:23 UTC) #6
tyoshino (SeeGerritForStatus)
sorry. i'll take time to review this in depth tomorrow. https://codereview.chromium.org/375513002/diff/80001/content/child/resource_dispatcher.cc File content/child/resource_dispatcher.cc (right): https://codereview.chromium.org/375513002/diff/80001/content/child/resource_dispatcher.cc#newcode361 ...
6 years, 5 months ago (2014-07-08 14:27:49 UTC) #7
horo
https://codereview.chromium.org/375513002/diff/80001/content/child/resource_dispatcher.cc File content/child/resource_dispatcher.cc (right): https://codereview.chromium.org/375513002/diff/80001/content/child/resource_dispatcher.cc#newcode361 content/child/resource_dispatcher.cc:361: // Updates the response_url if the response was feched ...
6 years, 5 months ago (2014-07-09 03:15:01 UTC) #8
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/375513002/diff/100001/net/http/http_response_info.cc File net/http/http_response_info.cc (right): https://codereview.chromium.org/375513002/diff/100001/net/http/http_response_info.cc#newcode162 net/http/http_response_info.cc:162: bool HttpResponseInfo::InitFromPickle(const Pickle& pickle, is it ok to skip ...
6 years, 5 months ago (2014-07-09 06:35:26 UTC) #9
tyoshino (SeeGerritForStatus)
almost LG https://codereview.chromium.org/375513002/diff/100001/content/child/resource_dispatcher.cc File content/child/resource_dispatcher.cc (right): https://codereview.chromium.org/375513002/diff/100001/content/child/resource_dispatcher.cc#newcode365 content/child/resource_dispatcher.cc:365: request_info->response_url = response_head.original_url_via_service_worker; please make sure that ...
6 years, 5 months ago (2014-07-09 07:09:01 UTC) #10
horo
https://codereview.chromium.org/375513002/diff/100001/net/http/http_response_info.cc File net/http/http_response_info.cc (right): https://codereview.chromium.org/375513002/diff/100001/net/http/http_response_info.cc#newcode162 net/http/http_response_info.cc:162: bool HttpResponseInfo::InitFromPickle(const Pickle& pickle, On 2014/07/09 06:35:25, tyoshino wrote: ...
6 years, 5 months ago (2014-07-09 11:14:03 UTC) #11
horo
mkwst@ Could you please review this?
6 years, 5 months ago (2014-07-09 11:17:39 UTC) #12
Mike West
Happy to take a look, but you'll need a content/ and net/ OWNER as well.
6 years, 5 months ago (2014-07-09 12:06:56 UTC) #13
Mike West
Thanks! A few comments/questions inline. https://codereview.chromium.org/375513002/diff/120001/content/browser/service_worker/service_worker_url_request_job.cc File content/browser/service_worker/service_worker_url_request_job.cc (right): https://codereview.chromium.org/375513002/diff/120001/content/browser/service_worker/service_worker_url_request_job.cc#newcode261 content/browser/service_worker/service_worker_url_request_job.cc:261: response_url_ = response.url; What's ...
6 years, 5 months ago (2014-07-09 12:14:46 UTC) #14
horo
Thank you for your review! https://codereview.chromium.org/375513002/diff/120001/content/browser/service_worker/service_worker_url_request_job.cc File content/browser/service_worker/service_worker_url_request_job.cc (right): https://codereview.chromium.org/375513002/diff/120001/content/browser/service_worker/service_worker_url_request_job.cc#newcode261 content/browser/service_worker/service_worker_url_request_job.cc:261: response_url_ = response.url; On ...
6 years, 5 months ago (2014-07-10 06:17:56 UTC) #15
horo
Thank you for your review! https://codereview.chromium.org/375513002/diff/120001/content/browser/service_worker/service_worker_url_request_job.cc File content/browser/service_worker/service_worker_url_request_job.cc (right): https://codereview.chromium.org/375513002/diff/120001/content/browser/service_worker/service_worker_url_request_job.cc#newcode261 content/browser/service_worker/service_worker_url_request_job.cc:261: response_url_ = response.url; On ...
6 years, 5 months ago (2014-07-10 06:17:57 UTC) #16
Mike West
On 2014/07/10 06:17:57, horo wrote: > Thank you for your review! > > https://codereview.chromium.org/375513002/diff/120001/content/browser/service_worker/service_worker_url_request_job.cc > ...
6 years, 5 months ago (2014-07-10 08:48:37 UTC) #17
horo
On 2014/07/10 08:48:37, Mike West wrote: > On 2014/07/10 06:17:57, horo wrote: > > Thank ...
6 years, 5 months ago (2014-07-11 07:27:42 UTC) #18
Mike West
Ok, it's entirely possible I've misunderstood what "original_url_via_service_worker" represents. Given the following scenario: 1. Website ...
6 years, 5 months ago (2014-07-11 07:55:42 UTC) #19
horo
> I think you're saying that the URL of the response in #4 would be ...
6 years, 5 months ago (2014-07-11 08:08:46 UTC) #20
Mike West
In that case, LGTM.
6 years, 5 months ago (2014-07-11 08:16:20 UTC) #21
Mike West
On 2014/07/11 at 08:16:20, Mike West wrote: > In that case, LGTM. (Though I'd perhaps ...
6 years, 5 months ago (2014-07-11 08:19:28 UTC) #22
horo
gavinp@ Could you please review this change? Thank you.
6 years, 5 months ago (2014-07-11 08:20:25 UTC) #23
tyoshino (SeeGerritForStatus)
lgtm https://codereview.chromium.org/375513002/diff/140001/content/public/common/resource_response_info.h File content/public/common/resource_response_info.h (right): https://codereview.chromium.org/375513002/diff/140001/content/public/common/resource_response_info.h#newcode104 content/public/common/resource_response_info.h:104: // The original URL of the response which ...
6 years, 5 months ago (2014-07-14 07:00:42 UTC) #24
horo
https://codereview.chromium.org/375513002/diff/140001/content/public/common/resource_response_info.h File content/public/common/resource_response_info.h (right): https://codereview.chromium.org/375513002/diff/140001/content/public/common/resource_response_info.h#newcode104 content/public/common/resource_response_info.h:104: // The original URL of the response which was ...
6 years, 5 months ago (2014-07-15 00:36:18 UTC) #25
michaeln
https://codereview.chromium.org/375513002/diff/180001/net/http/http_response_info.h File net/http/http_response_info.h (right): https://codereview.chromium.org/375513002/diff/180001/net/http/http_response_info.h#newcode101 net/http/http_response_info.h:101: GURL original_url_via_service_worker; These service_worker specific data members probably don't ...
6 years, 5 months ago (2014-07-15 23:16:38 UTC) #26
horo
On 2014/07/15 23:16:38, michaeln wrote: > https://codereview.chromium.org/375513002/diff/180001/net/http/http_response_info.h > File net/http/http_response_info.h (right): > > https://codereview.chromium.org/375513002/diff/180001/net/http/http_response_info.h#newcode101 > ...
6 years, 5 months ago (2014-07-16 02:24:39 UTC) #27
michaeln
lgtm > I added ServiceWorkerRequestHandler::GetExtraResponseInfo(). Thnx! I'll expect we'll want to add to this set ...
6 years, 5 months ago (2014-07-17 19:33:09 UTC) #28
michaeln
forgot to send this comment before https://codereview.chromium.org/375513002/diff/240001/content/browser/service_worker/service_worker_context_request_handler.cc File content/browser/service_worker/service_worker_context_request_handler.cc (right): https://codereview.chromium.org/375513002/diff/240001/content/browser/service_worker/service_worker_context_request_handler.cc#newcode78 content/browser/service_worker/service_worker_context_request_handler.cc:78: *was_fetched_via_service_worker = false; ...
6 years, 5 months ago (2014-07-17 19:34:20 UTC) #29
horo
https://codereview.chromium.org/375513002/diff/240001/content/browser/service_worker/service_worker_context_request_handler.cc File content/browser/service_worker/service_worker_context_request_handler.cc (right): https://codereview.chromium.org/375513002/diff/240001/content/browser/service_worker/service_worker_context_request_handler.cc#newcode78 content/browser/service_worker/service_worker_context_request_handler.cc:78: *was_fetched_via_service_worker = false; On 2014/07/17 19:34:20, michaeln wrote: > ...
6 years, 5 months ago (2014-07-18 04:17:39 UTC) #30
horo
jochen@ Could you please review this? Thank you.
6 years, 5 months ago (2014-07-18 04:19:41 UTC) #31
jochen (gone - plz use gerrit)
lgtm you'll need a security review for the ipc changes
6 years, 5 months ago (2014-07-18 09:04:19 UTC) #32
horo
nasko@ Could you please review content/common/resource_messages.h and content/common/service_worker/service_worker_messages.h? Thank you.
6 years, 5 months ago (2014-07-18 09:19:05 UTC) #33
nasko
IPC LGTM
6 years, 5 months ago (2014-07-21 13:06:09 UTC) #34
horo
The CQ bit was checked by horo@chromium.org
6 years, 5 months ago (2014-07-22 01:00:42 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/horo@chromium.org/375513002/260001
6 years, 5 months ago (2014-07-22 01:05:20 UTC) #36
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: win_chromium_compile_dbg on tryserver.chromium ...
6 years, 5 months ago (2014-07-22 03:54:21 UTC) #37
commit-bot: I haz the power
6 years, 5 months ago (2014-07-22 04:39:20 UTC) #38
Message was sent while issue was closed.
Change committed as 284627

Powered by Google App Engine
This is Rietveld 408576698