Diff
Modified: trunk/Source/WebCore/ChangeLog (250194 => 250195)
--- trunk/Source/WebCore/ChangeLog 2019-09-22 05:17:00 UTC (rev 250194)
+++ trunk/Source/WebCore/ChangeLog 2019-09-22 05:17:38 UTC (rev 250195)
@@ -1,5 +1,26 @@
2019-09-21 Chris Dumez <[email protected]>
+ ServiceWorkerContextData does not need a sessionID
+ https://bugs.webkit.org/show_bug.cgi?id=202087
+
+ Reviewed by Alex Christensen.
+
+ * workers/service/ServiceWorkerContextData.cpp:
+ (WebCore::ServiceWorkerContextData::isolatedCopy const):
+ * workers/service/ServiceWorkerContextData.h:
+ (WebCore::ServiceWorkerContextData::encode const):
+ (WebCore::ServiceWorkerContextData::decode):
+ * workers/service/server/RegistrationDatabase.cpp:
+ (WebCore::RegistrationDatabase::RegistrationDatabase):
+ (WebCore::RegistrationDatabase::importRecords):
+ * workers/service/server/RegistrationDatabase.h:
+ * workers/service/server/SWServer.cpp:
+ (WebCore::SWServer::updateWorker):
+ * workers/service/server/SWServerWorker.cpp:
+ (WebCore::SWServerWorker::contextData const):
+
+2019-09-21 Chris Dumez <[email protected]>
+
WebIDBConnectionToClient does not need to be RefCounted or a SessionID
https://bugs.webkit.org/show_bug.cgi?id=202089
Modified: trunk/Source/WebCore/workers/service/ServiceWorkerContextData.cpp (250194 => 250195)
--- trunk/Source/WebCore/workers/service/ServiceWorkerContextData.cpp 2019-09-22 05:17:00 UTC (rev 250194)
+++ trunk/Source/WebCore/workers/service/ServiceWorkerContextData.cpp 2019-09-22 05:17:38 UTC (rev 250195)
@@ -33,7 +33,7 @@
ServiceWorkerContextData ServiceWorkerContextData::isolatedCopy() const
{
- return { jobDataIdentifier, registration.isolatedCopy(), serviceWorkerIdentifier, script.isolatedCopy(), contentSecurityPolicy.isolatedCopy(), referrerPolicy.isolatedCopy(), scriptURL.isolatedCopy(), workerType, sessionID, loadedFromDisk, crossThreadCopy(scriptResourceMap) };
+ return { jobDataIdentifier, registration.isolatedCopy(), serviceWorkerIdentifier, script.isolatedCopy(), contentSecurityPolicy.isolatedCopy(), referrerPolicy.isolatedCopy(), scriptURL.isolatedCopy(), workerType, loadedFromDisk, crossThreadCopy(scriptResourceMap) };
}
} // namespace WebCore
Modified: trunk/Source/WebCore/workers/service/ServiceWorkerContextData.h (250194 => 250195)
--- trunk/Source/WebCore/workers/service/ServiceWorkerContextData.h 2019-09-22 05:17:00 UTC (rev 250194)
+++ trunk/Source/WebCore/workers/service/ServiceWorkerContextData.h 2019-09-22 05:17:38 UTC (rev 250195)
@@ -30,7 +30,6 @@
#include "ServiceWorkerJobDataIdentifier.h"
#include "ServiceWorkerRegistrationData.h"
#include "WorkerType.h"
-#include <pal/SessionID.h>
#include <wtf/HashMap.h>
#include <wtf/URL.h>
#include <wtf/URLHash.h>
@@ -77,7 +76,6 @@
String referrerPolicy;
URL scriptURL;
WorkerType workerType;
- PAL::SessionID sessionID;
bool loadedFromDisk;
HashMap<URL, ImportedScript> scriptResourceMap;
@@ -90,7 +88,7 @@
template<class Encoder>
void ServiceWorkerContextData::encode(Encoder& encoder) const
{
- encoder << jobDataIdentifier << registration << serviceWorkerIdentifier << script << contentSecurityPolicy << referrerPolicy << scriptURL << workerType << sessionID << loadedFromDisk;
+ encoder << jobDataIdentifier << registration << serviceWorkerIdentifier << script << contentSecurityPolicy << referrerPolicy << scriptURL << workerType << loadedFromDisk;
encoder << scriptResourceMap;
}
@@ -131,11 +129,6 @@
if (!decoder.decodeEnum(workerType))
return WTF::nullopt;
- Optional<PAL::SessionID> sessionID;
- decoder >> sessionID;
- if (!sessionID)
- return WTF::nullopt;
-
bool loadedFromDisk;
if (!decoder.decode(loadedFromDisk))
return WTF::nullopt;
@@ -144,7 +137,7 @@
if (!decoder.decode(scriptResourceMap))
return WTF::nullopt;
- return {{ WTFMove(*jobDataIdentifier), WTFMove(*registration), WTFMove(*serviceWorkerIdentifier), WTFMove(script), WTFMove(contentSecurityPolicy), WTFMove(referrerPolicy), WTFMove(scriptURL), workerType, *sessionID, loadedFromDisk, WTFMove(scriptResourceMap) }};
+ return {{ WTFMove(*jobDataIdentifier), WTFMove(*registration), WTFMove(*serviceWorkerIdentifier), WTFMove(script), WTFMove(contentSecurityPolicy), WTFMove(referrerPolicy), WTFMove(scriptURL), workerType, loadedFromDisk, WTFMove(scriptResourceMap) }};
}
} // namespace WebCore
Modified: trunk/Source/WebCore/workers/service/server/RegistrationDatabase.cpp (250194 => 250195)
--- trunk/Source/WebCore/workers/service/server/RegistrationDatabase.cpp 2019-09-22 05:17:00 UTC (rev 250194)
+++ trunk/Source/WebCore/workers/service/server/RegistrationDatabase.cpp 2019-09-22 05:17:38 UTC (rev 250195)
@@ -96,7 +96,6 @@
RegistrationDatabase::RegistrationDatabase(RegistrationStore& store, String&& databaseDirectory)
: m_workQueue(WorkQueue::create("ServiceWorker I/O Thread", WorkQueue::Type::Serial))
, m_store(makeWeakPtr(store))
- , m_sessionID(m_store->server().sessionID())
, m_databaseDirectory(WTFMove(databaseDirectory))
, m_databaseFilePath(FileSystem::pathByAppendingComponent(m_databaseDirectory, databaseFilename()))
{
@@ -418,7 +417,7 @@
auto registrationIdentifier = ServiceWorkerRegistrationIdentifier::generate();
auto serviceWorkerData = ServiceWorkerData { workerIdentifier, scriptURL, ServiceWorkerState::Activated, *workerType, registrationIdentifier };
auto registration = ServiceWorkerRegistrationData { WTFMove(*key), registrationIdentifier, URL(originURL, scopePath), *updateViaCache, lastUpdateCheckTime, WTF::nullopt, WTF::nullopt, WTFMove(serviceWorkerData) };
- auto contextData = ServiceWorkerContextData { WTF::nullopt, WTFMove(registration), workerIdentifier, WTFMove(script), WTFMove(contentSecurityPolicy), WTFMove(referrerPolicy), WTFMove(scriptURL), *workerType, m_sessionID, true, WTFMove(scriptResourceMap) };
+ auto contextData = ServiceWorkerContextData { WTF::nullopt, WTFMove(registration), workerIdentifier, WTFMove(script), WTFMove(contentSecurityPolicy), WTFMove(referrerPolicy), WTFMove(scriptURL), *workerType, true, WTFMove(scriptResourceMap) };
callOnMainThread([protectedThis = makeRef(*this), contextData = contextData.isolatedCopy()]() mutable {
protectedThis->addRegistrationToStore(WTFMove(contextData));
Modified: trunk/Source/WebCore/workers/service/server/RegistrationDatabase.h (250194 => 250195)
--- trunk/Source/WebCore/workers/service/server/RegistrationDatabase.h 2019-09-22 05:17:00 UTC (rev 250194)
+++ trunk/Source/WebCore/workers/service/server/RegistrationDatabase.h 2019-09-22 05:17:38 UTC (rev 250195)
@@ -79,7 +79,6 @@
Ref<WorkQueue> m_workQueue;
WeakPtr<RegistrationStore> m_store;
- PAL::SessionID m_sessionID;
String m_databaseDirectory;
String m_databaseFilePath;
std::unique_ptr<SQLiteDatabase> m_database;
Modified: trunk/Source/WebCore/workers/service/server/SWServer.cpp (250194 => 250195)
--- trunk/Source/WebCore/workers/service/server/SWServer.cpp 2019-09-22 05:17:00 UTC (rev 250194)
+++ trunk/Source/WebCore/workers/service/server/SWServer.cpp 2019-09-22 05:17:38 UTC (rev 250195)
@@ -530,7 +530,7 @@
void SWServer::updateWorker(Connection&, const ServiceWorkerJobDataIdentifier& jobDataIdentifier, SWServerRegistration& registration, const URL& url, const String& script, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicy, const String& referrerPolicy, WorkerType type, HashMap<URL, ServiceWorkerContextData::ImportedScript>&& scriptResourceMap)
{
- tryInstallContextData({ jobDataIdentifier, registration.data(), ServiceWorkerIdentifier::generate(), script, contentSecurityPolicy, referrerPolicy, url, type, sessionID(), false, WTFMove(scriptResourceMap) });
+ tryInstallContextData({ jobDataIdentifier, registration.data(), ServiceWorkerIdentifier::generate(), script, contentSecurityPolicy, referrerPolicy, url, type, false, WTFMove(scriptResourceMap) });
}
void SWServer::tryInstallContextData(ServiceWorkerContextData&& data)
Modified: trunk/Source/WebCore/workers/service/server/SWServerWorker.cpp (250194 => 250195)
--- trunk/Source/WebCore/workers/service/server/SWServerWorker.cpp 2019-09-22 05:17:00 UTC (rev 250194)
+++ trunk/Source/WebCore/workers/service/server/SWServerWorker.cpp 2019-09-22 05:17:38 UTC (rev 250195)
@@ -79,7 +79,7 @@
{
ASSERT(m_registration);
- return { WTF::nullopt, m_registration->data(), m_data.identifier, m_script, m_contentSecurityPolicy, m_referrerPolicy, m_data.scriptURL, m_data.type, m_server->sessionID(), false, m_scriptResourceMap };
+ return { WTF::nullopt, m_registration->data(), m_data.identifier, m_script, m_contentSecurityPolicy, m_referrerPolicy, m_data.scriptURL, m_data.type, false, m_scriptResourceMap };
}
void SWServerWorker::terminate()