Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (270761 => 270762)
--- trunk/Source/_javascript_Core/ChangeLog 2020-12-14 05:19:33 UTC (rev 270761)
+++ trunk/Source/_javascript_Core/ChangeLog 2020-12-14 09:43:55 UTC (rev 270762)
@@ -1,3 +1,13 @@
+2020-12-14 Youenn Fablet <[email protected]>
+
+ Pass an isolated copy of Settings to workers and worklets.
+ https://bugs.webkit.org/show_bug.cgi?id=219688
+
+ Reviewed by Sam Weinig.
+
+ * runtime/RuntimeFlags.h:
+ (JSC::RuntimeFlags::isolatedCopy const):
+
2020-12-13 Samuel Thibault <[email protected]>
[JSC] Set s_maxPathLength fallback when OS does not have a PATH_MAX limitation
Modified: trunk/Source/_javascript_Core/runtime/RuntimeFlags.h (270761 => 270762)
--- trunk/Source/_javascript_Core/runtime/RuntimeFlags.h 2020-12-14 05:19:33 UTC (rev 270761)
+++ trunk/Source/_javascript_Core/runtime/RuntimeFlags.h 2020-12-14 09:43:55 UTC (rev 270762)
@@ -90,6 +90,8 @@
);
}
+ RuntimeFlags isolatedCopy() const { return RuntimeFlags(m_flags); }
+
private:
unsigned m_flags;
};
Modified: trunk/Source/WTF/ChangeLog (270761 => 270762)
--- trunk/Source/WTF/ChangeLog 2020-12-14 05:19:33 UTC (rev 270761)
+++ trunk/Source/WTF/ChangeLog 2020-12-14 09:43:55 UTC (rev 270762)
@@ -1,3 +1,14 @@
+2020-12-14 Youenn Fablet <[email protected]>
+
+ Pass an isolated copy of Settings to workers and worklets.
+ https://bugs.webkit.org/show_bug.cgi?id=219688
+
+ Reviewed by Sam Weinig.
+
+ Add missing default values.
+
+ * Scripts/Preferences/WebPreferences.yaml:
+
2020-12-13 Andy Estes <[email protected]>
[Mac] Register the format reader plug-in for WebM content types
Modified: trunk/Source/WTF/Scripts/Preferences/WebPreferences.yaml (270761 => 270762)
--- trunk/Source/WTF/Scripts/Preferences/WebPreferences.yaml 2020-12-14 05:19:33 UTC (rev 270761)
+++ trunk/Source/WTF/Scripts/Preferences/WebPreferences.yaml 2020-12-14 09:43:55 UTC (rev 270762)
@@ -600,7 +600,7 @@
WebKit:
default: WebCore::defaultTextEncodingNameForSystemLanguage()
WebCore:
- default:
+ default: '{ }'
DeferredCSSParserEnabled:
type: bool
Modified: trunk/Source/WebCore/ChangeLog (270761 => 270762)
--- trunk/Source/WebCore/ChangeLog 2020-12-14 05:19:33 UTC (rev 270761)
+++ trunk/Source/WebCore/ChangeLog 2020-12-14 09:43:55 UTC (rev 270762)
@@ -1,3 +1,44 @@
+2020-12-14 Youenn Fablet <[email protected]>
+
+ Pass an isolated copy of Settings to workers and worklets.
+ https://bugs.webkit.org/show_bug.cgi?id=219688
+
+ Reviewed by Sam Weinig.
+
+ Generate a Settings::Values struct containing all setting values.
+ Workers and worklets get that structure from their document and do a thread safe copy to use it in the background thread.
+ Covered by existing tests in workers.
+
+ * Modules/webaudio/AudioWorkletMessagingProxy.cpp:
+ (WebCore::generateWorkletParameters):
+ * Scripts/SettingsTemplates/Settings.cpp.erb:
+ * Scripts/SettingsTemplates/Settings.h.erb:
+ * dom/Document.h:
+ * dom/EmptyScriptExecutionContext.h:
+ * dom/ScriptExecutionContext.h:
+ * page/Settings.yaml:
+ * workers/WorkerGlobalScope.cpp:
+ (WebCore::WorkerGlobalScope::WorkerGlobalScope):
+ * workers/WorkerGlobalScope.h:
+ (WebCore::WorkerGlobalScope::requestAnimationFrameEnabled const):
+ (WebCore::WorkerGlobalScope::acceleratedCompositingEnabled const):
+ (WebCore::WorkerGlobalScope::webGLEnabled const):
+ * workers/WorkerMessagingProxy.cpp:
+ (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
+ * workers/WorkerThread.cpp:
+ (WebCore::WorkerParameters::isolatedCopy const):
+ * workers/WorkerThread.h:
+ * workers/service/context/ServiceWorkerThread.cpp:
+ (WebCore::ServiceWorkerThread::ServiceWorkerThread):
+ * workers/service/context/ServiceWorkerThread.h:
+ * workers/service/context/ServiceWorkerThreadProxy.cpp:
+ (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
+ * worklets/WorkletGlobalScope.cpp:
+ (WebCore::WorkletGlobalScope::WorkletGlobalScope):
+ * worklets/WorkletGlobalScope.h:
+ * worklets/WorkletParameters.h:
+ (WebCore::WorkletParameters::isolatedCopy const):
+
2020-12-13 Andy Estes <[email protected]>
[Mac] Create a MediaToolbox format reader plug-in for WebM
Modified: trunk/Source/WebCore/Modules/webaudio/AudioWorkletMessagingProxy.cpp (270761 => 270762)
--- trunk/Source/WebCore/Modules/webaudio/AudioWorkletMessagingProxy.cpp 2020-12-14 05:19:33 UTC (rev 270761)
+++ trunk/Source/WebCore/Modules/webaudio/AudioWorkletMessagingProxy.cpp 2020-12-14 09:43:55 UTC (rev 270762)
@@ -52,7 +52,8 @@
document->url(),
jsRuntimeFlags,
worklet.audioContext() ? worklet.audioContext()->sampleRate() : 0.0f,
- worklet.identifier()
+ worklet.identifier(),
+ document->settingsValues()
};
}
Modified: trunk/Source/WebCore/Scripts/SettingsTemplates/Settings.cpp.erb (270761 => 270762)
--- trunk/Source/WebCore/Scripts/SettingsTemplates/Settings.cpp.erb 2020-12-14 05:19:33 UTC (rev 270761)
+++ trunk/Source/WebCore/Scripts/SettingsTemplates/Settings.cpp.erb 2020-12-14 09:43:55 UTC (rev 270762)
@@ -66,6 +66,12 @@
Settings::Settings(Page* page)
: SettingsBase(page)
+{
+ m_values.initialize();
+}
+
+void Settings::Values::initialize()
+{
<%- for @condition in @allSettingsSet.conditions do -%>
<%- if @condition.nonBoolSettingsNeedingImplementation.length != 0 -%>
<%- if @condition.condition -%>
@@ -72,7 +78,7 @@
#if <%= @condition.condition %>
<%- end -%>
<%- for @setting in @condition.nonBoolSettingsNeedingImplementation -%>
- , m_<%= @setting.name %>(SETTING_DEFAULT_VALUE_FOR_<%= @setting.name %>)
+ <%= @setting.name %> = SETTING_DEFAULT_VALUE_FOR_<%= @setting.name %>;
<%- end -%>
<%- if @condition.condition -%>
#endif
@@ -85,7 +91,7 @@
#if <%= @condition.condition %>
<%- end -%>
<%- for @setting in @condition.boolSettingsNeedingImplementation -%>
- , m_<%= @setting.name %>(SETTING_DEFAULT_VALUE_FOR_<%= @setting.name %>)
+ <%= @setting.name %> = SETTING_DEFAULT_VALUE_FOR_<%= @setting.name %>;
<%- end -%>
<%- if @condition.condition -%>
#endif
@@ -92,8 +98,41 @@
<%- end -%>
<%- end -%>
<%- end -%>
+}
+Settings::Values Settings::Values::isolatedCopy() const
{
+ return {
+<%- for @setting in @allSettingsSet.inspectorOverrideSettings do -%>
+ crossThreadCopy(<%= @setting.name %>InspectorOverride),
+<%- end -%>
+<%- for @condition in @allSettingsSet.conditions do -%>
+<%- if @condition.nonBoolSettingsNeedingImplementation.length != 0 -%>
+<%- if @condition.condition -%>
+#if <%= @condition.condition %>
+<%- end -%>
+<%- for @setting in @condition.nonBoolSettingsNeedingImplementation -%>
+ crossThreadCopy(<%= @setting.name %>),
+<%- end -%>
+<%- if @condition.condition -%>
+#endif
+<%- end -%>
+<%- end -%>
+<%- end -%>
+<%- for @condition in @allSettingsSet.conditions do -%>
+<%- if @condition.boolSettingsNeedingImplementation.length != 0 -%>
+<%- if @condition.condition -%>
+#if <%= @condition.condition %>
+<%- end -%>
+<%- for @setting in @condition.boolSettingsNeedingImplementation -%>
+ crossThreadCopy(<%= @setting.name %>),
+<%- end -%>
+<%- if @condition.condition -%>
+#endif
+<%- end -%>
+<%- end -%>
+<%- end -%>
+ };
}
Settings::~Settings()
@@ -109,12 +148,12 @@
<%= @setting.parameterType %> Settings::<%= @setting.getterFunctionName %>() const
{
<%- if @setting.hasInspectorOverride? -%>
- if (UNLIKELY(m_<%= @setting.name %>InspectorOverride)) {
+ if (UNLIKELY(m_values.<%= @setting.name %>InspectorOverride)) {
ASSERT(InspectorInstrumentation::hasFrontends());
- return m_<%= @setting.name %>InspectorOverride.value();
+ return m_values.<%= @setting.name %>InspectorOverride.value();
}
<%- end -%>
- return m_<%= @setting.name %>;
+ return m_values.<%= @setting.name %>;
}
<%- end -%>
@@ -121,9 +160,9 @@
<%- for @setting in @condition.settingsWithComplexSettersNeedingImplementation -%>
void Settings::<%= @setting.setterFunctionName %>(<%= @setting.parameterType %> <%= @setting.name %>)
{
- if (m_<%= @setting.name %> == <%= @setting.name %>)
+ if (m_values.<%= @setting.name %> == <%= @setting.name %>)
return;
- m_<%= @setting.name %> = <%= @setting.name %>;
+ m_values.<%= @setting.name %> = <%= @setting.name %>;
<%= @setting.onChange %>();
}
<%- end -%>
@@ -137,9 +176,9 @@
<%- if @setting.hasComplexSetter? -%>
void Settings::<%= @setting.setterFunctionName %>InspectorOverride(Optional<<%= @setting.parameterType %>> <%= @setting.name %>InspectorOverride)
{
- if (m_<%= @setting.name %>InspectorOverride == <%= @setting.name %>InspectorOverride)
+ if (m_values.<%= @setting.name %>InspectorOverride == <%= @setting.name %>InspectorOverride)
return;
- m_<%= @setting.name %>InspectorOverride = <%= @setting.name %>InspectorOverride;
+ m_values.<%= @setting.name %>InspectorOverride = <%= @setting.name %>InspectorOverride;
<%- if @setting.condition -%>
#if <%= @setting.condition %>
<%- end -%>
Modified: trunk/Source/WebCore/Scripts/SettingsTemplates/Settings.h.erb (270761 => 270762)
--- trunk/Source/WebCore/Scripts/SettingsTemplates/Settings.h.erb 2020-12-14 05:19:33 UTC (rev 270761)
+++ trunk/Source/WebCore/Scripts/SettingsTemplates/Settings.h.erb 2020-12-14 09:43:55 UTC (rev 270762)
@@ -48,12 +48,12 @@
<%- if @setting.hasComplexGetter? -%>
WEBCORE_EXPORT <%= @setting.parameterType %> <%= @setting.getterFunctionName %>() const;
<%- else -%>
- <%= @setting.parameterType %> <%= @setting.getterFunctionName %>() const { return m_<%= @setting.name %>; }
+ <%= @setting.parameterType %> <%= @setting.getterFunctionName %>() const { return m_values.<%= @setting.name %>; }
<%- end -%>
<%- if @setting.hasComplexSetter? -%>
WEBCORE_EXPORT void <%= @setting.setterFunctionName %>(<%= @setting.parameterType %>);
<%- else -%>
- void <%= @setting.setterFunctionName %>(<%= @setting.parameterType %> <%= @setting.name %>) { m_<%= @setting.name %> = <%= @setting.name %>; }
+ void <%= @setting.setterFunctionName %>(<%= @setting.parameterType %> <%= @setting.name %>) { m_values.<%= @setting.name %> = <%= @setting.name %>; }
<%- end -%>
<%- end -%>
<%- if @condition.condition -%>
@@ -65,15 +65,16 @@
<%- if @setting.hasComplexSetter? -%>
WEBCORE_EXPORT void <%= @setting.setterFunctionName %>InspectorOverride(Optional<<%= @setting.parameterType %>>);
<%- else -%>
- void <%= @setting.setterFunctionName %>InspectorOverride(Optional<<%= @setting.parameterType %>> <%= @setting.name %>InspectorOverride) { m_<%= @setting.name %>InspectorOverride = <%= @setting.name %>InspectorOverride; }
+ void <%= @setting.setterFunctionName %>InspectorOverride(Optional<<%= @setting.parameterType %>> <%= @setting.name %>InspectorOverride) { m_values.<%= @setting.name %>InspectorOverride = <%= @setting.name %>InspectorOverride; }
<%- end -%>
<%- end -%>
-private:
- WEBCORE_EXPORT explicit Settings(Page*);
+ struct Values {
+ void initialize();
+ Values isolatedCopy() const;
<%- for @setting in @allSettingsSet.inspectorOverrideSettings do -%>
- Optional<<%= @setting.type %>> m_<%= @setting.name %>InspectorOverride;
+ Optional<<%= @setting.type %>> <%= @setting.name %>InspectorOverride;
<%- end -%>
<%- for @condition in @allSettingsSet.conditions do -%>
@@ -82,7 +83,7 @@
#if <%= @condition.condition %>
<%- end -%>
<%- for @setting in @condition.nonBoolSettingsNeedingImplementation -%>
- <%= @setting.type %> m_<%= @setting.name %>;
+ <%= @setting.type %> <%= @setting.name %>;
<%- end -%>
<%- if @condition.condition -%>
#endif
@@ -89,21 +90,26 @@
<%- end -%>
<%- end -%>
<%- end -%>
-
<%- for @condition in @allSettingsSet.conditions do -%>
-<%- if @condition.boolSettingsNeedingImplementation.length != 0 -%>
-<%- if @condition.condition -%>
+ <%- if @condition.settingsNeedingImplementation.length != 0 -%>
+ <%- if @condition.condition -%>
#if <%= @condition.condition %>
-<%- end -%>
-<%- for @setting in @condition.boolSettingsNeedingImplementation -%>
- <%= @setting.type %> m_<%= @setting.name %> : 1;
-<%- end -%>
-<%- if @condition.condition -%>
+ <%- end -%>
+ <%- for @setting in @condition.boolSettingsNeedingImplementation -%>
+ <%= @setting.type %> <%= @setting.name %> : 1;
+ <%- end -%>
+ <%- if @condition.condition -%>
#endif
+ <%- end -%>
+ <%- end -%>
<%- end -%>
-<%- end -%>
-<%- end -%>
+ };
+ const Values& values() const { return m_values; }
+private:
+ WEBCORE_EXPORT explicit Settings(Page*);
+
+ Values m_values;
};
}
Modified: trunk/Source/WebCore/dom/Document.h (270761 => 270762)
--- trunk/Source/WebCore/dom/Document.h 2020-12-14 05:19:33 UTC (rev 270761)
+++ trunk/Source/WebCore/dom/Document.h 2020-12-14 09:43:55 UTC (rev 270762)
@@ -624,6 +624,8 @@
void resumeActiveDOMObjects(ReasonForSuspension) final;
void stopActiveDOMObjects() final;
+ const Settings::Values& settingsValues() const final { return settings().values(); }
+
void suspendDeviceMotionAndOrientationUpdates();
void resumeDeviceMotionAndOrientationUpdates();
Modified: trunk/Source/WebCore/dom/EmptyScriptExecutionContext.h (270761 => 270762)
--- trunk/Source/WebCore/dom/EmptyScriptExecutionContext.h 2020-12-14 05:19:33 UTC (rev 270761)
+++ trunk/Source/WebCore/dom/EmptyScriptExecutionContext.h 2020-12-14 09:43:55 UTC (rev 270762)
@@ -94,6 +94,8 @@
void refScriptExecutionContext() final { ref(); };
void derefScriptExecutionContext() final { deref(); };
+ const Settings::Values& settingsValues() const final { return m_settingsValues; }
+
class EmptyEventLoop final : public EventLoop {
public:
static Ref<EmptyEventLoop> create(JSC::VM& vm)
@@ -104,7 +106,7 @@
MicrotaskQueue& microtaskQueue() final { return m_queue; };
private:
- EmptyEventLoop(JSC::VM& vm)
+ explicit EmptyEventLoop(JSC::VM& vm)
: m_queue(MicrotaskQueue(vm))
{
}
@@ -120,6 +122,7 @@
URL m_url;
Ref<EmptyEventLoop> m_eventLoop;
std::unique_ptr<EventLoopTaskGroup> m_eventLoopTaskGroup;
+ Settings::Values m_settingsValues;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/dom/ScriptExecutionContext.h (270761 => 270762)
--- trunk/Source/WebCore/dom/ScriptExecutionContext.h 2020-12-14 05:19:33 UTC (rev 270761)
+++ trunk/Source/WebCore/dom/ScriptExecutionContext.h 2020-12-14 09:43:55 UTC (rev 270762)
@@ -31,6 +31,7 @@
#include "DOMTimer.h"
#include "SecurityContext.h"
#include "ServiceWorkerTypes.h"
+#include "Settings.h"
#include <_javascript_Core/ConsoleTypes.h>
#include <_javascript_Core/HandleTypes.h>
#include <wtf/CrossThreadTask.h>
@@ -103,6 +104,8 @@
virtual ReferrerPolicy referrerPolicy() const = 0;
+ virtual const Settings::Values& settingsValues() const = 0;
+
virtual void disableEval(const String& errorMessage) = 0;
virtual void disableWebAssembly(const String& errorMessage) = 0;
Modified: trunk/Source/WebCore/page/Settings.yaml (270761 => 270762)
--- trunk/Source/WebCore/page/Settings.yaml 2020-12-14 05:19:33 UTC (rev 270761)
+++ trunk/Source/WebCore/page/Settings.yaml 2020-12-14 09:43:55 UTC (rev 270762)
@@ -102,7 +102,7 @@
type: String
defaultValue:
WebCore:
- default:
+ default: '{ }'
DisableScreenSizeOverride:
type: bool
@@ -304,7 +304,7 @@
refinedType: JSC::RuntimeFlags
defaultValue:
WebCore:
- default:
+ default: '{ }'
LangAttributeAwareFormControlUIEnabled:
type: bool
@@ -324,7 +324,7 @@
type: String
defaultValue:
WebCore:
- default:
+ default: '{ }'
MaximumAccelerated2dCanvasSize:
type: uint32_t
@@ -353,13 +353,13 @@
condition: ENABLE(MEDIA_STREAM)
defaultValue:
WebCore:
- default:
+ default: '{ }'
MediaKeysStorageDirectory:
type: String
defaultValue:
WebCore:
- default:
+ default: '{ }'
MediaTypeOverride:
type: String
@@ -579,7 +579,7 @@
webcoreOnChange: userStyleSheetLocationChanged
defaultValue:
WebCore:
- default:
+ default: '{ }'
ValidationMessageTimerMagnification:
comment: >-
Modified: trunk/Source/WebCore/workers/WorkerGlobalScope.cpp (270761 => 270762)
--- trunk/Source/WebCore/workers/WorkerGlobalScope.cpp 2020-12-14 05:19:33 UTC (rev 270761)
+++ trunk/Source/WebCore/workers/WorkerGlobalScope.cpp 2020-12-14 09:43:55 UTC (rev 270762)
@@ -73,9 +73,7 @@
, m_socketProvider(socketProvider)
, m_performance(Performance::create(this, params.timeOrigin))
, m_referrerPolicy(params.referrerPolicy)
- , m_requestAnimationFrameEnabled(params.requestAnimationFrameEnabled)
- , m_acceleratedCompositingEnabled(params.acceleratedCompositingEnabled)
- , m_webGLEnabled(params.webGLEnabled)
+ , m_settingsValues(params.settingsValues)
{
#if !ENABLE(INDEXED_DATABASE)
UNUSED_PARAM(connectionProxy);
Modified: trunk/Source/WebCore/workers/WorkerGlobalScope.h (270761 => 270762)
--- trunk/Source/WebCore/workers/WorkerGlobalScope.h 2020-12-14 05:19:33 UTC (rev 270761)
+++ trunk/Source/WebCore/workers/WorkerGlobalScope.h 2020-12-14 09:43:55 UTC (rev 270762)
@@ -121,9 +121,9 @@
ReferrerPolicy referrerPolicy() const final;
- bool requestAnimationFrameEnabled() const { return m_requestAnimationFrameEnabled; }
- bool acceleratedCompositingEnabled() const { return m_acceleratedCompositingEnabled; }
- bool webGLEnabled() const { return m_webGLEnabled; }
+ bool requestAnimationFrameEnabled() const { return m_settingsValues.requestAnimationFrameEnabled; }
+ bool acceleratedCompositingEnabled() const { return m_settingsValues.acceleratedCompositingEnabled; }
+ bool webGLEnabled() const { return m_settingsValues.webGLEnabled; }
protected:
WorkerGlobalScope(WorkerThreadType, const WorkerParameters&, Ref<SecurityOrigin>&&, WorkerThread&, Ref<SecurityOrigin>&& topOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*);
@@ -142,6 +142,8 @@
URL completeURL(const String&, ForceUTF8 = ForceUTF8::No) const final;
String userAgent(const URL&) const final;
+ const Settings::Values& settingsValues() const final { return m_settingsValues; }
+
EventTarget* errorEventTarget() final;
String resourceRequestIdentifier() const final { return m_identifier; }
SocketProvider* socketProvider() final;
@@ -187,9 +189,7 @@
#endif
std::unique_ptr<CSSValuePool> m_cssValuePool;
ReferrerPolicy m_referrerPolicy;
- bool m_requestAnimationFrameEnabled;
- bool m_acceleratedCompositingEnabled;
- bool m_webGLEnabled;
+ Settings::Values m_settingsValues;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp (270761 => 270762)
--- trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp 2020-12-14 05:19:33 UTC (rev 270761)
+++ trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp 2020-12-14 09:43:55 UTC (rev 270762)
@@ -89,7 +89,7 @@
SocketProvider* socketProvider = document.socketProvider();
- WorkerParameters params = { scriptURL, name, identifier, userAgent, isOnline, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, timeOrigin, referrerPolicy, document.settings().requestAnimationFrameEnabled(), document.settings().acceleratedCompositingEnabled(), document.settings().webGLEnabled() };
+ WorkerParameters params = { scriptURL, name, identifier, userAgent, isOnline, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, timeOrigin, referrerPolicy, document.settingsValues() };
auto thread = DedicatedWorkerThread::create(params, sourceCode, *this, *this, *this, startMode, document.topOrigin(), proxy, socketProvider, runtimeFlags);
workerThreadCreated(thread.get());
Modified: trunk/Source/WebCore/workers/WorkerThread.cpp (270761 => 270762)
--- trunk/Source/WebCore/workers/WorkerThread.cpp 2020-12-14 05:19:33 UTC (rev 270761)
+++ trunk/Source/WebCore/workers/WorkerThread.cpp 2020-12-14 09:43:55 UTC (rev 270762)
@@ -55,9 +55,7 @@
shouldBypassMainWorldContentSecurityPolicy,
timeOrigin,
referrerPolicy,
- requestAnimationFrameEnabled,
- acceleratedCompositingEnabled,
- webGLEnabled,
+ settingsValues.isolatedCopy()
};
}
Modified: trunk/Source/WebCore/workers/WorkerThread.h (270761 => 270762)
--- trunk/Source/WebCore/workers/WorkerThread.h 2020-12-14 05:19:33 UTC (rev 270761)
+++ trunk/Source/WebCore/workers/WorkerThread.h 2020-12-14 09:43:55 UTC (rev 270762)
@@ -63,9 +63,7 @@
bool shouldBypassMainWorldContentSecurityPolicy;
MonotonicTime timeOrigin;
ReferrerPolicy referrerPolicy;
- bool requestAnimationFrameEnabled;
- bool acceleratedCompositingEnabled;
- bool webGLEnabled;
+ Settings::Values settingsValues;
WorkerParameters isolatedCopy() const;
};
Modified: trunk/Source/WebCore/workers/service/context/ServiceWorkerThread.cpp (270761 => 270762)
--- trunk/Source/WebCore/workers/service/context/ServiceWorkerThread.cpp 2020-12-14 05:19:33 UTC (rev 270761)
+++ trunk/Source/WebCore/workers/service/context/ServiceWorkerThread.cpp 2020-12-14 09:43:55 UTC (rev 270762)
@@ -73,8 +73,8 @@
// FIXME: Use a valid WorkerObjectProxy
// FIXME: Use valid runtime flags
-ServiceWorkerThread::ServiceWorkerThread(const ServiceWorkerContextData& data, String&& userAgent, WorkerLoaderProxy& loaderProxy, WorkerDebuggerProxy& debuggerProxy, IDBClient::IDBConnectionProxy* idbConnectionProxy, SocketProvider* socketProvider)
- : WorkerThread({ data.scriptURL, emptyString(), "serviceworker:" + Inspector::IdentifiersFactory::createIdentifier(), WTFMove(userAgent), platformStrategies()->loaderStrategy()->isOnLine(), data.contentSecurityPolicy, false, MonotonicTime::now(), { }, true, true, true }, data.script, loaderProxy, debuggerProxy, DummyServiceWorkerThreadProxy::shared(), WorkerThreadStartMode::Normal, data.registration.key.topOrigin().securityOrigin().get(), idbConnectionProxy, socketProvider, JSC::RuntimeFlags::createAllEnabled())
+ServiceWorkerThread::ServiceWorkerThread(const ServiceWorkerContextData& data, String&& userAgent, const Settings::Values& settingsValues, WorkerLoaderProxy& loaderProxy, WorkerDebuggerProxy& debuggerProxy, IDBClient::IDBConnectionProxy* idbConnectionProxy, SocketProvider* socketProvider)
+ : WorkerThread({ data.scriptURL, emptyString(), "serviceworker:" + Inspector::IdentifiersFactory::createIdentifier(), WTFMove(userAgent), platformStrategies()->loaderStrategy()->isOnLine(), data.contentSecurityPolicy, false, MonotonicTime::now(), { }, settingsValues }, data.script, loaderProxy, debuggerProxy, DummyServiceWorkerThreadProxy::shared(), WorkerThreadStartMode::Normal, data.registration.key.topOrigin().securityOrigin().get(), idbConnectionProxy, socketProvider, JSC::RuntimeFlags::createAllEnabled())
, m_data(data.isolatedCopy())
, m_workerObjectProxy(DummyServiceWorkerThreadProxy::shared())
, m_heartBeatTimeout(SWContextManager::singleton().connection()->shouldUseShortTimeout() ? heartBeatTimeoutForTest : heartBeatTimeout)
Modified: trunk/Source/WebCore/workers/service/context/ServiceWorkerThread.h (270761 => 270762)
--- trunk/Source/WebCore/workers/service/context/ServiceWorkerThread.h 2020-12-14 05:19:33 UTC (rev 270761)
+++ trunk/Source/WebCore/workers/service/context/ServiceWorkerThread.h 2020-12-14 09:43:55 UTC (rev 270762)
@@ -30,6 +30,7 @@
#include "ServiceWorkerContextData.h"
#include "ServiceWorkerFetch.h"
#include "ServiceWorkerIdentifier.h"
+#include "Settings.h"
#include "Timer.h"
#include "WorkerThread.h"
#include <wtf/WeakPtr.h>
@@ -79,7 +80,7 @@
void runEventLoop() override;
private:
- WEBCORE_EXPORT ServiceWorkerThread(const ServiceWorkerContextData&, String&& userAgent, WorkerLoaderProxy&, WorkerDebuggerProxy&, IDBClient::IDBConnectionProxy*, SocketProvider*);
+ WEBCORE_EXPORT ServiceWorkerThread(const ServiceWorkerContextData&, String&& userAgent, const Settings::Values&, WorkerLoaderProxy&, WorkerDebuggerProxy&, IDBClient::IDBConnectionProxy*, SocketProvider*);
bool isServiceWorkerThread() const final { return true; }
void finishedEvaluatingScript() final;
Modified: trunk/Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp (270761 => 270762)
--- trunk/Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp 2020-12-14 05:19:33 UTC (rev 270761)
+++ trunk/Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp 2020-12-14 09:43:55 UTC (rev 270762)
@@ -97,7 +97,7 @@
ServiceWorkerThreadProxy::ServiceWorkerThreadProxy(PageConfiguration&& pageConfiguration, const ServiceWorkerContextData& data, String&& userAgent, CacheStorageProvider& cacheStorageProvider, StorageBlockingPolicy storageBlockingPolicy)
: m_page(createPageForServiceWorker(WTFMove(pageConfiguration), data, storageBlockingPolicy))
, m_document(*m_page->mainFrame().document())
- , m_serviceWorkerThread(ServiceWorkerThread::create(data, WTFMove(userAgent), *this, *this, idbConnectionProxy(m_document), m_document->socketProvider()))
+ , m_serviceWorkerThread(ServiceWorkerThread::create(data, WTFMove(userAgent), m_document->settingsValues(), *this, *this, idbConnectionProxy(m_document), m_document->socketProvider()))
, m_cacheStorageProvider(cacheStorageProvider)
, m_inspectorProxy(*this)
{
Modified: trunk/Source/WebCore/worklets/WorkletGlobalScope.cpp (270761 => 270762)
--- trunk/Source/WebCore/worklets/WorkletGlobalScope.cpp 2020-12-14 05:19:33 UTC (rev 270761)
+++ trunk/Source/WebCore/worklets/WorkletGlobalScope.cpp 2020-12-14 09:43:55 UTC (rev 270762)
@@ -54,6 +54,7 @@
, m_topOrigin(SecurityOrigin::createUnique())
, m_url(parameters.windowURL)
, m_jsRuntimeFlags(parameters.jsRuntimeFlags)
+ , m_settingsValues(parameters.settingsValues)
{
++gNumberOfWorkletGlobalScopes;
@@ -68,6 +69,7 @@
, m_url(code.url())
, m_jsRuntimeFlags(document.settings()._javascript_RuntimeFlags())
, m_code(WTFMove(code))
+ , m_settingsValues(document.settingsValues().isolatedCopy())
{
++gNumberOfWorkletGlobalScopes;
Modified: trunk/Source/WebCore/worklets/WorkletGlobalScope.h (270761 => 270762)
--- trunk/Source/WebCore/worklets/WorkletGlobalScope.h 2020-12-14 05:19:33 UTC (rev 270761)
+++ trunk/Source/WebCore/worklets/WorkletGlobalScope.h 2020-12-14 09:43:55 UTC (rev 270762)
@@ -123,6 +123,7 @@
#endif
URL completeURL(const String&, ForceUTF8 = ForceUTF8::No) const final;
String userAgent(const URL&) const final;
+ const Settings::Values& settingsValues() const final { return m_settingsValues; }
struct ScriptFetchJob {
URL moduleURL;
@@ -146,6 +147,7 @@
RefPtr<WorkerScriptLoader> m_scriptLoader;
Deque<ScriptFetchJob> m_scriptFetchJobs;
HashSet<URL> m_evaluatedModules;
+ Settings::Values m_settingsValues;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/worklets/WorkletParameters.h (270761 => 270762)
--- trunk/Source/WebCore/worklets/WorkletParameters.h 2020-12-14 05:19:33 UTC (rev 270761)
+++ trunk/Source/WebCore/worklets/WorkletParameters.h 2020-12-14 09:43:55 UTC (rev 270762)
@@ -25,6 +25,7 @@
#pragma once
+#include "Settings.h"
#include <_javascript_Core/RuntimeFlags.h>
#include <wtf/URL.h>
@@ -35,6 +36,7 @@
JSC::RuntimeFlags jsRuntimeFlags;
float sampleRate;
String identifier;
+ Settings::Values settingsValues;
WorkletParameters isolatedCopy() const
{
@@ -42,7 +44,8 @@
windowURL.isolatedCopy(),
jsRuntimeFlags,
sampleRate,
- identifier.isolatedCopy()
+ identifier.isolatedCopy(),
+ settingsValues.isolatedCopy()
};
}
};