Diff
Modified: trunk/LayoutTests/ChangeLog (235154 => 235155)
--- trunk/LayoutTests/ChangeLog 2018-08-22 02:04:00 UTC (rev 235154)
+++ trunk/LayoutTests/ChangeLog 2018-08-22 02:22:41 UTC (rev 235155)
@@ -1,3 +1,15 @@
+2018-08-21 Ryan Haddad <[email protected]>
+
+ Unreviewed, rolling out r235128.
+
+ The test added with this change is frequently failing.
+
+ Reverted changeset:
+
+ "Support "name" option for dedicated workers"
+ https://bugs.webkit.org/show_bug.cgi?id=188779
+ https://trac.webkit.org/changeset/235128
+
2018-08-21 Megan Gardner <[email protected]>
Change Selection modification to not snap the grabber when selecting above or below the selection anchor
Deleted: trunk/LayoutTests/http/wpt/workers/name-property-enhanced-expected.txt (235154 => 235155)
--- trunk/LayoutTests/http/wpt/workers/name-property-enhanced-expected.txt 2018-08-22 02:04:00 UTC (rev 235154)
+++ trunk/LayoutTests/http/wpt/workers/name-property-enhanced-expected.txt 2018-08-22 02:22:41 UTC (rev 235155)
@@ -1,8 +0,0 @@
-
-Harness Error (FAIL), message = 2 duplicate test names: "name property value for DedicatedWorkerGlobalScope", "name property is replaceable for DedicatedWorkerGlobalScope"
-
-PASS name property value for DedicatedWorkerGlobalScope
-PASS name property is replaceable for DedicatedWorkerGlobalScope
-PASS name property value for DedicatedWorkerGlobalScope
-PASS name property is replaceable for DedicatedWorkerGlobalScope
-
Deleted: trunk/LayoutTests/http/wpt/workers/name-property-enhanced.html (235154 => 235155)
--- trunk/LayoutTests/http/wpt/workers/name-property-enhanced.html 2018-08-22 02:04:00 UTC (rev 235154)
+++ trunk/LayoutTests/http/wpt/workers/name-property-enhanced.html 2018-08-22 02:22:41 UTC (rev 235155)
@@ -1,20 +0,0 @@
-<!DOCTYPE html>
-<meta charset="utf-8">
-<title>Test the name property of shared and dedicated workers via the name constructor option</title>
-<link rel="help" href=""
-<link rel="help" href=""
-<link rel="help" href=""
-<link rel="author" title="Domenic Denicola" href=""
-<link rel="author" title="Yusuke Suzuki" href=""
-<script src=""
-<script src=""
-
-<script>
-"use strict";
-
-const worker = new Worker("support/no-name.js");
-fetch_tests_from_worker(worker);
-
-const worker2 = new Worker("support/name.js", { name: "my name" });
-fetch_tests_from_worker(worker2);
-</script>
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (235154 => 235155)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2018-08-22 02:04:00 UTC (rev 235154)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2018-08-22 02:22:41 UTC (rev 235155)
@@ -1,3 +1,15 @@
+2018-08-21 Ryan Haddad <[email protected]>
+
+ Unreviewed, rolling out r235128.
+
+ The test added with this change is frequently failing.
+
+ Reverted changeset:
+
+ "Support "name" option for dedicated workers"
+ https://bugs.webkit.org/show_bug.cgi?id=188779
+ https://trac.webkit.org/changeset/235128
+
2018-08-21 Yusuke Suzuki <[email protected]>
Support "name" option for dedicated workers
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/workers/interfaces.worker-expected.txt (235154 => 235155)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/workers/interfaces.worker-expected.txt 2018-08-22 02:04:00 UTC (rev 235154)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/workers/interfaces.worker-expected.txt 2018-08-22 02:22:41 UTC (rev 235155)
@@ -68,7 +68,7 @@
PASS DedicatedWorkerGlobalScope interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to its original value via Reflect.setPrototypeOf should return true
PASS DedicatedWorkerGlobalScope interface: existence and properties of interface prototype object's "constructor" property
PASS DedicatedWorkerGlobalScope interface: existence and properties of interface prototype object's @@unscopables property
-PASS DedicatedWorkerGlobalScope interface: attribute name
+FAIL DedicatedWorkerGlobalScope interface: attribute name assert_own_property: The global object must have a property "name" expected property "name" missing
PASS Unscopable handled correctly for name property on DedicatedWorkerGlobalScope
PASS DedicatedWorkerGlobalScope interface: operation postMessage(any, [object Object])
PASS Unscopable handled correctly for postMessage(any, [object Object]) on DedicatedWorkerGlobalScope
@@ -86,7 +86,7 @@
PASS DedicatedWorkerGlobalScope interface: internal [[SetPrototypeOf]] method of global platform object - setting to its original value via Reflect.setPrototypeOf should return true
PASS DedicatedWorkerGlobalScope must be primary interface of self
PASS Stringification of self
-PASS DedicatedWorkerGlobalScope interface: self must inherit property "name" with the proper type
+FAIL DedicatedWorkerGlobalScope interface: self must inherit property "name" with the proper type assert_own_property: expected property "name" missing
PASS DedicatedWorkerGlobalScope interface: self must inherit property "postMessage(any, [object Object])" with the proper type
PASS DedicatedWorkerGlobalScope interface: calling postMessage(any, [object Object]) on self with too few arguments must throw TypeError
PASS DedicatedWorkerGlobalScope interface: self must inherit property "close()" with the proper type
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/workers/name-property-expected.txt (235154 => 235155)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/workers/name-property-expected.txt 2018-08-22 02:04:00 UTC (rev 235154)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/workers/name-property-expected.txt 2018-08-22 02:22:41 UTC (rev 235155)
@@ -1,7 +1,7 @@
CONSOLE MESSAGE: line 20: ReferenceError: Can't find variable: SharedWorker
FAIL Test the name property of shared and dedicated workers via the name constructor option ReferenceError: Can't find variable: SharedWorker
-PASS name property value for DedicatedWorkerGlobalScope
+PASS Declaring name as an accidental global must not cause a harness error for DedicatedWorkerGlobalScope
+FAIL name property value for DedicatedWorkerGlobalScope assert_true: property exists on the global expected true got false
PASS name property is replaceable for DedicatedWorkerGlobalScope
-PASS Declaring name as an accidental global must not cause a harness error for DedicatedWorkerGlobalScope
Modified: trunk/Source/WebCore/ChangeLog (235154 => 235155)
--- trunk/Source/WebCore/ChangeLog 2018-08-22 02:04:00 UTC (rev 235154)
+++ trunk/Source/WebCore/ChangeLog 2018-08-22 02:22:41 UTC (rev 235155)
@@ -1,3 +1,15 @@
+2018-08-21 Ryan Haddad <[email protected]>
+
+ Unreviewed, rolling out r235128.
+
+ The test added with this change is frequently failing.
+
+ Reverted changeset:
+
+ "Support "name" option for dedicated workers"
+ https://bugs.webkit.org/show_bug.cgi?id=188779
+ https://trac.webkit.org/changeset/235128
+
2018-08-21 Commit Queue <[email protected]>
Unreviewed, rolling out r235107.
Modified: trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.cpp (235154 => 235155)
--- trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.cpp 2018-08-22 02:04:00 UTC (rev 235154)
+++ trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.cpp 2018-08-22 02:22:41 UTC (rev 235155)
@@ -41,17 +41,16 @@
namespace WebCore {
-Ref<DedicatedWorkerGlobalScope> DedicatedWorkerGlobalScope::create(const URL& url, Ref<SecurityOrigin>&& origin, const String& name, const String& identifier, const String& userAgent, bool isOnline, DedicatedWorkerThread& thread, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& topOrigin, MonotonicTime timeOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider, PAL::SessionID sessionID)
+Ref<DedicatedWorkerGlobalScope> DedicatedWorkerGlobalScope::create(const URL& url, Ref<SecurityOrigin>&& origin, const String& identifier, const String& userAgent, bool isOnline, DedicatedWorkerThread& thread, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& topOrigin, MonotonicTime timeOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider, PAL::SessionID sessionID)
{
- auto context = adoptRef(*new DedicatedWorkerGlobalScope(url, WTFMove(origin), name, identifier, userAgent, isOnline, thread, shouldBypassMainWorldContentSecurityPolicy, WTFMove(topOrigin), timeOrigin, connectionProxy, socketProvider, sessionID));
+ auto context = adoptRef(*new DedicatedWorkerGlobalScope(url, WTFMove(origin), identifier, userAgent, isOnline, thread, shouldBypassMainWorldContentSecurityPolicy, WTFMove(topOrigin), timeOrigin, connectionProxy, socketProvider, sessionID));
if (!shouldBypassMainWorldContentSecurityPolicy)
context->applyContentSecurityPolicyResponseHeaders(contentSecurityPolicyResponseHeaders);
return context;
}
-DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope(const URL& url, Ref<SecurityOrigin>&& origin, const String& name, const String& identifier, const String& userAgent, bool isOnline, DedicatedWorkerThread& thread, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& topOrigin, MonotonicTime timeOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider, PAL::SessionID sessionID)
+DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope(const URL& url, Ref<SecurityOrigin>&& origin, const String& identifier, const String& userAgent, bool isOnline, DedicatedWorkerThread& thread, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& topOrigin, MonotonicTime timeOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider, PAL::SessionID sessionID)
: WorkerGlobalScope(url, WTFMove(origin), identifier, userAgent, isOnline, thread, shouldBypassMainWorldContentSecurityPolicy, WTFMove(topOrigin), timeOrigin, connectionProxy, socketProvider, sessionID)
- , m_name(name)
{
}
Modified: trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.h (235154 => 235155)
--- trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.h 2018-08-22 02:04:00 UTC (rev 235154)
+++ trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.h 2018-08-22 02:22:41 UTC (rev 235155)
@@ -48,11 +48,9 @@
class DedicatedWorkerGlobalScope final : public WorkerGlobalScope {
public:
- static Ref<DedicatedWorkerGlobalScope> create(const URL&, Ref<SecurityOrigin>&&, const String& name, const String& identifier, const String& userAgent, bool isOnline, DedicatedWorkerThread&, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& topOrigin, MonotonicTime timeOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*, PAL::SessionID);
+ static Ref<DedicatedWorkerGlobalScope> create(const URL&, Ref<SecurityOrigin>&&, const String& identifier, const String& userAgent, bool isOnline, DedicatedWorkerThread&, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& topOrigin, MonotonicTime timeOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*, PAL::SessionID);
virtual ~DedicatedWorkerGlobalScope();
- const String& name() const { return m_name; }
-
ExceptionOr<void> postMessage(JSC::ExecState&, JSC::JSValue message, Vector<JSC::Strong<JSC::JSObject>>&&);
DedicatedWorkerThread& thread();
@@ -60,13 +58,11 @@
private:
using Base = WorkerGlobalScope;
- DedicatedWorkerGlobalScope(const URL&, Ref<SecurityOrigin>&&, const String& name, const String& identifier, const String& userAgent, bool isOnline, DedicatedWorkerThread&, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& topOrigin, MonotonicTime timeOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*, PAL::SessionID);
+ DedicatedWorkerGlobalScope(const URL&, Ref<SecurityOrigin>&&, const String& identifier, const String& userAgent, bool isOnline, DedicatedWorkerThread&, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& topOrigin, MonotonicTime timeOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*, PAL::SessionID);
bool isDedicatedWorkerGlobalScope() const final { return true; }
ExceptionOr<void> importScripts(const Vector<String>& urls) final;
EventTargetInterface eventTargetInterface() const final;
-
- String m_name;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.idl (235154 => 235155)
--- trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.idl 2018-08-22 02:04:00 UTC (rev 235154)
+++ trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.idl 2018-08-22 02:22:41 UTC (rev 235155)
@@ -37,8 +37,6 @@
IsImmutablePrototypeExoticObject,
IsImmutablePrototypeExoticObjectOnPrototype,
] interface DedicatedWorkerGlobalScope : WorkerGlobalScope {
- [Replaceable] readonly attribute DOMString name;
-
[CallWith=ScriptState, MayThrowException] void postMessage(any message, optional sequence<object> transfer = []);
void close();
Modified: trunk/Source/WebCore/workers/DedicatedWorkerThread.cpp (235154 => 235155)
--- trunk/Source/WebCore/workers/DedicatedWorkerThread.cpp 2018-08-22 02:04:00 UTC (rev 235154)
+++ trunk/Source/WebCore/workers/DedicatedWorkerThread.cpp 2018-08-22 02:22:41 UTC (rev 235155)
@@ -38,8 +38,8 @@
namespace WebCore {
-DedicatedWorkerThread::DedicatedWorkerThread(const URL& url, const String& name, const String& identifier, const String& userAgent, bool isOnline, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerDebuggerProxy& workerDebuggerProxy, WorkerObjectProxy& workerObjectProxy, WorkerThreadStartMode startMode, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin& topOrigin, MonotonicTime timeOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider, JSC::RuntimeFlags runtimeFlags, PAL::SessionID sessionID)
- : WorkerThread(url, name, identifier, userAgent, isOnline, sourceCode, workerLoaderProxy, workerDebuggerProxy, workerObjectProxy, startMode, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, topOrigin, timeOrigin, connectionProxy, socketProvider, runtimeFlags, sessionID)
+DedicatedWorkerThread::DedicatedWorkerThread(const URL& url, const String& identifier, const String& userAgent, bool isOnline, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerDebuggerProxy& workerDebuggerProxy, WorkerObjectProxy& workerObjectProxy, WorkerThreadStartMode startMode, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin& topOrigin, MonotonicTime timeOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider, JSC::RuntimeFlags runtimeFlags, PAL::SessionID sessionID)
+ : WorkerThread(url, identifier, userAgent, isOnline, sourceCode, workerLoaderProxy, workerDebuggerProxy, workerObjectProxy, startMode, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, topOrigin, timeOrigin, connectionProxy, socketProvider, runtimeFlags, sessionID)
, m_workerObjectProxy(workerObjectProxy)
{
}
@@ -46,9 +46,9 @@
DedicatedWorkerThread::~DedicatedWorkerThread() = default;
-Ref<WorkerGlobalScope> DedicatedWorkerThread::createWorkerGlobalScope(const URL& url, Ref<SecurityOrigin>&& origin, const String& name, const String& identifier, const String& userAgent, bool isOnline, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& topOrigin, MonotonicTime timeOrigin, PAL::SessionID sessionID)
+Ref<WorkerGlobalScope> DedicatedWorkerThread::createWorkerGlobalScope(const URL& url, Ref<SecurityOrigin>&& origin, const String& identifier, const String& userAgent, bool isOnline, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& topOrigin, MonotonicTime timeOrigin, PAL::SessionID sessionID)
{
- return DedicatedWorkerGlobalScope::create(url, WTFMove(origin), name, identifier, userAgent, isOnline, *this, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, WTFMove(topOrigin), timeOrigin, idbConnectionProxy(), socketProvider(), sessionID);
+ return DedicatedWorkerGlobalScope::create(url, WTFMove(origin), identifier, userAgent, isOnline, *this, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, WTFMove(topOrigin), timeOrigin, idbConnectionProxy(), socketProvider(), sessionID);
}
void DedicatedWorkerThread::runEventLoop()
Modified: trunk/Source/WebCore/workers/DedicatedWorkerThread.h (235154 => 235155)
--- trunk/Source/WebCore/workers/DedicatedWorkerThread.h 2018-08-22 02:04:00 UTC (rev 235154)
+++ trunk/Source/WebCore/workers/DedicatedWorkerThread.h 2018-08-22 02:22:41 UTC (rev 235155)
@@ -49,11 +49,11 @@
WorkerObjectProxy& workerObjectProxy() const { return m_workerObjectProxy; }
protected:
- Ref<WorkerGlobalScope> createWorkerGlobalScope(const URL&, Ref<SecurityOrigin>&&, const String& name, const String& identifier, const String& userAgent, bool isOnline, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& topOrigin, MonotonicTime timeOrigin, PAL::SessionID) override;
+ Ref<WorkerGlobalScope> createWorkerGlobalScope(const URL&, Ref<SecurityOrigin>&&, const String& identifier, const String& userAgent, bool isOnline, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& topOrigin, MonotonicTime timeOrigin, PAL::SessionID) override;
void runEventLoop() override;
private:
- DedicatedWorkerThread(const URL&, const String& name, const String& identifier, const String& userAgent, bool isOnline, const String& sourceCode, WorkerLoaderProxy&, WorkerDebuggerProxy&, WorkerObjectProxy&, WorkerThreadStartMode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin& topOrigin, MonotonicTime timeOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*, JSC::RuntimeFlags, PAL::SessionID);
+ DedicatedWorkerThread(const URL&, const String& identifier, const String& userAgent, bool isOnline, const String& sourceCode, WorkerLoaderProxy&, WorkerDebuggerProxy&, WorkerObjectProxy&, WorkerThreadStartMode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin& topOrigin, MonotonicTime timeOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*, JSC::RuntimeFlags, PAL::SessionID);
WorkerObjectProxy& m_workerObjectProxy;
};
Modified: trunk/Source/WebCore/workers/Worker.cpp (235154 => 235155)
--- trunk/Source/WebCore/workers/Worker.cpp 2018-08-22 02:04:00 UTC (rev 235154)
+++ trunk/Source/WebCore/workers/Worker.cpp 2018-08-22 02:22:41 UTC (rev 235155)
@@ -57,9 +57,8 @@
worker->notifyNetworkStateChange(isOnLine);
}
-inline Worker::Worker(ScriptExecutionContext& context, JSC::RuntimeFlags runtimeFlags, const Options& options)
+inline Worker::Worker(ScriptExecutionContext& context, JSC::RuntimeFlags runtimeFlags)
: ActiveDOMObject(&context)
- , m_name(options.name)
, m_identifier("worker:" + Inspector::IdentifiersFactory::createIdentifier())
, m_contextProxy(WorkerGlobalScopeProxy::create(*this))
, m_runtimeFlags(runtimeFlags)
@@ -74,7 +73,7 @@
ASSERT_UNUSED(addResult, addResult.isNewEntry);
}
-ExceptionOr<Ref<Worker>> Worker::create(ScriptExecutionContext& context, JSC::RuntimeFlags runtimeFlags, const String& url, const Options& options)
+ExceptionOr<Ref<Worker>> Worker::create(ScriptExecutionContext& context, JSC::RuntimeFlags runtimeFlags, const String& url)
{
ASSERT(isMainThread());
@@ -81,7 +80,7 @@
// We don't currently support nested workers, so workers can only be created from documents.
ASSERT_WITH_SECURITY_IMPLICATION(context.isDocument());
- auto worker = adoptRef(*new Worker(context, runtimeFlags, options));
+ auto worker = adoptRef(*new Worker(context, runtimeFlags));
worker->suspendIfNeeded();
@@ -104,12 +103,12 @@
ResourceRequest request { scriptURL.releaseReturnValue() };
request.setInitiatorIdentifier(worker->m_identifier);
- FetchOptions fetchOptions;
- fetchOptions.mode = FetchOptions::Mode::SameOrigin;
- fetchOptions.cache = FetchOptions::Cache::Default;
- fetchOptions.redirect = FetchOptions::Redirect::Follow;
- fetchOptions.destination = FetchOptions::Destination::Worker;
- worker->m_scriptLoader->loadAsynchronously(context, WTFMove(request), WTFMove(fetchOptions), contentSecurityPolicyEnforcement, ServiceWorkersMode::All, worker);
+ FetchOptions options;
+ options.mode = FetchOptions::Mode::SameOrigin;
+ options.cache = FetchOptions::Cache::Default;
+ options.redirect = FetchOptions::Redirect::Follow;
+ options.destination = FetchOptions::Destination::Worker;
+ worker->m_scriptLoader->loadAsynchronously(context, WTFMove(request), WTFMove(options), contentSecurityPolicyEnforcement, ServiceWorkersMode::All, worker);
return WTFMove(worker);
}
@@ -186,7 +185,7 @@
else {
bool isOnline = platformStrategies()->loaderStrategy()->isOnLine();
const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders = m_contentSecurityPolicyResponseHeaders ? m_contentSecurityPolicyResponseHeaders.value() : scriptExecutionContext()->contentSecurityPolicy()->responseHeaders();
- m_contextProxy.startWorkerGlobalScope(m_scriptLoader->url(), m_name, scriptExecutionContext()->userAgent(m_scriptLoader->url()), isOnline, m_scriptLoader->script(), contentSecurityPolicyResponseHeaders, m_shouldBypassMainWorldContentSecurityPolicy, m_workerCreationTime, m_runtimeFlags, sessionID);
+ m_contextProxy.startWorkerGlobalScope(m_scriptLoader->url(), scriptExecutionContext()->userAgent(m_scriptLoader->url()), isOnline, m_scriptLoader->script(), contentSecurityPolicyResponseHeaders, m_shouldBypassMainWorldContentSecurityPolicy, m_workerCreationTime, m_runtimeFlags, sessionID);
InspectorInstrumentation::scriptImported(*scriptExecutionContext(), m_scriptLoader->identifier(), m_scriptLoader->script());
}
m_scriptLoader = nullptr;
Modified: trunk/Source/WebCore/workers/Worker.h (235154 => 235155)
--- trunk/Source/WebCore/workers/Worker.h 2018-08-22 02:04:00 UTC (rev 235154)
+++ trunk/Source/WebCore/workers/Worker.h 2018-08-22 02:22:41 UTC (rev 235155)
@@ -50,10 +50,7 @@
class Worker final : public AbstractWorker, public ActiveDOMObject, private WorkerScriptLoaderClient {
public:
- struct Options {
- String name;
- };
- static ExceptionOr<Ref<Worker>> create(ScriptExecutionContext&, JSC::RuntimeFlags, const String& url, const Options&);
+ static ExceptionOr<Ref<Worker>> create(ScriptExecutionContext&, JSC::RuntimeFlags, const String& url);
virtual ~Worker();
ExceptionOr<void> postMessage(JSC::ExecState&, JSC::JSValue message, Vector<JSC::Strong<JSC::JSObject>>&&);
@@ -67,7 +64,7 @@
ScriptExecutionContext* scriptExecutionContext() const final { return ActiveDOMObject::scriptExecutionContext(); }
private:
- explicit Worker(ScriptExecutionContext&, JSC::RuntimeFlags, const Options&);
+ explicit Worker(ScriptExecutionContext&, JSC::RuntimeFlags);
EventTargetInterface eventTargetInterface() const final { return WorkerEventTargetInterfaceType; }
@@ -83,7 +80,6 @@
static void networkStateChanged(bool isOnLine);
RefPtr<WorkerScriptLoader> m_scriptLoader;
- String m_name;
String m_identifier;
WorkerGlobalScopeProxy& m_contextProxy; // The proxy outlives the worker to perform thread shutdown.
std::optional<ContentSecurityPolicyResponseHeaders> m_contentSecurityPolicyResponseHeaders;
Modified: trunk/Source/WebCore/workers/Worker.idl (235154 => 235155)
--- trunk/Source/WebCore/workers/Worker.idl 2018-08-22 02:04:00 UTC (rev 235154)
+++ trunk/Source/WebCore/workers/Worker.idl 2018-08-22 02:22:41 UTC (rev 235155)
@@ -26,7 +26,7 @@
[
ActiveDOMObject,
- Constructor(USVString scriptUrl, optional WorkerOptions options),
+ Constructor(USVString scriptUrl),
ConstructorCallWith=ScriptExecutionContext&RuntimeFlags,
ConstructorMayThrowException
] interface Worker : EventTarget {
@@ -36,8 +36,4 @@
attribute EventHandler onmessage;
};
-dictionary WorkerOptions {
- DOMString name = "";
-};
-
Worker implements AbstractWorker;
Modified: trunk/Source/WebCore/workers/WorkerGlobalScopeProxy.h (235154 => 235155)
--- trunk/Source/WebCore/workers/WorkerGlobalScopeProxy.h 2018-08-22 02:04:00 UTC (rev 235154)
+++ trunk/Source/WebCore/workers/WorkerGlobalScopeProxy.h 2018-08-22 02:22:41 UTC (rev 235155)
@@ -50,7 +50,7 @@
public:
static WorkerGlobalScopeProxy& create(Worker&);
- virtual void startWorkerGlobalScope(const URL& scriptURL, const String& name, const String& userAgent, bool isOnline, const String& sourceCode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, MonotonicTime timeOrigin, JSC::RuntimeFlags, PAL::SessionID) = 0;
+ virtual void startWorkerGlobalScope(const URL& scriptURL, const String& userAgent, bool isOnline, const String& sourceCode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, MonotonicTime timeOrigin, JSC::RuntimeFlags, PAL::SessionID) = 0;
virtual void terminateWorkerGlobalScope() = 0;
virtual void postMessageToWorkerGlobalScope(MessageWithMessagePorts&&) = 0;
virtual bool hasPendingActivity() const = 0;
Modified: trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp (235154 => 235155)
--- trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp 2018-08-22 02:04:00 UTC (rev 235154)
+++ trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp 2018-08-22 02:22:41 UTC (rev 235155)
@@ -72,7 +72,7 @@
|| (is<WorkerGlobalScope>(*m_scriptExecutionContext) && downcast<WorkerGlobalScope>(*m_scriptExecutionContext).thread().thread() == &Thread::current()));
}
-void WorkerMessagingProxy::startWorkerGlobalScope(const URL& scriptURL, const String& name, const String& userAgent, bool isOnline, const String& sourceCode, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, MonotonicTime timeOrigin, JSC::RuntimeFlags runtimeFlags, PAL::SessionID sessionID)
+void WorkerMessagingProxy::startWorkerGlobalScope(const URL& scriptURL, const String& userAgent, bool isOnline, const String& sourceCode, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, MonotonicTime timeOrigin, JSC::RuntimeFlags runtimeFlags, PAL::SessionID sessionID)
{
// FIXME: This need to be revisited when we support nested worker one day
ASSERT(m_scriptExecutionContext);
@@ -88,7 +88,7 @@
SocketProvider* socketProvider = document.socketProvider();
- auto thread = DedicatedWorkerThread::create(scriptURL, name, identifier, userAgent, isOnline, sourceCode, *this, *this, *this, startMode, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, document.topOrigin(), timeOrigin, proxy, socketProvider, runtimeFlags, sessionID);
+ auto thread = DedicatedWorkerThread::create(scriptURL, identifier, userAgent, isOnline, sourceCode, *this, *this, *this, startMode, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, document.topOrigin(), timeOrigin, proxy, socketProvider, runtimeFlags, sessionID);
workerThreadCreated(thread.get());
thread->start(nullptr);
Modified: trunk/Source/WebCore/workers/WorkerMessagingProxy.h (235154 => 235155)
--- trunk/Source/WebCore/workers/WorkerMessagingProxy.h 2018-08-22 02:04:00 UTC (rev 235154)
+++ trunk/Source/WebCore/workers/WorkerMessagingProxy.h 2018-08-22 02:22:41 UTC (rev 235155)
@@ -46,7 +46,7 @@
private:
// Implementations of WorkerGlobalScopeProxy.
// (Only use these functions in the worker object thread.)
- void startWorkerGlobalScope(const URL& scriptURL, const String& name, const String& userAgent, bool isOnline, const String& sourceCode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, MonotonicTime timeOrigin, JSC::RuntimeFlags, PAL::SessionID) final;
+ void startWorkerGlobalScope(const URL& scriptURL, const String& userAgent, bool isOnline, const String& sourceCode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, MonotonicTime timeOrigin, JSC::RuntimeFlags, PAL::SessionID) final;
void terminateWorkerGlobalScope() final;
void postMessageToWorkerGlobalScope(MessageWithMessagePorts&&) final;
bool hasPendingActivity() const final;
Modified: trunk/Source/WebCore/workers/WorkerThread.cpp (235154 => 235155)
--- trunk/Source/WebCore/workers/WorkerThread.cpp 2018-08-22 02:04:00 UTC (rev 235154)
+++ trunk/Source/WebCore/workers/WorkerThread.cpp 2018-08-22 02:22:41 UTC (rev 235155)
@@ -72,11 +72,10 @@
struct WorkerThreadStartupData {
WTF_MAKE_NONCOPYABLE(WorkerThreadStartupData); WTF_MAKE_FAST_ALLOCATED;
public:
- WorkerThreadStartupData(const URL& scriptURL, const String& name, const String& identifier, const String& userAgent, bool isOnline, const String& sourceCode, WorkerThreadStartMode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin& topOrigin, MonotonicTime timeOrigin, PAL::SessionID);
+ WorkerThreadStartupData(const URL& scriptURL, const String& identifier, const String& userAgent, bool isOnline, const String& sourceCode, WorkerThreadStartMode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin& topOrigin, MonotonicTime timeOrigin, PAL::SessionID);
URL m_scriptURL;
Ref<SecurityOrigin> m_origin;
- String m_name;
String m_identifier;
String m_userAgent;
String m_sourceCode;
@@ -89,10 +88,9 @@
PAL::SessionID m_sessionID;
};
-WorkerThreadStartupData::WorkerThreadStartupData(const URL& scriptURL, const String& name, const String& identifier, const String& userAgent, bool isOnline, const String& sourceCode, WorkerThreadStartMode startMode, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin& topOrigin, MonotonicTime timeOrigin, PAL::SessionID sessionID)
+WorkerThreadStartupData::WorkerThreadStartupData(const URL& scriptURL, const String& identifier, const String& userAgent, bool isOnline, const String& sourceCode, WorkerThreadStartMode startMode, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin& topOrigin, MonotonicTime timeOrigin, PAL::SessionID sessionID)
: m_scriptURL(scriptURL.isolatedCopy())
, m_origin(SecurityOrigin::create(m_scriptURL)->isolatedCopy())
- , m_name(name.isolatedCopy())
, m_identifier(identifier.isolatedCopy())
, m_userAgent(userAgent.isolatedCopy())
, m_sourceCode(sourceCode.isolatedCopy())
@@ -106,12 +104,12 @@
{
}
-WorkerThread::WorkerThread(const URL& scriptURL, const String& name, const String& identifier, const String& userAgent, bool isOnline, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerDebuggerProxy& workerDebuggerProxy, WorkerReportingProxy& workerReportingProxy, WorkerThreadStartMode startMode, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin& topOrigin, MonotonicTime timeOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider, JSC::RuntimeFlags runtimeFlags, PAL::SessionID sessionID)
+WorkerThread::WorkerThread(const URL& scriptURL, const String& identifier, const String& userAgent, bool isOnline, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerDebuggerProxy& workerDebuggerProxy, WorkerReportingProxy& workerReportingProxy, WorkerThreadStartMode startMode, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin& topOrigin, MonotonicTime timeOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider, JSC::RuntimeFlags runtimeFlags, PAL::SessionID sessionID)
: m_workerLoaderProxy(workerLoaderProxy)
, m_workerDebuggerProxy(workerDebuggerProxy)
, m_workerReportingProxy(workerReportingProxy)
, m_runtimeFlags(runtimeFlags)
- , m_startupData(std::make_unique<WorkerThreadStartupData>(scriptURL, name, identifier, userAgent, isOnline, sourceCode, startMode, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, topOrigin, timeOrigin, sessionID))
+ , m_startupData(std::make_unique<WorkerThreadStartupData>(scriptURL, identifier, userAgent, isOnline, sourceCode, startMode, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, topOrigin, timeOrigin, sessionID))
#if ENABLE(INDEXED_DATABASE)
, m_idbConnectionProxy(connectionProxy)
#endif
@@ -169,7 +167,7 @@
// while WorkerThread::stop() is accessing it. Note that WorkerThread::stop() can
// be called before we've finished creating the WorkerGlobalScope.
LockHolder lock(m_threadCreationAndWorkerGlobalScopeMutex);
- m_workerGlobalScope = createWorkerGlobalScope(m_startupData->m_scriptURL, WTFMove(m_startupData->m_origin), m_startupData->m_name, m_startupData->m_identifier, m_startupData->m_userAgent, m_startupData->m_isOnline, m_startupData->m_contentSecurityPolicyResponseHeaders, m_startupData->m_shouldBypassMainWorldContentSecurityPolicy, WTFMove(m_startupData->m_topOrigin), m_startupData->m_timeOrigin, m_startupData->m_sessionID);
+ m_workerGlobalScope = createWorkerGlobalScope(m_startupData->m_scriptURL, WTFMove(m_startupData->m_origin), m_startupData->m_identifier, m_startupData->m_userAgent, m_startupData->m_isOnline, m_startupData->m_contentSecurityPolicyResponseHeaders, m_startupData->m_shouldBypassMainWorldContentSecurityPolicy, WTFMove(m_startupData->m_topOrigin), m_startupData->m_timeOrigin, m_startupData->m_sessionID);
scriptController = m_workerGlobalScope->script();
Modified: trunk/Source/WebCore/workers/WorkerThread.h (235154 => 235155)
--- trunk/Source/WebCore/workers/WorkerThread.h 2018-08-22 02:04:00 UTC (rev 235154)
+++ trunk/Source/WebCore/workers/WorkerThread.h 2018-08-22 02:22:41 UTC (rev 235155)
@@ -87,10 +87,10 @@
JSC::RuntimeFlags runtimeFlags() const { return m_runtimeFlags; }
protected:
- WorkerThread(const URL&, const String& name, const String& identifier, const String& userAgent, bool isOnline, const String& sourceCode, WorkerLoaderProxy&, WorkerDebuggerProxy&, WorkerReportingProxy&, WorkerThreadStartMode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin& topOrigin, MonotonicTime timeOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*, JSC::RuntimeFlags, PAL::SessionID);
+ WorkerThread(const URL&, const String& identifier, const String& userAgent, bool isOnline, const String& sourceCode, WorkerLoaderProxy&, WorkerDebuggerProxy&, WorkerReportingProxy&, WorkerThreadStartMode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, const SecurityOrigin& topOrigin, MonotonicTime timeOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*, JSC::RuntimeFlags, PAL::SessionID);
// Factory method for creating a new worker context for the thread.
- virtual Ref<WorkerGlobalScope> createWorkerGlobalScope(const URL&, Ref<SecurityOrigin>&&, const String& name, const String& identifier, const String& userAgent, bool isOnline, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& topOrigin, MonotonicTime timeOrigin, PAL::SessionID) = 0;
+ virtual Ref<WorkerGlobalScope> createWorkerGlobalScope(const URL&, Ref<SecurityOrigin>&&, const String& identifier, const String& userAgent, bool isOnline, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& topOrigin, MonotonicTime timeOrigin, PAL::SessionID) = 0;
// Executes the event loop for the worker thread. Derived classes can override to perform actions before/after entering the event loop.
virtual void runEventLoop();
Modified: trunk/Source/WebCore/workers/service/context/ServiceWorkerThread.cpp (235154 => 235155)
--- trunk/Source/WebCore/workers/service/context/ServiceWorkerThread.cpp 2018-08-22 02:04:00 UTC (rev 235154)
+++ trunk/Source/WebCore/workers/service/context/ServiceWorkerThread.cpp 2018-08-22 02:22:41 UTC (rev 235155)
@@ -72,7 +72,7 @@
// FIXME: Use valid runtime flags
ServiceWorkerThread::ServiceWorkerThread(const ServiceWorkerContextData& data, PAL::SessionID, 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.script, loaderProxy, debuggerProxy, DummyServiceWorkerThreadProxy::shared(), WorkerThreadStartMode::Normal, data.contentSecurityPolicy, false, data.registration.key.topOrigin().securityOrigin().get(), MonotonicTime::now(), idbConnectionProxy, socketProvider, JSC::RuntimeFlags::createAllEnabled(), data.sessionID)
+ : WorkerThread(data.scriptURL, "serviceworker:" + Inspector::IdentifiersFactory::createIdentifier(), WTFMove(userAgent), platformStrategies()->loaderStrategy()->isOnLine(), data.script, loaderProxy, debuggerProxy, DummyServiceWorkerThreadProxy::shared(), WorkerThreadStartMode::Normal, data.contentSecurityPolicy, false, data.registration.key.topOrigin().securityOrigin().get(), MonotonicTime::now(), idbConnectionProxy, socketProvider, JSC::RuntimeFlags::createAllEnabled(), data.sessionID)
, m_data(data.isolatedCopy())
, m_workerObjectProxy(DummyServiceWorkerThreadProxy::shared())
{
@@ -81,9 +81,8 @@
ServiceWorkerThread::~ServiceWorkerThread() = default;
-Ref<WorkerGlobalScope> ServiceWorkerThread::createWorkerGlobalScope(const URL& url, Ref<SecurityOrigin>&& origin, const String& name, const String& identifier, const String& userAgent, bool isOnline, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicy, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& topOrigin, MonotonicTime timeOrigin, PAL::SessionID sessionID)
+Ref<WorkerGlobalScope> ServiceWorkerThread::createWorkerGlobalScope(const URL& url, Ref<SecurityOrigin>&& origin, const String& identifier, const String& userAgent, bool isOnline, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicy, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& topOrigin, MonotonicTime timeOrigin, PAL::SessionID sessionID)
{
- UNUSED_PARAM(name);
return ServiceWorkerGlobalScope::create(m_data, url, WTFMove(origin), identifier, userAgent, isOnline, *this, contentSecurityPolicy, shouldBypassMainWorldContentSecurityPolicy, WTFMove(topOrigin), timeOrigin, idbConnectionProxy(), socketProvider(), sessionID);
}
Modified: trunk/Source/WebCore/workers/service/context/ServiceWorkerThread.h (235154 => 235155)
--- trunk/Source/WebCore/workers/service/context/ServiceWorkerThread.h 2018-08-22 02:04:00 UTC (rev 235154)
+++ trunk/Source/WebCore/workers/service/context/ServiceWorkerThread.h 2018-08-22 02:22:41 UTC (rev 235155)
@@ -66,7 +66,7 @@
ServiceWorkerIdentifier identifier() const { return m_data.serviceWorkerIdentifier; }
protected:
- Ref<WorkerGlobalScope> createWorkerGlobalScope(const URL&, Ref<SecurityOrigin>&&, const String& name, const String& identifier, const String& userAgent, bool isOnline, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& topOrigin, MonotonicTime timeOrigin, PAL::SessionID) final;
+ Ref<WorkerGlobalScope> createWorkerGlobalScope(const URL&, Ref<SecurityOrigin>&&, const String& identifier, const String& userAgent, bool isOnline, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, Ref<SecurityOrigin>&& topOrigin, MonotonicTime timeOrigin, PAL::SessionID) final;
void runEventLoop() override;
private: