Diff
Modified: trunk/LayoutTests/ChangeLog (235158 => 235159)
--- trunk/LayoutTests/ChangeLog 2018-08-22 04:41:06 UTC (rev 235158)
+++ trunk/LayoutTests/ChangeLog 2018-08-22 04:58:26 UTC (rev 235159)
@@ -1,3 +1,19 @@
+2018-08-21 Yusuke Suzuki <[email protected]>
+
+ Support "name" option for dedicated workers
+ https://bugs.webkit.org/show_bug.cgi?id=188779
+
+ Reviewed by Joseph Pecoraro.
+
+ * http/wpt/workers/name-property-enhanced-expected.txt: Added.
+ * http/wpt/workers/name-property-enhanced.html: Added.
+ * http/wpt/workers/name-property-no-name-expected.txt: Added.
+ * http/wpt/workers/name-property-no-name.html: Added.
+ * http/wpt/workers/support/name.js: Added.
+ (test):
+ * http/wpt/workers/support/no-name.js: Added.
+ (test):
+
2018-08-21 Ryan Haddad <[email protected]>
Unreviewed, rolling out r235128.
Added: trunk/LayoutTests/http/wpt/workers/name-property-enhanced-expected.txt (0 => 235159)
--- trunk/LayoutTests/http/wpt/workers/name-property-enhanced-expected.txt (rev 0)
+++ trunk/LayoutTests/http/wpt/workers/name-property-enhanced-expected.txt 2018-08-22 04:58:26 UTC (rev 235159)
@@ -0,0 +1,4 @@
+
+PASS name property value for DedicatedWorkerGlobalScope
+PASS name property is replaceable for DedicatedWorkerGlobalScope
+
Added: trunk/LayoutTests/http/wpt/workers/name-property-enhanced.html (0 => 235159)
--- trunk/LayoutTests/http/wpt/workers/name-property-enhanced.html (rev 0)
+++ trunk/LayoutTests/http/wpt/workers/name-property-enhanced.html 2018-08-22 04:58:26 UTC (rev 235159)
@@ -0,0 +1,17 @@
+<!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/name.js", { name: "my name" });
+fetch_tests_from_worker(worker);
+</script>
Added: trunk/LayoutTests/http/wpt/workers/name-property-no-name-expected.txt (0 => 235159)
--- trunk/LayoutTests/http/wpt/workers/name-property-no-name-expected.txt (rev 0)
+++ trunk/LayoutTests/http/wpt/workers/name-property-no-name-expected.txt 2018-08-22 04:58:26 UTC (rev 235159)
@@ -0,0 +1,4 @@
+
+PASS name property value for DedicatedWorkerGlobalScope
+PASS name property is replaceable for DedicatedWorkerGlobalScope
+
Added: trunk/LayoutTests/http/wpt/workers/name-property-no-name.html (0 => 235159)
--- trunk/LayoutTests/http/wpt/workers/name-property-no-name.html (rev 0)
+++ trunk/LayoutTests/http/wpt/workers/name-property-no-name.html 2018-08-22 04:58:26 UTC (rev 235159)
@@ -0,0 +1,17 @@
+<!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);
+</script>
Added: trunk/LayoutTests/http/wpt/workers/support/name.js (0 => 235159)
--- trunk/LayoutTests/http/wpt/workers/support/name.js (rev 0)
+++ trunk/LayoutTests/http/wpt/workers/support/name.js 2018-08-22 04:58:26 UTC (rev 235159)
@@ -0,0 +1,18 @@
+"use strict";
+importScripts("/resources/testharness.js");
+
+test(() => {
+ assert_true(self.hasOwnProperty("name"), "property exists on the global")
+ assert_equals(self.name, "my name")
+}, `name property value for ${self.constructor.name}`);
+
+test(() => {
+ self.name = "something new";
+ const propDesc = Object.getOwnPropertyDescriptor(self, "name");
+ assert_equals(propDesc.value, "something new", "value");
+ assert_true(propDesc.configurable, "configurable");
+ assert_true(propDesc.writable, "writable");
+ assert_true(propDesc.enumerable, "enumerable");
+}, `name property is replaceable for ${self.constructor.name}`);
+
+done();
Added: trunk/LayoutTests/http/wpt/workers/support/no-name.js (0 => 235159)
--- trunk/LayoutTests/http/wpt/workers/support/no-name.js (rev 0)
+++ trunk/LayoutTests/http/wpt/workers/support/no-name.js 2018-08-22 04:58:26 UTC (rev 235159)
@@ -0,0 +1,18 @@
+"use strict";
+importScripts("/resources/testharness.js");
+
+test(() => {
+ assert_true(self.hasOwnProperty("name"), "property exists on the global")
+ assert_equals(self.name, "")
+}, `name property value for ${self.constructor.name}`);
+
+test(() => {
+ self.name = "something new";
+ const propDesc = Object.getOwnPropertyDescriptor(self, "name");
+ assert_equals(propDesc.value, "something new", "value");
+ assert_true(propDesc.configurable, "configurable");
+ assert_true(propDesc.writable, "writable");
+ assert_true(propDesc.enumerable, "enumerable");
+}, `name property is replaceable for ${self.constructor.name}`);
+
+done();
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (235158 => 235159)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2018-08-22 04:41:06 UTC (rev 235158)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2018-08-22 04:58:26 UTC (rev 235159)
@@ -1,3 +1,13 @@
+2018-08-21 Yusuke Suzuki <[email protected]>
+
+ Support "name" option for dedicated workers
+ https://bugs.webkit.org/show_bug.cgi?id=188779
+
+ Reviewed by Joseph Pecoraro.
+
+ * web-platform-tests/workers/interfaces.worker-expected.txt:
+ * web-platform-tests/workers/name-property-expected.txt:
+
2018-08-21 Ryan Haddad <[email protected]>
Unreviewed, rolling out r235128.
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/workers/interfaces.worker-expected.txt (235158 => 235159)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/workers/interfaces.worker-expected.txt 2018-08-22 04:41:06 UTC (rev 235158)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/workers/interfaces.worker-expected.txt 2018-08-22 04:58:26 UTC (rev 235159)
@@ -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
-FAIL DedicatedWorkerGlobalScope interface: attribute name assert_own_property: The global object must have a property "name" expected property "name" missing
+PASS DedicatedWorkerGlobalScope interface: attribute name
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
-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 "name" with the proper type
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 (235158 => 235159)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/workers/name-property-expected.txt 2018-08-22 04:41:06 UTC (rev 235158)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/workers/name-property-expected.txt 2018-08-22 04:58:26 UTC (rev 235159)
@@ -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 name property is replaceable 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
Modified: trunk/Source/WebCore/ChangeLog (235158 => 235159)
--- trunk/Source/WebCore/ChangeLog 2018-08-22 04:41:06 UTC (rev 235158)
+++ trunk/Source/WebCore/ChangeLog 2018-08-22 04:58:26 UTC (rev 235159)
@@ -1,3 +1,58 @@
+2018-08-21 Yusuke Suzuki <[email protected]>
+
+ Support "name" option for dedicated workers
+ https://bugs.webkit.org/show_bug.cgi?id=188779
+
+ Reviewed by Joseph Pecoraro.
+
+ This patch adds `new Worker(url, { name: "Worker Name" })` option support[1].
+ This name can be accessible from `self.name` of DedicatedWorkerGlobalScope.
+ It is useful for debugging dedicated workers if the inspector can show the
+ names of the workers. This enhancement is tracked by [2].
+
+ [1]: https://github.com/whatwg/html/issues/2477
+ [2]: https://bugs.webkit.org/show_bug.cgi?id=164678
+
+ Tests: http/wpt/workers/name-property-enhanced.html
+ http/wpt/workers/name-property-no-name.html
+
+ * workers/DedicatedWorkerGlobalScope.cpp:
+ (WebCore::DedicatedWorkerGlobalScope::create):
+ (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
+ Hold `name` member.
+
+ * workers/DedicatedWorkerGlobalScope.h:
+ * workers/DedicatedWorkerGlobalScope.idl:
+ Add `name` attribute.
+
+ * workers/DedicatedWorkerThread.cpp:
+ (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
+ (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
+ * workers/DedicatedWorkerThread.h:
+ * workers/Worker.cpp:
+ (WebCore::Worker::Worker):
+ (WebCore::Worker::create):
+ (WebCore::Worker::notifyFinished):
+ * workers/Worker.h:
+ * workers/Worker.idl:
+ Add WorkerOptions for dedicated worker creation.
+
+ * workers/WorkerGlobalScopeProxy.h:
+ * workers/WorkerMessagingProxy.cpp:
+ (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
+ * workers/WorkerMessagingProxy.h:
+ * workers/WorkerThread.cpp:
+ (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
+ Isolate copy the given `name` to pass the worker thread.
+
+ (WebCore::WorkerThread::WorkerThread):
+ (WebCore::WorkerThread::workerThread):
+ * workers/WorkerThread.h:
+ * workers/service/context/ServiceWorkerThread.cpp:
+ (WebCore::ServiceWorkerThread::ServiceWorkerThread):
+ (WebCore::ServiceWorkerThread::createWorkerGlobalScope):
+ * workers/service/context/ServiceWorkerThread.h:
+
2018-08-21 Ryosuke Niwa <[email protected]>
Replace booleans for modifier keys in UIEventWithKeyState with OptionSet<Modifier>
Modified: trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.cpp (235158 => 235159)
--- trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.cpp 2018-08-22 04:41:06 UTC (rev 235158)
+++ trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.cpp 2018-08-22 04:58:26 UTC (rev 235159)
@@ -41,16 +41,17 @@
namespace WebCore {
-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)
+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)
{
- auto context = adoptRef(*new DedicatedWorkerGlobalScope(url, WTFMove(origin), identifier, userAgent, isOnline, thread, shouldBypassMainWorldContentSecurityPolicy, WTFMove(topOrigin), timeOrigin, connectionProxy, socketProvider, sessionID));
+ auto context = adoptRef(*new DedicatedWorkerGlobalScope(url, WTFMove(origin), name, 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& 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& 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)
: 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 (235158 => 235159)
--- trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.h 2018-08-22 04:41:06 UTC (rev 235158)
+++ trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.h 2018-08-22 04:58:26 UTC (rev 235159)
@@ -48,9 +48,11 @@
class DedicatedWorkerGlobalScope final : public WorkerGlobalScope {
public:
- 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);
+ 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);
virtual ~DedicatedWorkerGlobalScope();
+ const String& name() const { return m_name; }
+
ExceptionOr<void> postMessage(JSC::ExecState&, JSC::JSValue message, Vector<JSC::Strong<JSC::JSObject>>&&);
DedicatedWorkerThread& thread();
@@ -58,11 +60,13 @@
private:
using Base = WorkerGlobalScope;
- 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);
+ 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);
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 (235158 => 235159)
--- trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.idl 2018-08-22 04:41:06 UTC (rev 235158)
+++ trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.idl 2018-08-22 04:58:26 UTC (rev 235159)
@@ -37,6 +37,8 @@
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 (235158 => 235159)
--- trunk/Source/WebCore/workers/DedicatedWorkerThread.cpp 2018-08-22 04:41:06 UTC (rev 235158)
+++ trunk/Source/WebCore/workers/DedicatedWorkerThread.cpp 2018-08-22 04:58:26 UTC (rev 235159)
@@ -38,8 +38,8 @@
namespace WebCore {
-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)
+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)
, m_workerObjectProxy(workerObjectProxy)
{
}
@@ -46,9 +46,9 @@
DedicatedWorkerThread::~DedicatedWorkerThread() = default;
-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)
+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)
{
- return DedicatedWorkerGlobalScope::create(url, WTFMove(origin), identifier, userAgent, isOnline, *this, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, WTFMove(topOrigin), timeOrigin, idbConnectionProxy(), socketProvider(), sessionID);
+ return DedicatedWorkerGlobalScope::create(url, WTFMove(origin), name, identifier, userAgent, isOnline, *this, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, WTFMove(topOrigin), timeOrigin, idbConnectionProxy(), socketProvider(), sessionID);
}
void DedicatedWorkerThread::runEventLoop()
Modified: trunk/Source/WebCore/workers/DedicatedWorkerThread.h (235158 => 235159)
--- trunk/Source/WebCore/workers/DedicatedWorkerThread.h 2018-08-22 04:41:06 UTC (rev 235158)
+++ trunk/Source/WebCore/workers/DedicatedWorkerThread.h 2018-08-22 04:58:26 UTC (rev 235159)
@@ -49,11 +49,11 @@
WorkerObjectProxy& workerObjectProxy() const { return m_workerObjectProxy; }
protected:
- 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;
+ 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;
void runEventLoop() override;
private:
- 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);
+ 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);
WorkerObjectProxy& m_workerObjectProxy;
};
Modified: trunk/Source/WebCore/workers/Worker.cpp (235158 => 235159)
--- trunk/Source/WebCore/workers/Worker.cpp 2018-08-22 04:41:06 UTC (rev 235158)
+++ trunk/Source/WebCore/workers/Worker.cpp 2018-08-22 04:58:26 UTC (rev 235159)
@@ -57,8 +57,9 @@
worker->notifyNetworkStateChange(isOnLine);
}
-inline Worker::Worker(ScriptExecutionContext& context, JSC::RuntimeFlags runtimeFlags)
+inline Worker::Worker(ScriptExecutionContext& context, JSC::RuntimeFlags runtimeFlags, const Options& options)
: ActiveDOMObject(&context)
+ , m_name(options.name)
, m_identifier("worker:" + Inspector::IdentifiersFactory::createIdentifier())
, m_contextProxy(WorkerGlobalScopeProxy::create(*this))
, m_runtimeFlags(runtimeFlags)
@@ -73,7 +74,7 @@
ASSERT_UNUSED(addResult, addResult.isNewEntry);
}
-ExceptionOr<Ref<Worker>> Worker::create(ScriptExecutionContext& context, JSC::RuntimeFlags runtimeFlags, const String& url)
+ExceptionOr<Ref<Worker>> Worker::create(ScriptExecutionContext& context, JSC::RuntimeFlags runtimeFlags, const String& url, const Options& options)
{
ASSERT(isMainThread());
@@ -80,7 +81,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));
+ auto worker = adoptRef(*new Worker(context, runtimeFlags, options));
worker->suspendIfNeeded();
@@ -103,12 +104,12 @@
ResourceRequest request { scriptURL.releaseReturnValue() };
request.setInitiatorIdentifier(worker->m_identifier);
- 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);
+ 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);
return WTFMove(worker);
}
@@ -185,7 +186,7 @@
else {
bool isOnline = platformStrategies()->loaderStrategy()->isOnLine();
const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders = m_contentSecurityPolicyResponseHeaders ? m_contentSecurityPolicyResponseHeaders.value() : scriptExecutionContext()->contentSecurityPolicy()->responseHeaders();
- m_contextProxy.startWorkerGlobalScope(m_scriptLoader->url(), scriptExecutionContext()->userAgent(m_scriptLoader->url()), isOnline, m_scriptLoader->script(), contentSecurityPolicyResponseHeaders, m_shouldBypassMainWorldContentSecurityPolicy, m_workerCreationTime, m_runtimeFlags, sessionID);
+ 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);
InspectorInstrumentation::scriptImported(*scriptExecutionContext(), m_scriptLoader->identifier(), m_scriptLoader->script());
}
m_scriptLoader = nullptr;
Modified: trunk/Source/WebCore/workers/Worker.h (235158 => 235159)
--- trunk/Source/WebCore/workers/Worker.h 2018-08-22 04:41:06 UTC (rev 235158)
+++ trunk/Source/WebCore/workers/Worker.h 2018-08-22 04:58:26 UTC (rev 235159)
@@ -50,7 +50,10 @@
class Worker final : public AbstractWorker, public ActiveDOMObject, private WorkerScriptLoaderClient {
public:
- static ExceptionOr<Ref<Worker>> create(ScriptExecutionContext&, JSC::RuntimeFlags, const String& url);
+ struct Options {
+ String name;
+ };
+ static ExceptionOr<Ref<Worker>> create(ScriptExecutionContext&, JSC::RuntimeFlags, const String& url, const Options&);
virtual ~Worker();
ExceptionOr<void> postMessage(JSC::ExecState&, JSC::JSValue message, Vector<JSC::Strong<JSC::JSObject>>&&);
@@ -64,7 +67,7 @@
ScriptExecutionContext* scriptExecutionContext() const final { return ActiveDOMObject::scriptExecutionContext(); }
private:
- explicit Worker(ScriptExecutionContext&, JSC::RuntimeFlags);
+ explicit Worker(ScriptExecutionContext&, JSC::RuntimeFlags, const Options&);
EventTargetInterface eventTargetInterface() const final { return WorkerEventTargetInterfaceType; }
@@ -80,6 +83,7 @@
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 (235158 => 235159)
--- trunk/Source/WebCore/workers/Worker.idl 2018-08-22 04:41:06 UTC (rev 235158)
+++ trunk/Source/WebCore/workers/Worker.idl 2018-08-22 04:58:26 UTC (rev 235159)
@@ -26,7 +26,7 @@
[
ActiveDOMObject,
- Constructor(USVString scriptUrl),
+ Constructor(USVString scriptUrl, optional WorkerOptions options),
ConstructorCallWith=ScriptExecutionContext&RuntimeFlags,
ConstructorMayThrowException
] interface Worker : EventTarget {
@@ -36,4 +36,8 @@
attribute EventHandler onmessage;
};
+dictionary WorkerOptions {
+ DOMString name = "";
+};
+
Worker implements AbstractWorker;
Modified: trunk/Source/WebCore/workers/WorkerGlobalScopeProxy.h (235158 => 235159)
--- trunk/Source/WebCore/workers/WorkerGlobalScopeProxy.h 2018-08-22 04:41:06 UTC (rev 235158)
+++ trunk/Source/WebCore/workers/WorkerGlobalScopeProxy.h 2018-08-22 04:58:26 UTC (rev 235159)
@@ -50,7 +50,7 @@
public:
static WorkerGlobalScopeProxy& create(Worker&);
- 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 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 terminateWorkerGlobalScope() = 0;
virtual void postMessageToWorkerGlobalScope(MessageWithMessagePorts&&) = 0;
virtual bool hasPendingActivity() const = 0;
Modified: trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp (235158 => 235159)
--- trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp 2018-08-22 04:41:06 UTC (rev 235158)
+++ trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp 2018-08-22 04:58:26 UTC (rev 235159)
@@ -72,7 +72,7 @@
|| (is<WorkerGlobalScope>(*m_scriptExecutionContext) && downcast<WorkerGlobalScope>(*m_scriptExecutionContext).thread().thread() == &Thread::current()));
}
-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)
+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)
{
// 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, identifier, userAgent, isOnline, sourceCode, *this, *this, *this, startMode, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, document.topOrigin(), timeOrigin, proxy, socketProvider, runtimeFlags, sessionID);
+ auto thread = DedicatedWorkerThread::create(scriptURL, name, 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 (235158 => 235159)
--- trunk/Source/WebCore/workers/WorkerMessagingProxy.h 2018-08-22 04:41:06 UTC (rev 235158)
+++ trunk/Source/WebCore/workers/WorkerMessagingProxy.h 2018-08-22 04:58:26 UTC (rev 235159)
@@ -46,7 +46,7 @@
private:
// Implementations of WorkerGlobalScopeProxy.
// (Only use these functions in the worker object thread.)
- 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 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 terminateWorkerGlobalScope() final;
void postMessageToWorkerGlobalScope(MessageWithMessagePorts&&) final;
bool hasPendingActivity() const final;
Modified: trunk/Source/WebCore/workers/WorkerThread.cpp (235158 => 235159)
--- trunk/Source/WebCore/workers/WorkerThread.cpp 2018-08-22 04:41:06 UTC (rev 235158)
+++ trunk/Source/WebCore/workers/WorkerThread.cpp 2018-08-22 04:58:26 UTC (rev 235159)
@@ -72,10 +72,11 @@
struct WorkerThreadStartupData {
WTF_MAKE_NONCOPYABLE(WorkerThreadStartupData); WTF_MAKE_FAST_ALLOCATED;
public:
- 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);
+ 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);
URL m_scriptURL;
Ref<SecurityOrigin> m_origin;
+ String m_name;
String m_identifier;
String m_userAgent;
String m_sourceCode;
@@ -88,9 +89,10 @@
PAL::SessionID m_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)
+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)
: 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())
@@ -104,12 +106,12 @@
{
}
-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)
+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)
: m_workerLoaderProxy(workerLoaderProxy)
, m_workerDebuggerProxy(workerDebuggerProxy)
, m_workerReportingProxy(workerReportingProxy)
, m_runtimeFlags(runtimeFlags)
- , m_startupData(std::make_unique<WorkerThreadStartupData>(scriptURL, identifier, userAgent, isOnline, sourceCode, startMode, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, topOrigin, timeOrigin, sessionID))
+ , m_startupData(std::make_unique<WorkerThreadStartupData>(scriptURL, name, identifier, userAgent, isOnline, sourceCode, startMode, contentSecurityPolicyResponseHeaders, shouldBypassMainWorldContentSecurityPolicy, topOrigin, timeOrigin, sessionID))
#if ENABLE(INDEXED_DATABASE)
, m_idbConnectionProxy(connectionProxy)
#endif
@@ -167,7 +169,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_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_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);
scriptController = m_workerGlobalScope->script();
Modified: trunk/Source/WebCore/workers/WorkerThread.h (235158 => 235159)
--- trunk/Source/WebCore/workers/WorkerThread.h 2018-08-22 04:41:06 UTC (rev 235158)
+++ trunk/Source/WebCore/workers/WorkerThread.h 2018-08-22 04:58:26 UTC (rev 235159)
@@ -87,10 +87,10 @@
JSC::RuntimeFlags runtimeFlags() const { return m_runtimeFlags; }
protected:
- 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);
+ 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);
// Factory method for creating a new worker context for the thread.
- 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;
+ 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;
// 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 (235158 => 235159)
--- trunk/Source/WebCore/workers/service/context/ServiceWorkerThread.cpp 2018-08-22 04:41:06 UTC (rev 235158)
+++ trunk/Source/WebCore/workers/service/context/ServiceWorkerThread.cpp 2018-08-22 04:58:26 UTC (rev 235159)
@@ -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, "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, 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)
, m_data(data.isolatedCopy())
, m_workerObjectProxy(DummyServiceWorkerThreadProxy::shared())
{
@@ -81,8 +81,9 @@
ServiceWorkerThread::~ServiceWorkerThread() = default;
-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)
+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)
{
+ 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 (235158 => 235159)
--- trunk/Source/WebCore/workers/service/context/ServiceWorkerThread.h 2018-08-22 04:41:06 UTC (rev 235158)
+++ trunk/Source/WebCore/workers/service/context/ServiceWorkerThread.h 2018-08-22 04:58:26 UTC (rev 235159)
@@ -66,7 +66,7 @@
ServiceWorkerIdentifier identifier() const { return m_data.serviceWorkerIdentifier; }
protected:
- 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;
+ 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;
void runEventLoop() override;
private: