New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 607575 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jul 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug

Blocking:
issue 630356
issue 563870



Sign in to add a comment

Expose (subset of) Settings to Workers

Project Member Reported by xlai@chromium.org, Apr 28 2016

Issue description

Currently, the settings (core/frame/Settings) is usually accessible on main thread by calling document().settings(). 

We should find a way to transfer a subset of Settings from main thread to make it accessible via WorkerGlobalScope, so that these flags' values can be read in API functions that are exposed in workers.

Ideally, only a subset of appropriate flags in Settings are exposed to workers. This is because that it's possible that certain setting flags change values in the lifetime of Page. A flag that is boolean type and is initialized at the time when a page is loaded (e.g. accelerated_2d_canvas, disableReadFromCanvas) can be a good candidate to include into the set of Settings exposed in workers.

This issue is blocking usage of certain flags (e.g. disableReadFromCanvas) in OffscreenCanvas in worker.

 

Comment 1 by xlai@chromium.org, May 10 2016

Blocking: 563870

Comment 2 by xlai@chromium.org, May 10 2016

Labels: -Pri-3 Pri-2

Comment 3 by xlai@chromium.org, Jul 25 2016

Status: Started (was: Assigned)
Working CL in progress: https://codereview.chromium.org/2171563002/
Project Member

Comment 4 by bugdroid1@chromium.org, Jul 26 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bcb0806adb80a01830af344ce7d423b1cb864ec3

commit bcb0806adb80a01830af344ce7d423b1cb864ec3
Author: xlai <xlai@chromium.org>
Date: Tue Jul 26 17:32:50 2016

Add WorkerSettings to expose certain flag values in WorkerGlobalScope

Currently, Settings() can only be accessed from main thread. So I introduce
WorkerSettings to WorkerClients, such that when WorkerGlobalScope is started,
certain flag values can be passed on to be exposed in worker.

Right now, there is only one flag disableReadingFromCanvas in WorkerSettings (
OffscreenCanvas requires access to the value of flag disableReadingFromCanvas in
order to determine the value of originClean(), regardless of being on main or
worker thread); but it will be convenient for other developers who want to add
more.

BUG= 607575 

Review-Url: https://codereview.chromium.org/2171563002
Cr-Commit-Position: refs/heads/master@{#407842}

[add] https://crrev.com/bcb0806adb80a01830af344ce7d423b1cb864ec3/third_party/WebKit/LayoutTests/http/tests/security/offscreen-canvas-read-blocked-by-setting.html
[add] https://crrev.com/bcb0806adb80a01830af344ce7d423b1cb864ec3/third_party/WebKit/LayoutTests/http/tests/security/offscreen-canvas-worker-read-blocked-by-setting.html
[modify] https://crrev.com/bcb0806adb80a01830af344ce7d423b1cb864ec3/third_party/WebKit/Source/core/core.gypi
[modify] https://crrev.com/bcb0806adb80a01830af344ce7d423b1cb864ec3/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
[modify] https://crrev.com/bcb0806adb80a01830af344ce7d423b1cb864ec3/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h
[modify] https://crrev.com/bcb0806adb80a01830af344ce7d423b1cb864ec3/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.cpp
[modify] https://crrev.com/bcb0806adb80a01830af344ce7d423b1cb864ec3/third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.cpp
[modify] https://crrev.com/bcb0806adb80a01830af344ce7d423b1cb864ec3/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.cpp
[modify] https://crrev.com/bcb0806adb80a01830af344ce7d423b1cb864ec3/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp
[modify] https://crrev.com/bcb0806adb80a01830af344ce7d423b1cb864ec3/third_party/WebKit/Source/core/workers/WorkerGlobalScope.h
[add] https://crrev.com/bcb0806adb80a01830af344ce7d423b1cb864ec3/third_party/WebKit/Source/core/workers/WorkerSettings.cpp
[add] https://crrev.com/bcb0806adb80a01830af344ce7d423b1cb864ec3/third_party/WebKit/Source/core/workers/WorkerSettings.h
[modify] https://crrev.com/bcb0806adb80a01830af344ce7d423b1cb864ec3/third_party/WebKit/Source/core/workers/WorkerThreadStartupData.cpp
[modify] https://crrev.com/bcb0806adb80a01830af344ce7d423b1cb864ec3/third_party/WebKit/Source/core/workers/WorkerThreadStartupData.h
[modify] https://crrev.com/bcb0806adb80a01830af344ce7d423b1cb864ec3/third_party/WebKit/Source/core/workers/WorkerThreadTest.cpp
[modify] https://crrev.com/bcb0806adb80a01830af344ce7d423b1cb864ec3/third_party/WebKit/Source/core/workers/WorkerThreadTestHelper.h
[modify] https://crrev.com/bcb0806adb80a01830af344ce7d423b1cb864ec3/third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp
[modify] https://crrev.com/bcb0806adb80a01830af344ce7d423b1cb864ec3/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
[modify] https://crrev.com/bcb0806adb80a01830af344ce7d423b1cb864ec3/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h
[modify] https://crrev.com/bcb0806adb80a01830af344ce7d423b1cb864ec3/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
[modify] https://crrev.com/bcb0806adb80a01830af344ce7d423b1cb864ec3/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp

Comment 5 by xlai@chromium.org, Jul 27 2016

Cc: vollick@chromium.org
Status: Fixed (was: Started)
+cc vollick who has shown interest in worker settings.

Right now, this WorkerSettings is only available in SharedWorker scope and DedicatedWorker scope. I didn't add it to CompositorWorker or ServiceWorker; but if someone else want to have it available in CompositorWorkerGlobalScope or ServiceWorkerGlobalScope, they can just add "context->setWorkerSettings(std::move(startupData->m_workerSettings));" to the create() function of the desired workerGlobalScope.

Btw, small typo for the log above: WorkerSettings is actually added to WorkerThreadStartupData, not WorkerClients as stated in the log above. I've changed the original CL's description. 

Labels: M-54

Comment 7 by kbr@chromium.org, Aug 5 2016

Blocking: 630356
Project Member

Comment 8 by bugdroid1@chromium.org, Jul 14 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d4643d99c7790a75d8ac2369981cd32771ce0305

commit d4643d99c7790a75d8ac2369981cd32771ce0305
Author: Tsuyoshi Horo <horo@chromium.org>
Date: Fri Jul 14 07:46:45 2017

Set WorkerSettings of ServiceWorkerGlobalScope.

I'm planing to add MixedContentChecking related settings to
WorkerSettings for off-main-thread-fetch.
But WorkerSettings is not set correctly in ServiceWorkerGlobalScope.
So this CL just adds SetWorkerSettings() in
ServiceWorkerGlobalScope::Create().

BUG= 607575 ,  443374 

Change-Id: I0e32bb84ce316b7125bfe11facfe5182095ae63f
Reviewed-on: https://chromium-review.googlesource.com/571207
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486701}
[modify] https://crrev.com/d4643d99c7790a75d8ac2369981cd32771ce0305/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp

Sign in to add a comment