<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[286528] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/286528">286528</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2021-12-04 01:13:50 -0800 (Sat, 04 Dec 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>Prepare for SharedWorker implementation
https://bugs.webkit.org/show_bug.cgi?id=233848

Patch by Alex Christensen <achristensen@webkit.org> on 2021-12-04
Reviewed by Chris Dumez.

This splits off the parts of bug 230382 that don't change behavior.

* workers/AbstractWorker.cpp:
(WebCore::AbstractWorker::workerFetchOptions):
* workers/AbstractWorker.h:
* workers/DedicatedWorkerThread.h:
* workers/Worker.cpp:
(WebCore::Worker::Worker):
(WebCore::Worker::create):
(WebCore::Worker::notifyFinished):
* workers/Worker.h:
* workers/WorkerOptions.h:
* workers/WorkerOrWorkletScriptController.cpp:
* workers/WorkerOrWorkletScriptController.h:
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::createThread):
* workers/WorkerThread.h:
(WebCore::WorkerThread::isServiceWorkerThread const): Deleted.
* workers/service/context/ServiceWorkerThread.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreworkersAbstractWorkercpp">trunk/Source/WebCore/workers/AbstractWorker.cpp</a></li>
<li><a href="#trunkSourceWebCoreworkersAbstractWorkerh">trunk/Source/WebCore/workers/AbstractWorker.h</a></li>
<li><a href="#trunkSourceWebCoreworkersDedicatedWorkerThreadh">trunk/Source/WebCore/workers/DedicatedWorkerThread.h</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkercpp">trunk/Source/WebCore/workers/Worker.cpp</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerh">trunk/Source/WebCore/workers/Worker.h</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerOptionsh">trunk/Source/WebCore/workers/WorkerOptions.h</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerOrWorkletScriptControllercpp">trunk/Source/WebCore/workers/WorkerOrWorkletScriptController.cpp</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerOrWorkletScriptControllerh">trunk/Source/WebCore/workers/WorkerOrWorkletScriptController.h</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerThreadcpp">trunk/Source/WebCore/workers/WorkerThread.cpp</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerThreadh">trunk/Source/WebCore/workers/WorkerThread.h</a></li>
<li><a href="#trunkSourceWebCoreworkersservicecontextServiceWorkerThreadh">trunk/Source/WebCore/workers/service/context/ServiceWorkerThread.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (286527 => 286528)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-12-04 08:28:31 UTC (rev 286527)
+++ trunk/Source/WebCore/ChangeLog      2021-12-04 09:13:50 UTC (rev 286528)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2021-12-04  Alex Christensen  <achristensen@webkit.org>
+
+        Prepare for SharedWorker implementation
+        https://bugs.webkit.org/show_bug.cgi?id=233848
+
+        Reviewed by Chris Dumez.
+
+        This splits off the parts of bug 230382 that don't change behavior.
+
+        * workers/AbstractWorker.cpp:
+        (WebCore::AbstractWorker::workerFetchOptions):
+        * workers/AbstractWorker.h:
+        * workers/DedicatedWorkerThread.h:
+        * workers/Worker.cpp:
+        (WebCore::Worker::Worker):
+        (WebCore::Worker::create):
+        (WebCore::Worker::notifyFinished):
+        * workers/Worker.h:
+        * workers/WorkerOptions.h:
+        * workers/WorkerOrWorkletScriptController.cpp:
+        * workers/WorkerOrWorkletScriptController.h:
+        * workers/WorkerThread.cpp:
+        (WebCore::WorkerThread::createThread):
+        * workers/WorkerThread.h:
+        (WebCore::WorkerThread::isServiceWorkerThread const): Deleted.
+        * workers/service/context/ServiceWorkerThread.h:
+
</ins><span class="cx"> 2021-12-03  Said Abou-Hallawa  <said@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [GPU Process] (REGRESSION r285597): Fix SVGFilter clamping calculation
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersAbstractWorkercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/AbstractWorker.cpp (286527 => 286528)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/AbstractWorker.cpp  2021-12-04 08:28:31 UTC (rev 286527)
+++ trunk/Source/WebCore/workers/AbstractWorker.cpp     2021-12-04 09:13:50 UTC (rev 286528)
</span><span class="lines">@@ -32,8 +32,10 @@
</span><span class="cx"> #include "AbstractWorker.h"
</span><span class="cx"> 
</span><span class="cx"> #include "ContentSecurityPolicy.h"
</span><ins>+#include "FetchOptions.h"
</ins><span class="cx"> #include "ScriptExecutionContext.h"
</span><span class="cx"> #include "SecurityOrigin.h"
</span><ins>+#include "WorkerOptions.h"
</ins><span class="cx"> #include <wtf/IsoMallocInlines.h>
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -40,6 +42,20 @@
</span><span class="cx"> 
</span><span class="cx"> WTF_MAKE_ISO_ALLOCATED_IMPL(AbstractWorker);
</span><span class="cx"> 
</span><ins>+FetchOptions AbstractWorker::workerFetchOptions(const WorkerOptions& options)
+{
+    FetchOptions fetchOptions;
+    fetchOptions.mode = FetchOptions::Mode::SameOrigin;
+    if (options.type == WorkerType::Module)
+        fetchOptions.credentials = options.credentials;
+    else
+        fetchOptions.credentials = FetchOptions::Credentials::SameOrigin;
+    fetchOptions.cache = FetchOptions::Cache::Default;
+    fetchOptions.redirect = FetchOptions::Redirect::Follow;
+    fetchOptions.destination = FetchOptions::Destination::Worker;
+    return fetchOptions;
+}
+
</ins><span class="cx"> ExceptionOr<URL> AbstractWorker::resolveURL(const String& url, bool shouldBypassMainWorldContentSecurityPolicy)
</span><span class="cx"> {
</span><span class="cx">     auto& context = *scriptExecutionContext();
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersAbstractWorkerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/AbstractWorker.h (286527 => 286528)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/AbstractWorker.h    2021-12-04 08:28:31 UTC (rev 286527)
+++ trunk/Source/WebCore/workers/AbstractWorker.h       2021-12-04 09:13:50 UTC (rev 286528)
</span><span class="lines">@@ -35,6 +35,9 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+struct FetchOptions;
+struct WorkerOptions;
+
</ins><span class="cx"> class AbstractWorker : public RefCounted<AbstractWorker>, public EventTargetWithInlineData {
</span><span class="cx">     WTF_MAKE_ISO_ALLOCATED(AbstractWorker);
</span><span class="cx"> public:
</span><span class="lines">@@ -41,6 +44,8 @@
</span><span class="cx">     using RefCounted::ref;
</span><span class="cx">     using RefCounted::deref;
</span><span class="cx"> 
</span><ins>+    static FetchOptions workerFetchOptions(const WorkerOptions&);
+
</ins><span class="cx"> protected:
</span><span class="cx">     AbstractWorker() = default;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersDedicatedWorkerThreadh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/DedicatedWorkerThread.h (286527 => 286528)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/DedicatedWorkerThread.h     2021-12-04 08:28:31 UTC (rev 286527)
+++ trunk/Source/WebCore/workers/DedicatedWorkerThread.h        2021-12-04 09:13:50 UTC (rev 286528)
</span><span class="lines">@@ -57,6 +57,8 @@
</span><span class="cx"> private:
</span><span class="cx">     DedicatedWorkerThread(const WorkerParameters&, const ScriptBuffer& sourceCode, WorkerLoaderProxy&, WorkerDebuggerProxy&, WorkerObjectProxy&, WorkerThreadStartMode, const SecurityOrigin& topOrigin, IDBClient::IDBConnectionProxy*, SocketProvider*, JSC::RuntimeFlags);
</span><span class="cx"> 
</span><ins>+    ASCIILiteral threadName() const final { return "WebCore: Worker"_s; }
+
</ins><span class="cx">     WorkerObjectProxy& m_workerObjectProxy;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/Worker.cpp (286527 => 286528)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/Worker.cpp  2021-12-04 08:28:31 UTC (rev 286527)
+++ trunk/Source/WebCore/workers/Worker.cpp     2021-12-04 09:13:50 UTC (rev 286528)
</span><span class="lines">@@ -43,7 +43,6 @@
</span><span class="cx"> #include "SecurityOrigin.h"
</span><span class="cx"> #include "StructuredSerializeOptions.h"
</span><span class="cx"> #include "WorkerGlobalScopeProxy.h"
</span><del>-#include "WorkerOptions.h"
</del><span class="cx"> #include "WorkerScriptLoader.h"
</span><span class="cx"> #include "WorkerThread.h"
</span><span class="cx"> #include <JavaScriptCore/IdentifiersFactory.h>
</span><span class="lines">@@ -70,14 +69,12 @@
</span><span class="cx">         worker->notifyNetworkStateChange(isOnLine);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline Worker::Worker(ScriptExecutionContext& context, JSC::RuntimeFlags runtimeFlags, const WorkerOptions& options)
</del><ins>+Worker::Worker(ScriptExecutionContext& context, JSC::RuntimeFlags runtimeFlags, WorkerOptions&& options)
</ins><span class="cx">     : ActiveDOMObject(&context)
</span><del>-    , m_name(options.name)
</del><ins>+    , m_options(WTFMove(options))
</ins><span class="cx">     , m_identifier("worker:" + Inspector::IdentifiersFactory::createIdentifier())
</span><span class="cx">     , m_contextProxy(WorkerGlobalScopeProxy::create(*this))
</span><span class="cx">     , m_runtimeFlags(runtimeFlags)
</span><del>-    , m_type(options.type)
-    , m_credentials(options.credentials)
</del><span class="cx"> {
</span><span class="cx">     static bool addedListener;
</span><span class="cx">     if (!addedListener) {
</span><span class="lines">@@ -89,7 +86,7 @@
</span><span class="cx">     ASSERT_UNUSED(addResult, addResult.isNewEntry);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ExceptionOr<Ref<Worker>> Worker::create(ScriptExecutionContext& context, JSC::RuntimeFlags runtimeFlags, const String& url, const WorkerOptions& options)
</del><ins>+ExceptionOr<Ref<Worker>> Worker::create(ScriptExecutionContext& context, JSC::RuntimeFlags runtimeFlags, const String& url, WorkerOptions&& options)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(isMainThread());
</span><span class="cx"> 
</span><span class="lines">@@ -96,7 +93,7 @@
</span><span class="cx">     // We don't currently support nested workers, so workers can only be created from documents.
</span><span class="cx">     ASSERT_WITH_SECURITY_IMPLICATION(context.isDocument());
</span><span class="cx"> 
</span><del>-    auto worker = adoptRef(*new Worker(context, runtimeFlags, options));
</del><ins>+    auto worker = adoptRef(*new Worker(context, runtimeFlags, WTFMove(options)));
</ins><span class="cx"> 
</span><span class="cx">     worker->suspendIfNeeded();
</span><span class="cx"> 
</span><span class="lines">@@ -116,16 +113,7 @@
</span><span class="cx">     ResourceRequest request { scriptURL.releaseReturnValue() };
</span><span class="cx">     request.setInitiatorIdentifier(worker->m_identifier);
</span><span class="cx"> 
</span><del>-    FetchOptions fetchOptions;
-    fetchOptions.mode = FetchOptions::Mode::SameOrigin;
-    if (worker->m_type == WorkerType::Module)
-        fetchOptions.credentials = worker->m_credentials;
-    else
-        fetchOptions.credentials = FetchOptions::Credentials::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.get(), WorkerRunLoop::defaultMode());
</del><ins>+    worker->m_scriptLoader->loadAsynchronously(context, WTFMove(request), workerFetchOptions(worker->m_options), contentSecurityPolicyEnforcement, ServiceWorkersMode::All, worker.get(), WorkerRunLoop::defaultMode());
</ins><span class="cx"> 
</span><span class="cx">     return worker;
</span><span class="cx"> }
</span><span class="lines">@@ -230,7 +218,7 @@
</span><span class="cx">         if (m_scriptLoader->url().hasFragmentIdentifier())
</span><span class="cx">             responseURL.setFragmentIdentifier(m_scriptLoader->url().fragmentIdentifier());
</span><span class="cx">     }
</span><del>-    m_contextProxy.startWorkerGlobalScope(responseURL, m_name, context->userAgent(responseURL), isOnline, m_scriptLoader->script(), contentSecurityPolicyResponseHeaders, m_shouldBypassMainWorldContentSecurityPolicy, m_scriptLoader->crossOriginEmbedderPolicy(), m_workerCreationTime, referrerPolicy, m_type, m_credentials, m_runtimeFlags);
</del><ins>+    m_contextProxy.startWorkerGlobalScope(responseURL, m_options.name, context->userAgent(responseURL), isOnline, m_scriptLoader->script(), contentSecurityPolicyResponseHeaders, m_shouldBypassMainWorldContentSecurityPolicy, m_scriptLoader->crossOriginEmbedderPolicy(), m_workerCreationTime, referrerPolicy, m_options.type, m_options.credentials, m_runtimeFlags);
</ins><span class="cx">     InspectorInstrumentation::scriptImported(*context, m_scriptLoader->identifier(), m_scriptLoader->script().toString());
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/Worker.h (286527 => 286528)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/Worker.h    2021-12-04 08:28:31 UTC (rev 286527)
+++ trunk/Source/WebCore/workers/Worker.h       2021-12-04 09:13:50 UTC (rev 286528)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include "EventTarget.h"
</span><span class="cx"> #include "FetchRequestCredentials.h"
</span><span class="cx"> #include "MessagePort.h"
</span><ins>+#include "WorkerOptions.h"
</ins><span class="cx"> #include "WorkerScriptLoaderClient.h"
</span><span class="cx"> #include "WorkerType.h"
</span><span class="cx"> #include <JavaScriptCore/RuntimeFlags.h>
</span><span class="lines">@@ -58,7 +59,7 @@
</span><span class="cx"> class Worker final : public AbstractWorker, public ActiveDOMObject, private WorkerScriptLoaderClient {
</span><span class="cx">     WTF_MAKE_ISO_ALLOCATED(Worker);
</span><span class="cx"> public:
</span><del>-    static ExceptionOr<Ref<Worker>> create(ScriptExecutionContext&, JSC::RuntimeFlags, const String& url, const WorkerOptions&);
</del><ins>+    static ExceptionOr<Ref<Worker>> create(ScriptExecutionContext&, JSC::RuntimeFlags, const String& url, WorkerOptions&&);
</ins><span class="cx">     virtual ~Worker();
</span><span class="cx"> 
</span><span class="cx">     ExceptionOr<void> postMessage(JSC::JSGlobalObject&, JSC::JSValue message, StructuredSerializeOptions&&);
</span><span class="lines">@@ -67,7 +68,7 @@
</span><span class="cx">     bool wasTerminated() const { return m_wasTerminated; }
</span><span class="cx"> 
</span><span class="cx">     String identifier() const { return m_identifier; }
</span><del>-    const String& name() const { return m_name; }
</del><ins>+    const String& name() const { return m_options.name; }
</ins><span class="cx"> 
</span><span class="cx">     ScriptExecutionContext* scriptExecutionContext() const final { return ActiveDOMObject::scriptExecutionContext(); }
</span><span class="cx"> 
</span><span class="lines">@@ -78,10 +79,10 @@
</span><span class="cx">     void postTaskToWorkerGlobalScope(Function<void(ScriptExecutionContext&)>&&);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    WorkerType type() const { return m_type; }
</del><ins>+    WorkerType type() const { return m_options.type; }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    explicit Worker(ScriptExecutionContext&, JSC::RuntimeFlags, const WorkerOptions&);
</del><ins>+    explicit Worker(ScriptExecutionContext&, JSC::RuntimeFlags, WorkerOptions&&);
</ins><span class="cx"> 
</span><span class="cx">     EventTargetInterface eventTargetInterface() const final { return WorkerEventTargetInterfaceType; }
</span><span class="cx"> 
</span><span class="lines">@@ -100,7 +101,7 @@
</span><span class="cx">     static void networkStateChanged(bool isOnLine);
</span><span class="cx"> 
</span><span class="cx">     RefPtr<WorkerScriptLoader> m_scriptLoader;
</span><del>-    String m_name;
</del><ins>+    const WorkerOptions m_options;
</ins><span class="cx">     String m_identifier;
</span><span class="cx">     WorkerGlobalScopeProxy& m_contextProxy; // The proxy outlives the worker to perform thread shutdown.
</span><span class="cx">     std::optional<ContentSecurityPolicyResponseHeaders> m_contentSecurityPolicyResponseHeaders;
</span><span class="lines">@@ -113,8 +114,6 @@
</span><span class="cx"> #if ENABLE(WEB_RTC)
</span><span class="cx">     HashSet<String> m_transformers;
</span><span class="cx"> #endif
</span><del>-    WorkerType m_type { WorkerType::Classic };
-    FetchRequestCredentials m_credentials { FetchRequestCredentials::SameOrigin };
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerOptionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/WorkerOptions.h (286527 => 286528)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerOptions.h     2021-12-04 08:28:31 UTC (rev 286527)
+++ trunk/Source/WebCore/workers/WorkerOptions.h        2021-12-04 09:13:50 UTC (rev 286528)
</span><span class="lines">@@ -31,8 +31,8 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> struct WorkerOptions {
</span><del>-    WorkerType type;
-    FetchRequestCredentials credentials;
</del><ins>+    WorkerType type { WorkerType::Classic };
+    FetchRequestCredentials credentials { FetchRequestCredentials::SameOrigin };
</ins><span class="cx">     String name;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerOrWorkletScriptControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/WorkerOrWorkletScriptController.cpp (286527 => 286528)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerOrWorkletScriptController.cpp 2021-12-04 08:28:31 UTC (rev 286527)
+++ trunk/Source/WebCore/workers/WorkerOrWorkletScriptController.cpp    2021-12-04 09:13:50 UTC (rev 286528)
</span><span class="lines">@@ -82,11 +82,6 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WorkerOrWorkletScriptController::WorkerOrWorkletScriptController(WorkerThreadType type, WorkerOrWorkletGlobalScope* globalScope)
-    : WorkerOrWorkletScriptController(type, JSC::VM::create(), globalScope)
-{
-}
-
</del><span class="cx"> WorkerOrWorkletScriptController::~WorkerOrWorkletScriptController()
</span><span class="cx"> {
</span><span class="cx">     JSLockHolder lock(vm());
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerOrWorkletScriptControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/WorkerOrWorkletScriptController.h (286527 => 286528)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerOrWorkletScriptController.h   2021-12-04 08:28:31 UTC (rev 286527)
+++ trunk/Source/WebCore/workers/WorkerOrWorkletScriptController.h      2021-12-04 09:13:50 UTC (rev 286528)
</span><span class="lines">@@ -56,7 +56,6 @@
</span><span class="cx">     WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><span class="cx">     WorkerOrWorkletScriptController(WorkerThreadType, Ref<JSC::VM>&&, WorkerOrWorkletGlobalScope*);
</span><del>-    explicit WorkerOrWorkletScriptController(WorkerThreadType, WorkerOrWorkletGlobalScope*);
</del><span class="cx">     ~WorkerOrWorkletScriptController();
</span><span class="cx"> 
</span><span class="cx">     void releaseHeapAccess();
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerThreadcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/WorkerThread.cpp (286527 => 286528)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerThread.cpp    2021-12-04 08:28:31 UTC (rev 286527)
+++ trunk/Source/WebCore/workers/WorkerThread.cpp       2021-12-04 09:13:50 UTC (rev 286528)
</span><span class="lines">@@ -116,7 +116,7 @@
</span><span class="cx">         return Thread::current();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return Thread::create(isServiceWorkerThread() ? "WebCore: Service Worker" : "WebCore: Worker", [this] {
</del><ins>+    return Thread::create(threadName(), [this] {
</ins><span class="cx">         workerOrWorkletThread();
</span><span class="cx">     }, ThreadType::JavaScript);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerThreadh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/WorkerThread.h (286527 => 286528)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerThread.h      2021-12-04 08:28:31 UTC (rev 286527)
+++ trunk/Source/WebCore/workers/WorkerThread.h 2021-12-04 09:13:50 UTC (rev 286528)
</span><span class="lines">@@ -107,7 +107,7 @@
</span><span class="cx">     SocketProvider* socketProvider();
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    virtual bool isServiceWorkerThread() const { return false; }
</del><ins>+    virtual ASCIILiteral threadName() const = 0;
</ins><span class="cx"> 
</span><span class="cx">     virtual void finishedEvaluatingScript() { }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersservicecontextServiceWorkerThreadh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/service/context/ServiceWorkerThread.h (286527 => 286528)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/service/context/ServiceWorkerThread.h       2021-12-04 08:28:31 UTC (rev 286527)
+++ trunk/Source/WebCore/workers/service/context/ServiceWorkerThread.h  2021-12-04 09:13:50 UTC (rev 286528)
</span><span class="lines">@@ -87,7 +87,7 @@
</span><span class="cx"> private:
</span><span class="cx">     WEBCORE_EXPORT ServiceWorkerThread(ServiceWorkerContextData&&, ServiceWorkerData&&, String&& userAgent, WorkerThreadMode, const Settings::Values&, WorkerLoaderProxy&, WorkerDebuggerProxy&, IDBClient::IDBConnectionProxy*, SocketProvider*);
</span><span class="cx"> 
</span><del>-    bool isServiceWorkerThread() const final { return true; }
</del><ins>+    ASCIILiteral threadName() const final { return "WebCore: ServiceWorker"_s; }
</ins><span class="cx">     void finishedEvaluatingScript() final;
</span><span class="cx"> 
</span><span class="cx">     void finishedFiringInstallEvent(bool hasRejectedAnyPromise);
</span></span></pre>
</div>
</div>

</body>
</html>