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

Issue 1708583003: Pass data saver pref value into embedded worker (Closed)

Created:
4 years, 10 months ago by bengr
Modified:
4 years, 9 months ago
Reviewers:
falken, kinuko, dcheng
CC:
blink-worker-reviews_chromium.org, chromium-reviews, darin-cc_chromium.org, horo+watch_chromium.org, jam, jsbell+serviceworker_chromium.org, kinuko+watch, kinuko+serviceworker, michaeln, mkwst+moarreviews-renderer_chromium.org, mlamouri+watch-content_chromium.org, nhiroki, serviceworker-reviews, tzik
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Adds EmbeddedWorkerSettings to EmbeddedWorkerMsg_StartWorker_Params. It contains v8 cache options and the data saver pref value. Whether or not Data Saver is enabled is provided by the ChromeContentBrowserClient. This value is read by ServiceWorkerProcessManager::AllocateWorkerProcess and is propagated to WebEmbeddedWorkerImpl::prepareShadowPageForLoader(). This is a near term fix; changes to the data saver state do not update the embedded worker once created. BUG=587242 Committed: https://crrev.com/e8a146fb2900a92700479df4672189b7501b8918 Cr-Commit-Position: refs/heads/master@{#380283}

Patch Set 1 : #

Total comments: 2

Patch Set 2 : #

Patch Set 3 : Added tests #

Total comments: 4

Patch Set 4 : Addressed nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+240 lines, -16 lines) Patch
M chrome/browser/chrome_content_browser_client.h View 1 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/chrome_content_browser_client.cc View 1 1 chunk +9 lines, -0 lines 0 comments Download
M chrome/browser/chrome_content_browser_client_unittest.cc View 1 2 chunks +9 lines, -0 lines 0 comments Download
M content/browser/service_worker/embedded_worker_instance.cc View 1 4 chunks +8 lines, -2 lines 0 comments Download
M content/browser/service_worker/service_worker_browsertest.cc View 1 2 3 4 chunks +147 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_process_manager.h View 1 2 chunks +3 lines, -1 line 0 comments Download
M content/browser/service_worker/service_worker_process_manager.cc View 1 8 chunks +18 lines, -6 lines 0 comments Download
M content/browser/service_worker/service_worker_process_manager_unittest.cc View 2 chunks +3 lines, -1 line 0 comments Download
M content/common/service_worker/embedded_worker_messages.h View 1 3 chunks +7 lines, -1 line 0 comments Download
A content/common/service_worker/embedded_worker_settings.h View 1 chunk +19 lines, -0 lines 0 comments Download
M content/content_common.gypi View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M content/public/browser/content_browser_client.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M content/public/browser/content_browser_client.cc View 1 1 chunk +4 lines, -0 lines 0 comments Download
M content/renderer/service_worker/embedded_worker_dispatcher.cc View 1 1 chunk +3 lines, -2 lines 0 comments Download
A + content/test/data/service_worker/add_save_data_to_title.js View 1 2 3 1 chunk +3 lines, -2 lines 0 comments Download
A + content/test/data/service_worker/add_save_data_to_title.js.mock-http-headers View 1 2 0 chunks +-1 lines, --1 lines 0 comments Download
A + content/test/data/service_worker/fetch_event_pass_through.js View 1 2 1 chunk +1 line, -3 lines 0 comments Download
A + content/test/data/service_worker/fetch_event_pass_through.js.mock-http-headers View 1 2 0 chunks +-1 lines, --1 lines 0 comments Download
A + content/test/data/service_worker/fetch_in_install.js View 1 2 1 chunk +1 line, -1 line 0 comments Download
A + content/test/data/service_worker/fetch_in_install.js.mock-http-headers View 1 0 chunks +-1 lines, --1 lines 0 comments Download
M third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp View 1 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/public/web/WebEmbeddedWorkerStartData.h View 1 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 24 (12 generated)
falken
This is looking good. In terms of testing, I think you want to test that ...
4 years, 10 months ago (2016-02-19 06:58:35 UTC) #2
bengr
kinuko@chromium.org: Please review changes in content/public/browser/content_browser_client.{cc,h} dcheng@chromium.org: Please review changes in content/common/service_worker/embedder_worker_messages.{cc,h} third_party/WebKit/* falken@chronium.org: Please ...
4 years, 9 months ago (2016-03-07 23:35:30 UTC) #7
falken
This looks good. There is some additional test coverage that'd be useful: - Test that ...
4 years, 9 months ago (2016-03-08 03:52:20 UTC) #8
bengr
On 2016/03/08 03:52:20, falken wrote: > This looks good. There is some additional test coverage ...
4 years, 9 months ago (2016-03-08 19:05:21 UTC) #10
bengr
On 2016/03/08 19:05:21, bengr wrote: > On 2016/03/08 03:52:20, falken wrote: > > This looks ...
4 years, 9 months ago (2016-03-09 01:32:38 UTC) #13
falken
lgtm. tests look great, thank you. https://codereview.chromium.org/1708583003/diff/140001/content/browser/service_worker/service_worker_browsertest.cc File content/browser/service_worker/service_worker_browsertest.cc (right): https://codereview.chromium.org/1708583003/diff/140001/content/browser/service_worker/service_worker_browsertest.cc#newcode1065 content/browser/service_worker/service_worker_browsertest.cc:1065: RequestWorkerScriptWithDataSaver) { naming ...
4 years, 9 months ago (2016-03-09 02:05:36 UTC) #14
kinuko
lgtm/2
4 years, 9 months ago (2016-03-09 11:35:11 UTC) #15
dcheng
lgtm
4 years, 9 months ago (2016-03-09 22:23:47 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1708583003/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1708583003/160001
4 years, 9 months ago (2016-03-09 23:21:30 UTC) #19
commit-bot: I haz the power
Committed patchset #4 (id:160001)
4 years, 9 months ago (2016-03-10 01:20:32 UTC) #21
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/e8a146fb2900a92700479df4672189b7501b8918 Cr-Commit-Position: refs/heads/master@{#380283}
4 years, 9 months ago (2016-03-10 01:22:20 UTC) #23
bengr
4 years, 9 months ago (2016-03-17 22:24:38 UTC) #24
Message was sent while issue was closed.
https://codereview.chromium.org/1708583003/diff/140001/content/browser/servic...
File content/browser/service_worker/service_worker_browsertest.cc (right):

https://codereview.chromium.org/1708583003/diff/140001/content/browser/servic...
content/browser/service_worker/service_worker_browsertest.cc:1065:
RequestWorkerScriptWithDataSaver) {
On 2016/03/09 02:05:36, falken wrote:
> naming nit: XXXWithSaveData to be consistent with the others, or make them all
> XXXWithDataSaver?

Done.

https://codereview.chromium.org/1708583003/diff/140001/content/test/data/serv...
File content/test/data/service_worker/add_save_data_to_title.js (right):

https://codereview.chromium.org/1708583003/diff/140001/content/test/data/serv...
content/test/data/service_worker/add_save_data_to_title.js:7:
headers.set('Content-Type', 'text/html; charset=UTF-8');
On 2016/03/09 02:05:36, falken wrote:
> It looks like lines 6-7 are not doing anything since headers isn't passed to
the
> Response constructor. Let's remove them or pass them to the constructor.

Good catch. Done.

Powered by Google App Engine
This is Rietveld 408576698