Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plumb experimental noise injection deeper into WebCore #10620

Conversation

sysrqb
Copy link
Contributor

@sysrqb sysrqb commented Feb 23, 2023

03aaaf7

Plumb experimental noise injection deeper into WebCore
https://bugs.webkit.org/show_bug.cgi?id=252865
rdar://105853723

Reviewed by Wenson Hsieh.

We now maintain site-specific "salt" values that will be used when deciding how
noise should be applied. The application of noise is controlled by a policy
flag that was previously added, and we move the decision-logic into the
Document for simpler access. We plumb the site-specific salt through Workers
and Worklets, as well as exposing it on the Document.

This patch doesn't have any tests for this functionality yet because there
aren't any behavior changes.

* Source/WebCore/Modules/webaudio/AudioWorkletMessagingProxy.cpp:
(WebCore::generateWorkletParameters):
* Source/WebCore/Modules/webaudio/BaseAudioContext.cpp:
(WebCore::BaseAudioContext::BaseAudioContext):
(WebCore::noiseInjectionPolicy): Deleted.
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::noiseInjectionPolicy const):
(WebCore::Document::noiseInjectionHashSalt const):
* Source/WebCore/dom/Document.h:
* Source/WebCore/dom/EmptyScriptExecutionContext.h:
* Source/WebCore/dom/ScriptExecutionContext.h:
* Source/WebCore/page/Page.cpp:
(WebCore::Page::noiseInjectionHashSaltForDomain):
* Source/WebCore/page/Page.h:
* Source/WebCore/platform/NoiseInjectionPolicy.h: Renamed from Source/WebCore/Modules/webaudio/NoiseInjectionPolicy.h.
* Source/WebCore/workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::WorkerGlobalScope):
* Source/WebCore/workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
* Source/WebCore/workers/WorkerOrWorkletGlobalScope.cpp:
(WebCore::WorkerOrWorkletGlobalScope::WorkerOrWorkletGlobalScope):
* Source/WebCore/workers/WorkerOrWorkletGlobalScope.h:
(WebCore::WorkerOrWorkletGlobalScope::WorkerOrWorkletGlobalScope):
* Source/WebCore/workers/WorkerThread.cpp:
(WebCore::WorkerParameters::isolatedCopy const):
* Source/WebCore/workers/WorkerThread.h:
* Source/WebCore/workers/service/context/ServiceWorkerThread.cpp:
(WebCore::generateWorkerParameters):
(WebCore::ServiceWorkerThread::ServiceWorkerThread):
* Source/WebCore/workers/service/context/ServiceWorkerThread.h:
* Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
* Source/WebCore/workers/shared/context/SharedWorkerThreadProxy.cpp:
(WebCore::generateWorkerParameters):
* Source/WebCore/worklets/WorkletGlobalScope.cpp:
(WebCore::WorkletGlobalScope::WorkletGlobalScope):
* Source/WebCore/worklets/WorkletParameters.h:
(WebCore::WorkletParameters::isolatedCopy const):
(WebCore::WorkletParameters::isolatedCopy):

Canonical link: https://commits.webkit.org/261044@main

d102fd8

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ›  gtk
βœ… πŸ§ͺ webkitperl   πŸ§ͺ ios-wk2   πŸ§ͺ api-mac βœ… πŸ§ͺ gtk-wk2
  πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk1 βœ… πŸ§ͺ api-gtk
βœ… πŸ›  tv βœ… πŸ§ͺ mac-wk2
βœ… πŸ›  tv-sim   πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  watch βœ… πŸ§ͺ mac-wk2-stress
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch-sim

@sysrqb sysrqb force-pushed the eng/Plumb-experimental-noise-injection-deeper-into-WebCore branch from 2f40e87 to 74494f3 Compare February 24, 2023 01:51
Copy link
Member

@whsieh whsieh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems reasonable to me, but I'm not familiar enough with workers (and service workers) to review those parts of the patch. Perhaps @cdumez could take a look as well?

Copy link
Member

@whsieh whsieh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chris and I looked through this again; LGTM, with the extra check for RegistrableDomain before adding it to the map!

Source/WebCore/page/Page.cpp Show resolved Hide resolved
@Ahmad-S792 Ahmad-S792 added the New Bugs Unclassified bugs are placed in this component until the correct component can be determined. label Mar 1, 2023
@sysrqb sysrqb force-pushed the eng/Plumb-experimental-noise-injection-deeper-into-WebCore branch from 74494f3 to d102fd8 Compare March 2, 2023 00:47
@sysrqb sysrqb added merge-queue Applied to send a pull request to merge-queue and removed New Bugs Unclassified bugs are placed in this component until the correct component can be determined. labels Mar 2, 2023
https://bugs.webkit.org/show_bug.cgi?id=252865
rdar://105853723

Reviewed by Wenson Hsieh.

We now maintain site-specific "salt" values that will be used when deciding how
noise should be applied. The application of noise is controlled by a policy
flag that was previously added, and we move the decision-logic into the
Document for simpler access. We plumb the site-specific salt through Workers
and Worklets, as well as exposing it on the Document.

This patch doesn't have any tests for this functionality yet because there
aren't any behavior changes.

* Source/WebCore/Modules/webaudio/AudioWorkletMessagingProxy.cpp:
(WebCore::generateWorkletParameters):
* Source/WebCore/Modules/webaudio/BaseAudioContext.cpp:
(WebCore::BaseAudioContext::BaseAudioContext):
(WebCore::noiseInjectionPolicy): Deleted.
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::noiseInjectionPolicy const):
(WebCore::Document::noiseInjectionHashSalt const):
* Source/WebCore/dom/Document.h:
* Source/WebCore/dom/EmptyScriptExecutionContext.h:
* Source/WebCore/dom/ScriptExecutionContext.h:
* Source/WebCore/page/Page.cpp:
(WebCore::Page::noiseInjectionHashSaltForDomain):
* Source/WebCore/page/Page.h:
* Source/WebCore/platform/NoiseInjectionPolicy.h: Renamed from Source/WebCore/Modules/webaudio/NoiseInjectionPolicy.h.
* Source/WebCore/workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::WorkerGlobalScope):
* Source/WebCore/workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
* Source/WebCore/workers/WorkerOrWorkletGlobalScope.cpp:
(WebCore::WorkerOrWorkletGlobalScope::WorkerOrWorkletGlobalScope):
* Source/WebCore/workers/WorkerOrWorkletGlobalScope.h:
(WebCore::WorkerOrWorkletGlobalScope::WorkerOrWorkletGlobalScope):
* Source/WebCore/workers/WorkerThread.cpp:
(WebCore::WorkerParameters::isolatedCopy const):
* Source/WebCore/workers/WorkerThread.h:
* Source/WebCore/workers/service/context/ServiceWorkerThread.cpp:
(WebCore::generateWorkerParameters):
(WebCore::ServiceWorkerThread::ServiceWorkerThread):
* Source/WebCore/workers/service/context/ServiceWorkerThread.h:
* Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
* Source/WebCore/workers/shared/context/SharedWorkerThreadProxy.cpp:
(WebCore::generateWorkerParameters):
* Source/WebCore/worklets/WorkletGlobalScope.cpp:
(WebCore::WorkletGlobalScope::WorkletGlobalScope):
* Source/WebCore/worklets/WorkletParameters.h:
(WebCore::WorkletParameters::isolatedCopy const):
(WebCore::WorkletParameters::isolatedCopy):

Canonical link: https://commits.webkit.org/261044@main
@webkit-early-warning-system webkit-early-warning-system force-pushed the eng/Plumb-experimental-noise-injection-deeper-into-WebCore branch from d102fd8 to 03aaaf7 Compare March 2, 2023 07:04
@webkit-commit-queue
Copy link
Collaborator

Committed 261044@main (03aaaf7): https://commits.webkit.org/261044@main

Reviewed commits have been landed. Closing PR #10620 and removing active labels.

@webkit-early-warning-system webkit-early-warning-system merged commit 03aaaf7 into WebKit:main Mar 2, 2023
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants