Diff
Modified: trunk/Source/WebCore/ChangeLog (289022 => 289023)
--- trunk/Source/WebCore/ChangeLog 2022-02-03 02:17:13 UTC (rev 289022)
+++ trunk/Source/WebCore/ChangeLog 2022-02-03 02:19:08 UTC (rev 289023)
@@ -1,3 +1,33 @@
+2022-02-02 Chris Dumez <[email protected]>
+
+ Move connect event dispatch logic to SharedWorkerGlobalScope
+ https://bugs.webkit.org/show_bug.cgi?id=236038
+
+ Reviewed by Darin Adler.
+
+ Move connect event dispatch logic to SharedWorkerGlobalScope and add logging.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * platform/Logging.h:
+ * workers/shared/SharedWorkerGlobalScope.cpp:
+ (WebCore::SharedWorkerGlobalScope::SharedWorkerGlobalScope):
+ (WebCore::SharedWorkerGlobalScope::thread):
+ (WebCore::SharedWorkerGlobalScope::close):
+ (WebCore::SharedWorkerGlobalScope::postConnectEvent):
+ * workers/shared/SharedWorkerGlobalScope.h:
+ * workers/shared/SharedWorkerIdentifier.h: Copied from Source/WebCore/workers/shared/context/SharedWorkerThread.h.
+ * workers/shared/SharedWorkerManager.cpp:
+ (WebCore::SharedWorkerManager::scriptLoadedSuccessfully):
+ * workers/shared/context/SharedWorkerThread.cpp:
+ (WebCore::SharedWorkerThread::SharedWorkerThread):
+ (WebCore::SharedWorkerThread::createWorkerGlobalScope):
+ * workers/shared/context/SharedWorkerThread.h:
+ (WebCore::SharedWorkerThread::identifier const):
+ * workers/shared/context/SharedWorkerThreadProxy.cpp:
+ (WebCore::SharedWorkerThreadProxy::startWorkerGlobalScope):
+ (WebCore::SharedWorkerThreadProxy::identifier const):
+ * workers/shared/context/SharedWorkerThreadProxy.h:
+
2022-02-02 Patrick Griffis <[email protected]>
CSP: Implement wasm-unsafe-eval
Modified: trunk/Source/WebCore/Headers.cmake (289022 => 289023)
--- trunk/Source/WebCore/Headers.cmake 2022-02-03 02:17:13 UTC (rev 289022)
+++ trunk/Source/WebCore/Headers.cmake 2022-02-03 02:19:08 UTC (rev 289023)
@@ -2001,6 +2001,7 @@
workers/service/server/SWServerToContextConnection.h
workers/service/server/SWServerWorker.h
+ workers/shared/SharedWorkerIdentifier.h
workers/shared/context/SharedWorkerThread.h
workers/shared/context/SharedWorkerThreadProxy.h
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (289022 => 289023)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2022-02-03 02:17:13 UTC (rev 289022)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2022-02-03 02:19:08 UTC (rev 289023)
@@ -1387,6 +1387,7 @@
46EB37CC1F97CCD200B65523 /* JSServiceWorkerClients.h in Headers */ = {isa = PBXBuildFile; fileRef = 46EB37C51F97CCCB00B65523 /* JSServiceWorkerClients.h */; };
46EB37CE1F97CCD200B65523 /* JSServiceWorkerWindowClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 46EB37C71F97CCCB00B65523 /* JSServiceWorkerWindowClient.h */; };
46EBEA021B7D4D6500BE4941 /* CollectionTraversal.h in Headers */ = {isa = PBXBuildFile; fileRef = 46EBEA011B7D4D5D00BE4941 /* CollectionTraversal.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 46EC444A27AB338900FFCD96 /* SharedWorkerIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 46EC444827AB337F00FFCD96 /* SharedWorkerIdentifier.h */; settings = {ATTRIBUTES = (Private, ); }; };
46ECB6381FD0A3C80088E5AD /* SWClientConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 46ECB6371FD0A3BB0088E5AD /* SWClientConnection.h */; settings = {ATTRIBUTES = (Private, ); }; };
46EF142A1F97B7D800C2A524 /* ServiceWorkerWindowClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 46EF14201F97B7BA00C2A524 /* ServiceWorkerWindowClient.h */; };
46EF142C1F97B7D800C2A524 /* ServiceWorkerClients.h in Headers */ = {isa = PBXBuildFile; fileRef = 46EF14221F97B7BA00C2A524 /* ServiceWorkerClients.h */; };
@@ -9321,6 +9322,7 @@
46EB37C61F97CCCB00B65523 /* JSServiceWorkerWindowClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSServiceWorkerWindowClient.cpp; sourceTree = "<group>"; };
46EB37C71F97CCCB00B65523 /* JSServiceWorkerWindowClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSServiceWorkerWindowClient.h; sourceTree = "<group>"; };
46EBEA011B7D4D5D00BE4941 /* CollectionTraversal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CollectionTraversal.h; sourceTree = "<group>"; };
+ 46EC444827AB337F00FFCD96 /* SharedWorkerIdentifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SharedWorkerIdentifier.h; sourceTree = "<group>"; };
46ECB6361FD0A3BB0088E5AD /* SWClientConnection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SWClientConnection.cpp; sourceTree = "<group>"; };
46ECB6371FD0A3BB0088E5AD /* SWClientConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWClientConnection.h; sourceTree = "<group>"; };
46EF14201F97B7BA00C2A524 /* ServiceWorkerWindowClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ServiceWorkerWindowClient.h; sourceTree = "<group>"; };
@@ -21574,6 +21576,7 @@
46694CE42759448E00E3150E /* SharedWorkerGlobalScope.cpp */,
46694CE12759448C00E3150E /* SharedWorkerGlobalScope.h */,
46694CE02759448C00E3150E /* SharedWorkerGlobalScope.idl */,
+ 46EC444827AB337F00FFCD96 /* SharedWorkerIdentifier.h */,
467A68D3275EA98B009B31C5 /* SharedWorkerManager.cpp */,
467A68D2275EA98A009B31C5 /* SharedWorkerManager.h */,
467A68D1275EA98A009B31C5 /* SharedWorkerScriptLoader.cpp */,
@@ -37187,6 +37190,7 @@
834DFAD01F7DAE5D00C2725B /* SharedStringHash.h in Headers */,
93309EA3099EB78C0056E581 /* SharedTimer.h in Headers */,
41DC04FE27A83C93008CF968 /* SharedVideoFrameInfo.h in Headers */,
+ 46EC444A27AB338900FFCD96 /* SharedWorkerIdentifier.h in Headers */,
467A68DA275EA99C009B31C5 /* SharedWorkerManager.h in Headers */,
467A68D8275EA995009B31C5 /* SharedWorkerScriptLoader.h in Headers */,
467A68D7275EA991009B31C5 /* SharedWorkerThread.h in Headers */,
Modified: trunk/Source/WebCore/platform/Logging.h (289022 => 289023)
--- trunk/Source/WebCore/platform/Logging.h 2022-02-03 02:17:13 UTC (rev 289022)
+++ trunk/Source/WebCore/platform/Logging.h 2022-02-03 02:19:08 UTC (rev 289023)
@@ -109,6 +109,7 @@
M(Selection) \
M(Services) \
M(ServiceWorker) \
+ M(SharedWorker) \
M(SpellingAndGrammar) \
M(SQLDatabase) \
M(Storage) \
Modified: trunk/Source/WebCore/workers/shared/SharedWorkerGlobalScope.cpp (289022 => 289023)
--- trunk/Source/WebCore/workers/shared/SharedWorkerGlobalScope.cpp 2022-02-03 02:17:13 UTC (rev 289022)
+++ trunk/Source/WebCore/workers/shared/SharedWorkerGlobalScope.cpp 2022-02-03 02:19:08 UTC (rev 289023)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 Apple Inc. All rights reserved.
+ * Copyright (C) 2021-2022 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,6 +26,12 @@
#include "config.h"
#include "SharedWorkerGlobalScope.h"
+#include "EventNames.h"
+#include "Logging.h"
+#include "MessageEvent.h"
+#include "SerializedScriptValue.h"
+#include "ServiceWorkerThread.h"
+#include "SharedWorkerThread.h"
#include "WorkerThread.h"
#include <wtf/IsoMallocInlines.h>
@@ -33,17 +39,44 @@
WTF_MAKE_ISO_ALLOCATED_IMPL(SharedWorkerGlobalScope);
-SharedWorkerGlobalScope::SharedWorkerGlobalScope(const String& name, const WorkerParameters& params, Ref<SecurityOrigin>&& origin, WorkerThread& thread, Ref<SecurityOrigin>&& topOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider)
+#define SCOPE_RELEASE_LOG(fmt, ...) RELEASE_LOG(SharedWorker, "%p - [sharedWorkerIdentifier=%" PRIu64 "] SharedWorkerGlobalScope::" fmt, this, this->thread().identifier().toUInt64(), ##__VA_ARGS__)
+
+SharedWorkerGlobalScope::SharedWorkerGlobalScope(const String& name, const WorkerParameters& params, Ref<SecurityOrigin>&& origin, SharedWorkerThread& thread, Ref<SecurityOrigin>&& topOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider)
: WorkerGlobalScope(WorkerThreadType::SharedWorker, params, WTFMove(origin), thread, WTFMove(topOrigin), connectionProxy, socketProvider)
, m_name(name)
{
+ SCOPE_RELEASE_LOG("SharedWorkerGlobalScope:");
relaxAdoptionRequirement();
applyContentSecurityPolicyResponseHeaders(params.contentSecurityPolicyResponseHeaders);
}
+SharedWorkerThread& SharedWorkerGlobalScope::thread()
+{
+ return static_cast<SharedWorkerThread&>(WorkerGlobalScope::thread());
+}
+
void SharedWorkerGlobalScope::close()
{
+ SCOPE_RELEASE_LOG("close:");
thread().stop(nullptr);
}
+// https://html.spec.whatwg.org/multipage/workers.html#dom-sharedworker step 11.5
+void SharedWorkerGlobalScope::postConnectEvent(TransferredMessagePort&& transferredPort, const String& sourceOrigin)
+{
+ SCOPE_RELEASE_LOG("postConnectEvent:");
+ auto value = SerializedScriptValue::create(emptyString());
+ ASSERT(value);
+ auto ports = MessagePort::entanglePorts(*this, { WTFMove(transferredPort) });
+ ASSERT(ports.size() == 1);
+ auto port = ports[0];
+ ASSERT(port);
+ auto event = MessageEvent::create(WTFMove(ports), value.releaseNonNull(), sourceOrigin, { }, port);
+ event->initEvent(eventNames().connectEvent, false, false);
+
+ dispatchEvent(WTFMove(event));
+}
+
+#undef SCOPE_RELEASE_LOG
+
} // namespace WebCore
Modified: trunk/Source/WebCore/workers/shared/SharedWorkerGlobalScope.h (289022 => 289023)
--- trunk/Source/WebCore/workers/shared/SharedWorkerGlobalScope.h 2022-02-03 02:17:13 UTC (rev 289022)
+++ trunk/Source/WebCore/workers/shared/SharedWorkerGlobalScope.h 2022-02-03 02:19:08 UTC (rev 289023)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 Apple Inc. All rights reserved.
+ * Copyright (C) 2021-2022 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -25,11 +25,13 @@
#pragma once
+#include "TransferredMessagePort.h"
#include "WorkerGlobalScope.h"
#include <wtf/IsoMalloc.h>
namespace WebCore {
+class SharedWorkerThread;
struct WorkerParameters;
class SharedWorkerGlobalScope final : public WorkerGlobalScope {
@@ -39,9 +41,13 @@
Type type() const final { return Type::SharedWorker; }
const String& name() const { return m_name; }
+ SharedWorkerThread& thread();
+
+ void postConnectEvent(TransferredMessagePort&&, const String& sourceOrigin);
void close();
+
private:
- SharedWorkerGlobalScope(const String& name, const WorkerParameters&, Ref<SecurityOrigin>&&, WorkerThread&, Ref<SecurityOrigin>&& topOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*);
+ SharedWorkerGlobalScope(const String& name, const WorkerParameters&, Ref<SecurityOrigin>&&, SharedWorkerThread&, Ref<SecurityOrigin>&& topOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*);
EventTargetInterface eventTargetInterface() const final { return SharedWorkerGlobalScopeEventTargetInterfaceType; }
FetchOptions::Destination destination() const final { return FetchOptions::Destination::Sharedworker; }
Copied: trunk/Source/WebCore/workers/shared/SharedWorkerIdentifier.h (from rev 289022, trunk/Source/WebCore/workers/shared/context/SharedWorkerThread.h) (0 => 289023)
--- trunk/Source/WebCore/workers/shared/SharedWorkerIdentifier.h (rev 0)
+++ trunk/Source/WebCore/workers/shared/SharedWorkerIdentifier.h 2022-02-03 02:19:08 UTC (rev 289023)
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2022 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <wtf/ObjectIdentifier.h>
+
+namespace WebCore {
+
+enum SharedWorkerIdentifierType { };
+using SharedWorkerIdentifier = ObjectIdentifier<SharedWorkerIdentifierType>;
+
+} // namespace WebCore
Modified: trunk/Source/WebCore/workers/shared/SharedWorkerManager.cpp (289022 => 289023)
--- trunk/Source/WebCore/workers/shared/SharedWorkerManager.cpp 2022-02-03 02:17:13 UTC (rev 289022)
+++ trunk/Source/WebCore/workers/shared/SharedWorkerManager.cpp 2022-02-03 02:19:08 UTC (rev 289023)
@@ -99,21 +99,7 @@
auto sourceOrigin = downcast<Document>(scriptExecutionContext).securityOrigin().toString();
proxy.thread()->runLoop().postTask([transferredPort = WTFMove(transferredPort), sourceOrigin = WTFMove(sourceOrigin).isolatedCopy()] (auto& scriptExecutionContext) mutable {
- ASSERT(!RunLoop::isMain());
-
- // https://html.spec.whatwg.org/multipage/workers.html#dom-sharedworker step 11.5
- auto serializedScriptValue = SerializedScriptValue::create("");
- ASSERT(serializedScriptValue);
- auto ports = MessagePort::entanglePorts(scriptExecutionContext, { WTFMove(transferredPort) });
- ASSERT(ports.size() == 1);
- auto port = ports[0];
- ASSERT(port);
- auto event = MessageEvent::create(WTFMove(ports), serializedScriptValue.releaseNonNull(), sourceOrigin, { }, port);
- event->initEvent(eventNames().connectEvent, false, false);
-
- RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(is<SharedWorkerGlobalScope>(scriptExecutionContext));
- auto& workerGlobalScope = downcast<SharedWorkerGlobalScope>(scriptExecutionContext);
- workerGlobalScope.dispatchEvent(WTFMove(event));
+ downcast<SharedWorkerGlobalScope>(scriptExecutionContext).postConnectEvent(WTFMove(transferredPort), sourceOrigin);
});
m_loaders.remove(loader.identifier());
Modified: trunk/Source/WebCore/workers/shared/context/SharedWorkerThread.cpp (289022 => 289023)
--- trunk/Source/WebCore/workers/shared/context/SharedWorkerThread.cpp 2022-02-03 02:17:13 UTC (rev 289022)
+++ trunk/Source/WebCore/workers/shared/context/SharedWorkerThread.cpp 2022-02-03 02:19:08 UTC (rev 289023)
@@ -31,14 +31,17 @@
namespace WebCore {
-SharedWorkerThread::SharedWorkerThread(const WorkerParameters& parameters, const ScriptBuffer& sourceCode, WorkerLoaderProxy& loaderProxy, WorkerDebuggerProxy& debuggerProxy, WorkerObjectProxy& objectProxy, WorkerThreadStartMode startMode, const SecurityOrigin& topOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider, JSC::RuntimeFlags runtimeFlags)
+SharedWorkerThread::SharedWorkerThread(SharedWorkerIdentifier identifier, const WorkerParameters& parameters, const ScriptBuffer& sourceCode, WorkerLoaderProxy& loaderProxy, WorkerDebuggerProxy& debuggerProxy, WorkerObjectProxy& objectProxy, WorkerThreadStartMode startMode, const SecurityOrigin& topOrigin, IDBClient::IDBConnectionProxy* connectionProxy, SocketProvider* socketProvider, JSC::RuntimeFlags runtimeFlags)
: WorkerThread(parameters, sourceCode, loaderProxy, debuggerProxy, objectProxy, startMode, topOrigin, connectionProxy, socketProvider, runtimeFlags)
+ , m_identifier(identifier)
, m_name(parameters.name.isolatedCopy())
{
+ RELEASE_LOG(SharedWorker, "%p - SharedWorkerThread::SharedWorkerThread: m_identifier=%" PRIu64, this, m_identifier.toUInt64());
}
Ref<WorkerGlobalScope> SharedWorkerThread::createWorkerGlobalScope(const WorkerParameters& parameters, Ref<SecurityOrigin>&& origin, Ref<SecurityOrigin>&& topOrigin)
{
+ RELEASE_LOG(SharedWorker, "%p - SharedWorkerThread::createWorkerGlobalScope: m_identifier=%" PRIu64, this, m_identifier.toUInt64());
return SharedWorkerGlobalScope::create(std::exchange(m_name, { }), parameters, WTFMove(origin), *this, WTFMove(topOrigin), idbConnectionProxy(), socketProvider());
}
Modified: trunk/Source/WebCore/workers/shared/context/SharedWorkerThread.h (289022 => 289023)
--- trunk/Source/WebCore/workers/shared/context/SharedWorkerThread.h 2022-02-03 02:17:13 UTC (rev 289022)
+++ trunk/Source/WebCore/workers/shared/context/SharedWorkerThread.h 2022-02-03 02:19:08 UTC (rev 289023)
@@ -25,6 +25,7 @@
#pragma once
+#include "SharedWorkerIdentifier.h"
#include "WorkerThread.h"
namespace WebCore {
@@ -34,12 +35,16 @@
class SharedWorkerThread : public WorkerThread {
public:
template<typename... Args> static Ref<SharedWorkerThread> create(Args&&... args) { return adoptRef(*new SharedWorkerThread(std::forward<Args>(args)...)); }
+
+ SharedWorkerIdentifier identifier() const { return m_identifier; }
+
private:
- SharedWorkerThread(const WorkerParameters&, const ScriptBuffer& sourceCode, WorkerLoaderProxy&, WorkerDebuggerProxy&, WorkerObjectProxy&, WorkerThreadStartMode, const SecurityOrigin& topOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*, JSC::RuntimeFlags);
+ SharedWorkerThread(SharedWorkerIdentifier, const WorkerParameters&, const ScriptBuffer& sourceCode, WorkerLoaderProxy&, WorkerDebuggerProxy&, WorkerObjectProxy&, WorkerThreadStartMode, const SecurityOrigin& topOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*, JSC::RuntimeFlags);
Ref<WorkerGlobalScope> createWorkerGlobalScope(const WorkerParameters&, Ref<SecurityOrigin>&&, Ref<SecurityOrigin>&& topOrigin) final;
ASCIILiteral threadName() const final { return "WebCore: SharedWorker"_s; }
+ SharedWorkerIdentifier m_identifier;
String m_name;
};
Modified: trunk/Source/WebCore/workers/shared/context/SharedWorkerThreadProxy.cpp (289022 => 289023)
--- trunk/Source/WebCore/workers/shared/context/SharedWorkerThreadProxy.cpp 2022-02-03 02:17:13 UTC (rev 289022)
+++ trunk/Source/WebCore/workers/shared/context/SharedWorkerThreadProxy.cpp 2022-02-03 02:19:08 UTC (rev 289023)
@@ -69,7 +69,7 @@
};
if (!m_workerThread) {
- m_workerThread = SharedWorkerThread::create(parameters, scriptBuffer, *this, *this, *this, WorkerThreadStartMode::Normal, m_scriptExecutionContext->topOrigin(), m_scriptExecutionContext->idbConnectionProxy(), m_scriptExecutionContext->socketProvider(), runtimeFlags);
+ m_workerThread = SharedWorkerThread::create(SharedWorkerIdentifier::generate(), parameters, scriptBuffer, *this, *this, *this, WorkerThreadStartMode::Normal, m_scriptExecutionContext->topOrigin(), m_scriptExecutionContext->idbConnectionProxy(), m_scriptExecutionContext->socketProvider(), runtimeFlags);
m_workerThread->start();
}
}
@@ -118,6 +118,11 @@
});
}
+SharedWorkerIdentifier SharedWorkerThreadProxy::identifier() const
+{
+ return m_workerThread->identifier();
+}
+
void SharedWorkerThreadProxy::notifyNetworkStateChange(bool isOnline)
{
if (m_askedToTerminate)
Modified: trunk/Source/WebCore/workers/shared/context/SharedWorkerThreadProxy.h (289022 => 289023)
--- trunk/Source/WebCore/workers/shared/context/SharedWorkerThreadProxy.h 2022-02-03 02:17:13 UTC (rev 289022)
+++ trunk/Source/WebCore/workers/shared/context/SharedWorkerThreadProxy.h 2022-02-03 02:19:08 UTC (rev 289023)
@@ -25,6 +25,7 @@
#pragma once
+#include "SharedWorkerIdentifier.h"
#include "WorkerDebuggerProxy.h"
#include "WorkerGlobalScopeProxy.h"
#include "WorkerLoaderProxy.h"
@@ -41,6 +42,7 @@
public:
template<typename... Args> static SharedWorkerThreadProxy& create(Args&&... args) { return *new SharedWorkerThreadProxy(std::forward<Args>(args)...); }
+ SharedWorkerIdentifier identifier() const;
SharedWorkerThread* thread() { return m_workerThread.get(); }
void startWorkerGlobalScope(const URL& scriptURL, const String& name, const String& userAgent, bool isOnline, const ScriptBuffer& sourceCode, const ContentSecurityPolicyResponseHeaders&, bool shouldBypassMainWorldContentSecurityPolicy, const CrossOriginEmbedderPolicy&, MonotonicTime timeOrigin, ReferrerPolicy, WorkerType, FetchRequestCredentials, JSC::RuntimeFlags) final;