Expose (subset of) Settings to Workers |
|||||
Issue descriptionCurrently, 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.
,
May 10 2016
,
Jul 25 2016
,
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
,
Jul 27 2016
+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.
,
Jul 27 2016
,
Aug 5 2016
,
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 |
|||||
Comment 1 by xlai@chromium.org
, May 10 2016