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

Issue 666973003: [ServiceWorker] Don't send the UMA related headers to the ServiceWorker. (Closed)

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

Description

[ServiceWorker] Don't send the UMA related headers to the ServiceWorker. Chrome add "X-Chrome-UMA-Enabled" (and sometimes "X-Client-Data") headers while accessing Google servers if UMA is enabled. This header is added before sending the request to the ServiceWorker. So the request which is passed to the ServiceWorker contains this header. If event.request.mode is 'cors' and event.request.headers has "x-chrome-uma-enabled", fetch(event.request) send a CORS preflight request. This preflight request contains "Access-Control-Request-Headers: x-chrome-uma-enabled" header. But the response from the Google server doesn't contain "Access-Control-Allow-Headers: x-chrome-uma-enabled" header. So this fetch fails. To avoid this problem this patch removes these headers before sending the request to the ServiceWorker. This patch introduces ServiceWorkerContext::AddExcludedHeadersForFetchEvent() method and changes DevToolsNetworkTransactionFactory to call this method. BUG=425649 Committed: https://crrev.com/e09b6c8616f4a8e45e91a171eedddefde9522ac2 Cr-Commit-Position: refs/heads/master@{#302379}

Patch Set 1 #

Total comments: 5

Patch Set 2 : introudce ServiceWorkerContext::AddExcludedHeaderNameForFetchEvent #

Total comments: 8

Patch Set 3 : introduce VariationsHttpHeaderProvider::GetExcludedHeadersForFetchEvent #

Total comments: 2

Patch Set 4 : GetVariationHeaderNames #

Total comments: 2

Patch Set 5 : use const ref #

Total comments: 14

Patch Set 6 : rebase #

Patch Set 7 : move to IOThread::InitAsync() #

Patch Set 8 : revert io_thread, devtools_network_transaction_factory and move ServiceWorkerContext to service_worker_context_wrapper #

Total comments: 2

Patch Set 9 : use set #

Unified diffs Side-by-side diffs Delta from patch set Stats (+84 lines, -25 lines) Patch
M chrome/browser/devtools/devtools_network_transaction.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/devtools/devtools_network_transaction.cc View 1 1 chunk +6 lines, -8 lines 0 comments Download
M chrome/browser/devtools/devtools_network_transaction_factory.cc View 1 2 3 4 5 6 7 8 2 chunks +9 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc View 1 2 3 4 5 6 7 2 chunks +7 lines, -0 lines 0 comments Download
M components/variations/net/variations_http_header_provider.h View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -0 lines 0 comments Download
M components/variations/net/variations_http_header_provider.cc View 1 2 3 4 5 6 7 8 5 chunks +15 lines, -3 lines 0 comments Download
M content/browser/service_worker/service_worker_context_wrapper.cc View 1 2 3 4 5 6 7 8 3 chunks +27 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_url_request_job.cc View 1 2 3 chunks +2 lines, -14 lines 0 comments Download
M content/public/browser/service_worker_context.h View 1 2 3 4 5 6 7 8 2 chunks +12 lines, -0 lines 0 comments Download

Messages

Total messages: 51 (10 generated)
horo
michaeln@ Could you please review this?
6 years, 2 months ago (2014-10-22 13:38:01 UTC) #2
michaeln
https://codereview.chromium.org/666973003/diff/1/components/variations/variations_http_header_provider.cc File components/variations/variations_http_header_provider.cc (right): https://codereview.chromium.org/666973003/diff/1/components/variations/variations_http_header_provider.cc#newcode118 components/variations/variations_http_header_provider.cc:118: : variation_ids_cache_initialized_(false) { Instead of hand coding matching values ...
6 years, 2 months ago (2014-10-22 22:19:41 UTC) #3
horo
On 2014/10/22 22:19:41, michaeln wrote: > https://codereview.chromium.org/666973003/diff/1/components/variations/variations_http_header_provider.cc > File components/variations/variations_http_header_provider.cc (right): > > https://codereview.chromium.org/666973003/diff/1/components/variations/variations_http_header_provider.cc#newcode118 > ...
6 years, 2 months ago (2014-10-23 07:19:35 UTC) #5
michaeln
Hmm, the comment is on a different target, we're interested in the variations_http_provider target? Maybe ...
6 years, 2 months ago (2014-10-23 21:36:21 UTC) #7
Alexei Svitkine (slow)
Why is the problem unique to service workers? What about other cors requests? Also, since ...
6 years, 2 months ago (2014-10-23 21:41:43 UTC) #8
michaeln1
On 2014/10/23 21:41:43, Alexei Svitkine wrote: > Why is the problem unique to service workers? ...
6 years, 2 months ago (2014-10-23 22:13:46 UTC) #9
horo
On 2014/10/23 22:13:46, michaeln1 wrote: > On 2014/10/23 21:41:43, Alexei Svitkine wrote: > > Why ...
6 years, 2 months ago (2014-10-24 06:55:31 UTC) #10
Alexei Svitkine (slow)
https://codereview.chromium.org/666973003/diff/1/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/666973003/diff/1/content/browser/service_worker/service_worker_url_request_job.cc#newcode42 content/browser/service_worker/service_worker_url_request_job.cc:42: // Keep in sync with variations_http_header_provider.cc. On 2014/10/22 22:19:40, ...
6 years, 2 months ago (2014-10-24 15:35:48 UTC) #11
michaeln
> I think wheter the request is CORS or not, the headers which are added ...
6 years, 2 months ago (2014-10-24 19:49:50 UTC) #12
horo
https://codereview.chromium.org/666973003/diff/1/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/666973003/diff/1/content/browser/service_worker/service_worker_url_request_job.cc#newcode42 content/browser/service_worker/service_worker_url_request_job.cc:42: // Keep in sync with variations_http_header_provider.cc. On 2014/10/24 19:49:50, ...
6 years, 1 month ago (2014-10-27 14:15:41 UTC) #13
Alexei Svitkine (slow)
https://codereview.chromium.org/666973003/diff/40001/chrome/browser/devtools/devtools_network_transaction.cc File chrome/browser/devtools/devtools_network_transaction.cc (right): https://codereview.chromium.org/666973003/diff/40001/chrome/browser/devtools/devtools_network_transaction.cc#newcode18 chrome/browser/devtools/devtools_network_transaction.cc:18: "X-DevTools-Request-Initiator"; Why not move these to devtools_network_transaction_factory.cc where they're ...
6 years, 1 month ago (2014-10-27 15:09:00 UTC) #14
michaeln
https://codereview.chromium.org/666973003/diff/40001/components/variations/net/variations_http_header_provider.cc File components/variations/net/variations_http_header_provider.cc (right): https://codereview.chromium.org/666973003/diff/40001/components/variations/net/variations_http_header_provider.cc#newcode119 components/variations/net/variations_http_header_provider.cc:119: content::ServiceWorkerContext::AddExcludedHeaderNameForFetchEvent( On 2014/10/27 15:09:00, Alexei Svitkine wrote: > Since ...
6 years, 1 month ago (2014-10-27 21:50:26 UTC) #15
horo
https://codereview.chromium.org/666973003/diff/40001/chrome/browser/devtools/devtools_network_transaction.cc File chrome/browser/devtools/devtools_network_transaction.cc (right): https://codereview.chromium.org/666973003/diff/40001/chrome/browser/devtools/devtools_network_transaction.cc#newcode18 chrome/browser/devtools/devtools_network_transaction.cc:18: "X-DevTools-Request-Initiator"; On 2014/10/27 15:09:00, Alexei Svitkine wrote: > Why ...
6 years, 1 month ago (2014-10-28 02:35:05 UTC) #16
Alexei Svitkine (slow)
https://codereview.chromium.org/666973003/diff/60001/components/variations/net/variations_http_header_provider.h File components/variations/net/variations_http_header_provider.h (right): https://codereview.chromium.org/666973003/diff/60001/components/variations/net/variations_http_header_provider.h#newcode54 components/variations/net/variations_http_header_provider.h:54: std::vector<std::string> GetExcludedHeadersForFetchEvent() const; I wouldn't use the term "Excluded" ...
6 years, 1 month ago (2014-10-28 13:32:51 UTC) #17
horo
https://codereview.chromium.org/666973003/diff/60001/components/variations/net/variations_http_header_provider.h File components/variations/net/variations_http_header_provider.h (right): https://codereview.chromium.org/666973003/diff/60001/components/variations/net/variations_http_header_provider.h#newcode54 components/variations/net/variations_http_header_provider.h:54: std::vector<std::string> GetExcludedHeadersForFetchEvent() const; On 2014/10/28 13:32:50, Alexei Svitkine wrote: ...
6 years, 1 month ago (2014-10-28 15:35:48 UTC) #18
Alexei Svitkine (slow)
variations/ lgtm
6 years, 1 month ago (2014-10-28 16:47:04 UTC) #19
michaeln
lgtm 2 https://codereview.chromium.org/666973003/diff/80001/content/public/browser/service_worker_context.h File content/public/browser/service_worker_context.h (right): https://codereview.chromium.org/666973003/diff/80001/content/public/browser/service_worker_context.h#newcode34 content/public/browser/service_worker_context.h:34: const std::vector<std::string> header_names); can this be a ...
6 years, 1 month ago (2014-10-28 20:57:22 UTC) #20
horo
Thank you! https://codereview.chromium.org/666973003/diff/80001/content/public/browser/service_worker_context.h File content/public/browser/service_worker_context.h (right): https://codereview.chromium.org/666973003/diff/80001/content/public/browser/service_worker_context.h#newcode34 content/public/browser/service_worker_context.h:34: const std::vector<std::string> header_names); On 2014/10/28 20:57:22, michaeln ...
6 years, 1 month ago (2014-10-29 01:56:25 UTC) #21
horo
vsevik@ Could you please review chrome/browser/devtoos/*? Thank you!
6 years, 1 month ago (2014-10-29 02:01:25 UTC) #23
vsevik
devtools lgtm
6 years, 1 month ago (2014-10-29 09:12:40 UTC) #24
horo
thestig@ Could you please review chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc?
6 years, 1 month ago (2014-10-29 09:22:43 UTC) #26
horo
sievers@ Could you please review content/public/browser/service_worker_context.*?
6 years, 1 month ago (2014-10-29 09:23:28 UTC) #28
no sievers
https://codereview.chromium.org/666973003/diff/100001/content/public/browser/service_worker_context.cc File content/public/browser/service_worker_context.cc (right): https://codereview.chromium.org/666973003/diff/100001/content/public/browser/service_worker_context.cc#newcode19 content/public/browser/service_worker_context.cc:19: Do you think the static functions could move to ...
6 years, 1 month ago (2014-10-29 21:19:58 UTC) #29
Lei Zhang
https://codereview.chromium.org/666973003/diff/100001/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc File chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc (right): https://codereview.chromium.org/666973003/diff/100001/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc#newcode275 chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc:275: content::ServiceWorkerContext::AddExcludedHeadersForFetchEvent( This looks like essentially a static function call. ...
6 years, 1 month ago (2014-10-29 21:47:21 UTC) #30
horo
https://codereview.chromium.org/666973003/diff/100001/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc File chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc (right): https://codereview.chromium.org/666973003/diff/100001/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc#newcode275 chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc:275: content::ServiceWorkerContext::AddExcludedHeadersForFetchEvent( On 2014/10/29 21:47:21, Lei Zhang wrote: > This ...
6 years, 1 month ago (2014-10-30 07:54:35 UTC) #32
Lei Zhang
https://codereview.chromium.org/666973003/diff/100001/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc File chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc (right): https://codereview.chromium.org/666973003/diff/100001/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc#newcode275 chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc:275: content::ServiceWorkerContext::AddExcludedHeadersForFetchEvent( On 2014/10/30 07:54:34, horo wrote: > On 2014/10/29 ...
6 years, 1 month ago (2014-10-30 08:05:17 UTC) #33
horo
cbentzel@ Could you please review chrome/browser/io_thread.cc? Thank you
6 years, 1 month ago (2014-10-30 08:23:11 UTC) #35
cbentzel
On 2014/10/30 08:23:11, horo wrote: > cbentzel@ > Could you please review chrome/browser/io_thread.cc? > Thank ...
6 years, 1 month ago (2014-10-30 17:09:27 UTC) #36
cbentzel
On 2014/10/30 17:09:27, cbentzel wrote: > On 2014/10/30 08:23:11, horo wrote: > > cbentzel@ > ...
6 years, 1 month ago (2014-10-30 17:10:52 UTC) #37
cbentzel
On 2014/10/30 17:10:52, cbentzel wrote: > On 2014/10/30 17:09:27, cbentzel wrote: > > On 2014/10/30 ...
6 years, 1 month ago (2014-10-30 17:25:11 UTC) #38
no sievers
https://codereview.chromium.org/666973003/diff/100001/content/public/browser/service_worker_context.cc File content/public/browser/service_worker_context.cc (right): https://codereview.chromium.org/666973003/diff/100001/content/public/browser/service_worker_context.cc#newcode19 content/public/browser/service_worker_context.cc:19: On 2014/10/30 07:54:34, horo wrote: > On 2014/10/29 21:19:58, ...
6 years, 1 month ago (2014-10-30 19:35:33 UTC) #39
michaeln
On 2014/10/30 17:25:11, cbentzel wrote: > On 2014/10/30 17:10:52, cbentzel wrote: > > On 2014/10/30 ...
6 years, 1 month ago (2014-10-30 19:56:32 UTC) #40
horo
I reverted io_thread.cc and devtools_network_transaction_factory.cc and moved ServiceWorkerContext method definition to service_worker_context_wrapper.cc. How about patch ...
6 years, 1 month ago (2014-10-31 14:19:18 UTC) #42
Lei Zhang
Given michaeln's comments, chrome_resource_dispatcher_host_delegate.cc lgtm
6 years, 1 month ago (2014-10-31 18:10:20 UTC) #43
no sievers
content lgtm
6 years, 1 month ago (2014-10-31 18:41:25 UTC) #44
cbentzel
On 2014/10/31 18:41:25, sievers wrote: > content lgtm Thanks for making the io_thread change. Non-vote ...
6 years, 1 month ago (2014-10-31 19:55:48 UTC) #45
cbentzel
https://codereview.chromium.org/666973003/diff/200001/content/browser/service_worker/service_worker_context_wrapper.cc File content/browser/service_worker/service_worker_context_wrapper.cc (right): https://codereview.chromium.org/666973003/diff/200001/content/browser/service_worker/service_worker_context_wrapper.cc#newcode41 content/browser/service_worker/service_worker_context_wrapper.cc:41: const std::vector<std::string>& header_names) { Should this argument be a ...
6 years, 1 month ago (2014-10-31 20:00:15 UTC) #46
horo
Thank you for your review! https://codereview.chromium.org/666973003/diff/200001/content/browser/service_worker/service_worker_context_wrapper.cc File content/browser/service_worker/service_worker_context_wrapper.cc (right): https://codereview.chromium.org/666973003/diff/200001/content/browser/service_worker/service_worker_context_wrapper.cc#newcode41 content/browser/service_worker/service_worker_context_wrapper.cc:41: const std::vector<std::string>& header_names) { ...
6 years, 1 month ago (2014-11-01 00:23:39 UTC) #47
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/666973003/220001
6 years, 1 month ago (2014-11-01 01:23:29 UTC) #49
commit-bot: I haz the power
Committed patchset #9 (id:220001)
6 years, 1 month ago (2014-11-01 02:08:36 UTC) #50
commit-bot: I haz the power
6 years, 1 month ago (2014-11-01 02:09:15 UTC) #51
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/e09b6c8616f4a8e45e91a171eedddefde9522ac2
Cr-Commit-Position: refs/heads/master@{#302379}

Powered by Google App Engine
This is Rietveld 408576698