Diff
Modified: trunk/Source/WebCore/ChangeLog (225183 => 225184)
--- trunk/Source/WebCore/ChangeLog 2017-11-27 19:40:45 UTC (rev 225183)
+++ trunk/Source/WebCore/ChangeLog 2017-11-27 19:51:13 UTC (rev 225184)
@@ -1,3 +1,37 @@
+2017-11-27 Chris Dumez <[email protected]>
+
+ Give Document a strongly typed identifier instead of a uint64_t
+ https://bugs.webkit.org/show_bug.cgi?id=180041
+
+ Reviewed by Youenn Fablet.
+
+ Give Document a strongly typed identifier instead of a uint64_t, for clarity.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * dom/Document.cpp:
+ (WebCore::m_identifier):
+ * dom/Document.h:
+ (WebCore::Document::identifier const):
+ * dom/DocumentIdentifier.h: Copied from Source/WebCore/workers/service/ServiceWorkerClientIdentifier.h.
+ * workers/service/ServiceWorkerClientIdentifier.h:
+ (WebCore::ServiceWorkerClientIdentifier::toString const):
+ (WebCore::ServiceWorkerClientIdentifier::encode const):
+ (WebCore::ServiceWorkerClientIdentifier::decode):
+ * workers/service/server/SWClientConnection.cpp:
+ (WebCore::SWClientConnection::postMessageToServiceWorkerClient):
+ (WebCore::SWClientConnection::notifyClientsOfControllerChange):
+ * workers/service/server/SWClientConnection.h:
+ * workers/service/server/SWServer.cpp:
+ (WebCore::SWServer::Connection::serviceWorkerStartedControllingClient):
+ (WebCore::SWServer::Connection::serviceWorkerStoppedControllingClient):
+ (WebCore::SWServer::serviceWorkerStartedControllingClient):
+ (WebCore::SWServer::serviceWorkerStoppedControllingClient):
+ * workers/service/server/SWServer.h:
+ * workers/service/server/SWServerRegistration.cpp:
+ (WebCore::SWServerRegistration::addClientUsingRegistration):
+ (WebCore::SWServerRegistration::removeClientUsingRegistration):
+ * workers/service/server/SWServerRegistration.h:
+
2017-11-27 Simon Fraser <[email protected]>
Optimize FEDisplacementMap
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (225183 => 225184)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2017-11-27 19:40:45 UTC (rev 225183)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2017-11-27 19:51:13 UTC (rev 225184)
@@ -1144,6 +1144,7 @@
46DBB6501AB8C96F00D9A813 /* PowerObserverMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 46DBB64E1AB8C96F00D9A813 /* PowerObserverMac.h */; };
46DFF4981DC2603100B80B48 /* ShadowRootMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 46DFF4961DC2601300B80B48 /* ShadowRootMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
46DFF49C1DC2620B00B80B48 /* JSShadowRootMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 46DFF49A1DC261F900B80B48 /* JSShadowRootMode.h */; };
+ 46E1666E1FCC86A200C9710B /* DocumentIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 46E1666C1FCC868700C9710B /* DocumentIdentifier.h */; settings = {ATTRIBUTES = (Private, ); }; };
46E791491F97E01A00199739 /* JSVisibilityState.h in Headers */ = {isa = PBXBuildFile; fileRef = 46E791461F97E01700199739 /* JSVisibilityState.h */; };
46EB37CA1F97CCD200B65523 /* JSServiceWorkerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 46EB37C31F97CCCB00B65523 /* JSServiceWorkerClient.h */; };
46EB37CC1F97CCD200B65523 /* JSServiceWorkerClients.h in Headers */ = {isa = PBXBuildFile; fileRef = 46EB37C51F97CCCB00B65523 /* JSServiceWorkerClients.h */; };
@@ -1889,9 +1890,7 @@
7728694E14F8882500F484DC /* EXTTextureFilterAnisotropic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7728694B14F8882500F484DC /* EXTTextureFilterAnisotropic.cpp */; };
7728694F14F8882500F484DC /* EXTTextureFilterAnisotropic.h in Headers */ = {isa = PBXBuildFile; fileRef = 7728694C14F8882500F484DC /* EXTTextureFilterAnisotropic.h */; };
7728698414FD9ADA00F484DC /* JSEXTTextureFilterAnisotropic.h in Headers */ = {isa = PBXBuildFile; fileRef = 7728698214FD9ADA00F484DC /* JSEXTTextureFilterAnisotropic.h */; };
- 7779BD951F312D0100C21417 /* VisualViewport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7779BD941F3117B700C21417 /* VisualViewport.cpp */; };
7779BD961F32246A00C21417 /* JSVisualViewport.h in Headers */ = {isa = PBXBuildFile; fileRef = 7779BD921F2FDBF700C21417 /* JSVisualViewport.h */; };
- 7779BD971F32246D00C21417 /* JSVisualViewport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7779BD911F2FDBCE00C21417 /* JSVisualViewport.cpp */; };
77A17A7112F28182004E02F6 /* OESVertexArrayObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 77A17A6E12F28182004E02F6 /* OESVertexArrayObject.cpp */; };
77A17A7212F28182004E02F6 /* OESVertexArrayObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 77A17A6F12F28182004E02F6 /* OESVertexArrayObject.h */; };
77A17A7712F28642004E02F6 /* WebGLVertexArrayObjectOES.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 77A17A7412F28642004E02F6 /* WebGLVertexArrayObjectOES.cpp */; };
@@ -7267,6 +7266,7 @@
46DFF4991DC261F900B80B48 /* JSShadowRootMode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSShadowRootMode.cpp; sourceTree = "<group>"; };
46DFF49A1DC261F900B80B48 /* JSShadowRootMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSShadowRootMode.h; sourceTree = "<group>"; };
46E016AD1F72D61E00282B2C /* DOMHighResTimeStamp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMHighResTimeStamp.h; sourceTree = "<group>"; };
+ 46E1666C1FCC868700C9710B /* DocumentIdentifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentIdentifier.h; sourceTree = "<group>"; };
46E791451F97E01700199739 /* JSVisibilityState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSVisibilityState.cpp; sourceTree = "<group>"; };
46E791461F97E01700199739 /* JSVisibilityState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVisibilityState.h; sourceTree = "<group>"; };
46EB37C21F97CCCB00B65523 /* JSServiceWorkerClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSServiceWorkerClient.cpp; sourceTree = "<group>"; };
@@ -25129,6 +25129,7 @@
A8185F3709765765005826D9 /* DocumentFragment.cpp */,
A8185F3509765765005826D9 /* DocumentFragment.h */,
1A494ED50A123F1A00FDAFC1 /* DocumentFragment.idl */,
+ 46E1666C1FCC868700C9710B /* DocumentIdentifier.h */,
ED2BA83B09A24B91006C0AC4 /* DocumentMarker.h */,
CE057FA31220731100A476D5 /* DocumentMarkerController.cpp */,
CE057FA41220731100A476D5 /* DocumentMarkerController.h */,
@@ -26605,6 +26606,7 @@
A8185F4009765766005826D9 /* Document.h in Headers */,
A3BB59F41457A40D00AC56FE /* DocumentEventQueue.h in Headers */,
A8185F3D09765766005826D9 /* DocumentFragment.h in Headers */,
+ 46E1666E1FCC86A200C9710B /* DocumentIdentifier.h in Headers */,
656D37360ADBA5DE00A4554D /* DocumentLoader.h in Headers */,
ED2BA83C09A24B91006C0AC4 /* DocumentMarker.h in Headers */,
CE057FA61220731100A476D5 /* DocumentMarkerController.h in Headers */,
Modified: trunk/Source/WebCore/dom/Document.cpp (225183 => 225184)
--- trunk/Source/WebCore/dom/Document.cpp 2017-11-27 19:40:45 UTC (rev 225183)
+++ trunk/Source/WebCore/dom/Document.cpp 2017-11-27 19:51:13 UTC (rev 225184)
@@ -437,12 +437,6 @@
uint64_t Document::s_globalTreeVersion = 0;
-static uint64_t generateDocumentIdentifier()
-{
- static uint64_t identifier = 0;
- return ++identifier;
-}
-
auto Document::allDocumentsMap() -> DocumentsMap&
{
static NeverDestroyed<DocumentsMap> documents;
@@ -512,7 +506,7 @@
, m_isSynthesized(constructionFlags & Synthesized)
, m_isNonRenderedPlaceholder(constructionFlags & NonRenderedPlaceholder)
, m_orientationNotifier(currentOrientation(frame))
- , m_identifier(generateDocumentIdentifier())
+ , m_identifier(generateObjectIdentifier<DocumentIdentifierType>())
{
auto addResult = allDocumentsMap().add(m_identifier, this);
ASSERT_UNUSED(addResult, addResult.isNewEntry);
Modified: trunk/Source/WebCore/dom/Document.h (225183 => 225184)
--- trunk/Source/WebCore/dom/Document.h 2017-11-27 19:40:45 UTC (rev 225183)
+++ trunk/Source/WebCore/dom/Document.h 2017-11-27 19:51:13 UTC (rev 225184)
@@ -30,6 +30,7 @@
#include "Color.h"
#include "ContainerNode.h"
#include "DocumentEventQueue.h"
+#include "DocumentIdentifier.h"
#include "DocumentTiming.h"
#include "FocusDirection.h"
#include "FontSelectorClient.h"
@@ -56,6 +57,7 @@
#include <wtf/Forward.h>
#include <wtf/HashCountedSet.h>
#include <wtf/HashSet.h>
+#include <wtf/ObjectIdentifier.h>
#include <wtf/WeakPtr.h>
#include <wtf/text/AtomicStringHash.h>
@@ -352,9 +354,9 @@
void removedLastRef();
- uint64_t identifier() const { return m_identifier; }
+ DocumentIdentifier identifier() const { return m_identifier; }
- using DocumentsMap = HashMap<uint64_t, Document*>;
+ using DocumentsMap = HashMap<DocumentIdentifier, Document*>;
WEBCORE_EXPORT static DocumentsMap::ValuesIteratorRange allDocuments();
WEBCORE_EXPORT static DocumentsMap& allDocumentsMap();
@@ -1857,7 +1859,7 @@
bool m_grantStorageAccessOverride { false };
RefPtr<DocumentTimeline> m_timeline;
- uint64_t m_identifier;
+ DocumentIdentifier m_identifier;
};
Element* eventTargetElementForDocument(Document*);
Copied: trunk/Source/WebCore/dom/DocumentIdentifier.h (from rev 225183, trunk/Source/WebCore/workers/service/ServiceWorkerClientIdentifier.h) (0 => 225184)
--- trunk/Source/WebCore/dom/DocumentIdentifier.h (rev 0)
+++ trunk/Source/WebCore/dom/DocumentIdentifier.h 2017-11-27 19:51:13 UTC (rev 225184)
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2017 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 DocumentIdentifierType { };
+using DocumentIdentifier = ObjectIdentifier<DocumentIdentifierType>;
+
+}
Modified: trunk/Source/WebCore/workers/service/ServiceWorkerClientIdentifier.h (225183 => 225184)
--- trunk/Source/WebCore/workers/service/ServiceWorkerClientIdentifier.h 2017-11-27 19:40:45 UTC (rev 225183)
+++ trunk/Source/WebCore/workers/service/ServiceWorkerClientIdentifier.h 2017-11-27 19:51:13 UTC (rev 225184)
@@ -27,6 +27,7 @@
#if ENABLE(SERVICE_WORKER)
+#include "DocumentIdentifier.h"
#include "ServiceWorkerTypes.h"
#include <wtf/text/WTFString.h>
@@ -34,9 +35,9 @@
struct ServiceWorkerClientIdentifier {
SWServerConnectionIdentifier serverConnectionIdentifier;
- uint64_t scriptExecutionContextIdentifier;
+ DocumentIdentifier contextIdentifier;
- String toString() const { return String::number(serverConnectionIdentifier.toUInt64()) + "-" + String::number(scriptExecutionContextIdentifier); }
+ String toString() const { return String::number(serverConnectionIdentifier.toUInt64()) + "-" + String::number(contextIdentifier.toUInt64()); }
template<class Encoder> void encode(Encoder&) const;
template<class Decoder> static std::optional<ServiceWorkerClientIdentifier> decode(Decoder&);
@@ -45,7 +46,7 @@
template<class Encoder>
void ServiceWorkerClientIdentifier::encode(Encoder& encoder) const
{
- encoder << serverConnectionIdentifier << scriptExecutionContextIdentifier;
+ encoder << serverConnectionIdentifier << contextIdentifier;
}
template<class Decoder>
@@ -56,12 +57,12 @@
if (!serverConnectionIdentifier)
return std::nullopt;
- std::optional<uint64_t> scriptExecutionContextIdentifier;
- decoder >> scriptExecutionContextIdentifier;
- if (!scriptExecutionContextIdentifier)
+ std::optional<DocumentIdentifier> contextIdentifier;
+ decoder >> contextIdentifier;
+ if (!contextIdentifier)
return std::nullopt;
- return { { WTFMove(*serverConnectionIdentifier), WTFMove(*scriptExecutionContextIdentifier) } };
+ return { { WTFMove(*serverConnectionIdentifier), WTFMove(*contextIdentifier) } };
}
} // namespace WebCore
Modified: trunk/Source/WebCore/workers/service/server/SWClientConnection.cpp (225183 => 225184)
--- trunk/Source/WebCore/workers/service/server/SWClientConnection.cpp 2017-11-27 19:40:45 UTC (rev 225183)
+++ trunk/Source/WebCore/workers/service/server/SWClientConnection.cpp 2017-11-27 19:51:13 UTC (rev 225184)
@@ -118,10 +118,10 @@
job->startScriptFetch();
}
-void SWClientConnection::postMessageToServiceWorkerClient(uint64_t destinationScriptExecutionContextIdentifier, Ref<SerializedScriptValue>&& message, ServiceWorkerData&& sourceData, const String& sourceOrigin)
+void SWClientConnection::postMessageToServiceWorkerClient(DocumentIdentifier destinationContextIdentifier, Ref<SerializedScriptValue>&& message, ServiceWorkerData&& sourceData, const String& sourceOrigin)
{
- // FIXME: destinationScriptExecutionContextIdentifier can only identify a Document at the moment.
- auto* destinationDocument = Document::allDocumentsMap().get(destinationScriptExecutionContextIdentifier);
+ // FIXME: destinationContextIdentifier can only identify a Document at the moment.
+ auto* destinationDocument = Document::allDocumentsMap().get(destinationContextIdentifier);
if (!destinationDocument)
return;
@@ -165,11 +165,11 @@
});
}
-void SWClientConnection::notifyClientsOfControllerChange(const HashSet<uint64_t>& scriptExecutionContexts, ServiceWorkerData&& newController)
+void SWClientConnection::notifyClientsOfControllerChange(const HashSet<DocumentIdentifier>& contextIdentifiers, ServiceWorkerData&& newController)
{
- ASSERT(!scriptExecutionContexts.isEmpty());
+ ASSERT(!contextIdentifiers.isEmpty());
- for (auto& clientIdentifier : scriptExecutionContexts) {
+ for (auto& clientIdentifier : contextIdentifiers) {
// FIXME: Support worker contexts.
auto* client = Document::allDocumentsMap().get(clientIdentifier);
if (!client)
Modified: trunk/Source/WebCore/workers/service/server/SWClientConnection.h (225183 => 225184)
--- trunk/Source/WebCore/workers/service/server/SWClientConnection.h 2017-11-27 19:40:45 UTC (rev 225183)
+++ trunk/Source/WebCore/workers/service/server/SWClientConnection.h 2017-11-27 19:51:13 UTC (rev 225184)
@@ -27,6 +27,7 @@
#if ENABLE(SERVICE_WORKER)
+#include "DocumentIdentifier.h"
#include "ServiceWorkerJob.h"
#include "ServiceWorkerTypes.h"
#include <wtf/HashMap.h>
@@ -68,12 +69,12 @@
virtual void didResolveRegistrationPromise(const ServiceWorkerRegistrationKey&) = 0;
- virtual void postMessageToServiceWorkerGlobalScope(ServiceWorkerIdentifier destinationIdentifier, Ref<SerializedScriptValue>&&, uint64_t sourceContextIdentifier, ServiceWorkerClientData&& source) = 0;
+ virtual void postMessageToServiceWorkerGlobalScope(ServiceWorkerIdentifier destinationIdentifier, Ref<SerializedScriptValue>&&, DocumentIdentifier sourceContextIdentifier, ServiceWorkerClientData&& source) = 0;
virtual SWServerConnectionIdentifier serverConnectionIdentifier() const = 0;
virtual bool mayHaveServiceWorkerRegisteredForOrigin(const SecurityOrigin&) const = 0;
- virtual void serviceWorkerStartedControllingClient(ServiceWorkerIdentifier, uint64_t scriptExecutionContextIdentifier) = 0;
- virtual void serviceWorkerStoppedControllingClient(ServiceWorkerIdentifier, uint64_t scriptExecutionContextIdentifier) = 0;
+ virtual void serviceWorkerStartedControllingClient(ServiceWorkerIdentifier, DocumentIdentifier) = 0;
+ virtual void serviceWorkerStoppedControllingClient(ServiceWorkerIdentifier, DocumentIdentifier) = 0;
protected:
WEBCORE_EXPORT SWClientConnection();
@@ -82,11 +83,11 @@
WEBCORE_EXPORT void registrationJobResolvedInServer(const ServiceWorkerJobDataIdentifier&, ServiceWorkerRegistrationData&&, ShouldNotifyWhenResolved);
WEBCORE_EXPORT void unregistrationJobResolvedInServer(const ServiceWorkerJobDataIdentifier&, bool unregistrationResult);
WEBCORE_EXPORT void startScriptFetchForServer(const ServiceWorkerJobDataIdentifier&);
- WEBCORE_EXPORT void postMessageToServiceWorkerClient(uint64_t destinationScriptExecutionContextIdentifier, Ref<SerializedScriptValue>&& message, ServiceWorkerData&& source, const String& sourceOrigin);
+ WEBCORE_EXPORT void postMessageToServiceWorkerClient(DocumentIdentifier destinationContextIdentifier, Ref<SerializedScriptValue>&& message, ServiceWorkerData&& source, const String& sourceOrigin);
WEBCORE_EXPORT void updateRegistrationState(ServiceWorkerRegistrationIdentifier, ServiceWorkerRegistrationState, const std::optional<ServiceWorkerData>&);
WEBCORE_EXPORT void updateWorkerState(ServiceWorkerIdentifier, ServiceWorkerState);
WEBCORE_EXPORT void fireUpdateFoundEvent(ServiceWorkerRegistrationIdentifier);
- WEBCORE_EXPORT void notifyClientsOfControllerChange(const HashSet<uint64_t>& scriptExecutionContexts, ServiceWorkerData&& newController);
+ WEBCORE_EXPORT void notifyClientsOfControllerChange(const HashSet<DocumentIdentifier>& contextIdentifiers, ServiceWorkerData&& newController);
private:
virtual void scheduleJobInServer(const ServiceWorkerJobData&) = 0;
Modified: trunk/Source/WebCore/workers/service/server/SWServer.cpp (225183 => 225184)
--- trunk/Source/WebCore/workers/service/server/SWServer.cpp 2017-11-27 19:40:45 UTC (rev 225183)
+++ trunk/Source/WebCore/workers/service/server/SWServer.cpp 2017-11-27 19:51:13 UTC (rev 225184)
@@ -170,14 +170,14 @@
m_server.removeClientServiceWorkerRegistration(*this, key, identifier);
}
-void SWServer::Connection::serviceWorkerStartedControllingClient(ServiceWorkerIdentifier serviceWorkerIdentifier, uint64_t scriptExecutionContextIdentifier)
+void SWServer::Connection::serviceWorkerStartedControllingClient(ServiceWorkerIdentifier serviceWorkerIdentifier, DocumentIdentifier contextIdentifier)
{
- m_server.serviceWorkerStartedControllingClient(*this, serviceWorkerIdentifier, scriptExecutionContextIdentifier);
+ m_server.serviceWorkerStartedControllingClient(*this, serviceWorkerIdentifier, contextIdentifier);
}
-void SWServer::Connection::serviceWorkerStoppedControllingClient(ServiceWorkerIdentifier serviceWorkerIdentifier, uint64_t scriptExecutionContextIdentifier)
+void SWServer::Connection::serviceWorkerStoppedControllingClient(ServiceWorkerIdentifier serviceWorkerIdentifier, DocumentIdentifier contextIdentifier)
{
- m_server.serviceWorkerStoppedControllingClient(*this, serviceWorkerIdentifier, scriptExecutionContextIdentifier);
+ m_server.serviceWorkerStoppedControllingClient(*this, serviceWorkerIdentifier, contextIdentifier);
}
SWServer::SWServer(UniqueRef<SWOriginStore>&& originStore)
@@ -324,7 +324,7 @@
registration->removeClientServiceWorkerRegistration(connection.identifier());
}
-void SWServer::serviceWorkerStartedControllingClient(Connection& connection, ServiceWorkerIdentifier serviceWorkerIdentifier, uint64_t scriptExecutionContextIdentifier)
+void SWServer::serviceWorkerStartedControllingClient(Connection& connection, ServiceWorkerIdentifier serviceWorkerIdentifier, DocumentIdentifier contextIdentifier)
{
auto* serviceWorker = m_workersByID.get(serviceWorkerIdentifier);
if (!serviceWorker)
@@ -334,10 +334,10 @@
if (!registration)
return;
- registration->addClientUsingRegistration({ connection.identifier(), scriptExecutionContextIdentifier });
+ registration->addClientUsingRegistration({ connection.identifier(), contextIdentifier });
}
-void SWServer::serviceWorkerStoppedControllingClient(Connection& connection, ServiceWorkerIdentifier serviceWorkerIdentifier, uint64_t scriptExecutionContextIdentifier)
+void SWServer::serviceWorkerStoppedControllingClient(Connection& connection, ServiceWorkerIdentifier serviceWorkerIdentifier, DocumentIdentifier contextIdentifier)
{
auto* serviceWorker = m_workersByID.get(serviceWorkerIdentifier);
if (!serviceWorker)
@@ -347,7 +347,7 @@
if (!registration)
return;
- registration->removeClientUsingRegistration({ connection.identifier(), scriptExecutionContextIdentifier });
+ registration->removeClientUsingRegistration({ connection.identifier(), contextIdentifier });
}
void SWServer::updateWorker(Connection&, const ServiceWorkerJobDataIdentifier& jobDataIdentifier, const ServiceWorkerRegistrationKey& registrationKey, const URL& url, const String& script, WorkerType type)
Modified: trunk/Source/WebCore/workers/service/server/SWServer.h (225183 => 225184)
--- trunk/Source/WebCore/workers/service/server/SWServer.h 2017-11-27 19:40:45 UTC (rev 225183)
+++ trunk/Source/WebCore/workers/service/server/SWServer.h 2017-11-27 19:51:13 UTC (rev 225184)
@@ -27,6 +27,7 @@
#if ENABLE(SERVICE_WORKER)
+#include "DocumentIdentifier.h"
#include "SWServerWorker.h"
#include "ServiceWorkerIdentifier.h"
#include "ServiceWorkerJob.h"
@@ -73,7 +74,7 @@
virtual void updateRegistrationStateInClient(ServiceWorkerRegistrationIdentifier, ServiceWorkerRegistrationState, const std::optional<ServiceWorkerData>&) = 0;
virtual void updateWorkerStateInClient(ServiceWorkerIdentifier, ServiceWorkerState) = 0;
virtual void fireUpdateFoundEvent(ServiceWorkerRegistrationIdentifier) = 0;
- virtual void notifyClientsOfControllerChange(const HashSet<uint64_t>& scriptExecutionContexts, const ServiceWorkerData& newController) = 0;
+ virtual void notifyClientsOfControllerChange(const HashSet<DocumentIdentifier>& contextIdentifiers, const ServiceWorkerData& newController) = 0;
protected:
WEBCORE_EXPORT explicit Connection(SWServer&);
@@ -83,8 +84,8 @@
WEBCORE_EXPORT void finishFetchingScriptInServer(const ServiceWorkerFetchResult&);
WEBCORE_EXPORT void addServiceWorkerRegistrationInServer(const ServiceWorkerRegistrationKey&, ServiceWorkerRegistrationIdentifier);
WEBCORE_EXPORT void removeServiceWorkerRegistrationInServer(const ServiceWorkerRegistrationKey&, ServiceWorkerRegistrationIdentifier);
- WEBCORE_EXPORT void serviceWorkerStartedControllingClient(ServiceWorkerIdentifier, uint64_t scriptExecutionContextIdentifier);
- WEBCORE_EXPORT void serviceWorkerStoppedControllingClient(ServiceWorkerIdentifier, uint64_t scriptExecutionContextIdentifier);
+ WEBCORE_EXPORT void serviceWorkerStartedControllingClient(ServiceWorkerIdentifier, DocumentIdentifier);
+ WEBCORE_EXPORT void serviceWorkerStoppedControllingClient(ServiceWorkerIdentifier, DocumentIdentifier);
private:
// Messages to the client WebProcess
@@ -150,8 +151,8 @@
void addClientServiceWorkerRegistration(Connection&, const ServiceWorkerRegistrationKey&, ServiceWorkerRegistrationIdentifier);
void removeClientServiceWorkerRegistration(Connection&, const ServiceWorkerRegistrationKey&, ServiceWorkerRegistrationIdentifier);
- void serviceWorkerStartedControllingClient(Connection&, ServiceWorkerIdentifier, uint64_t scriptExecutionContextIdentifier);
- void serviceWorkerStoppedControllingClient(Connection&, ServiceWorkerIdentifier, uint64_t scriptExecutionContextIdentifier);
+ void serviceWorkerStartedControllingClient(Connection&, ServiceWorkerIdentifier, DocumentIdentifier);
+ void serviceWorkerStoppedControllingClient(Connection&, ServiceWorkerIdentifier, DocumentIdentifier);
WEBCORE_EXPORT const SWServerRegistration* doRegistrationMatching(const SecurityOriginData& topOrigin, const URL& clientURL) const;
Modified: trunk/Source/WebCore/workers/service/server/SWServerRegistration.cpp (225183 => 225184)
--- trunk/Source/WebCore/workers/service/server/SWServerRegistration.cpp 2017-11-27 19:40:45 UTC (rev 225183)
+++ trunk/Source/WebCore/workers/service/server/SWServerRegistration.cpp 2017-11-27 19:51:13 UTC (rev 225184)
@@ -147,8 +147,8 @@
void SWServerRegistration::addClientUsingRegistration(const ServiceWorkerClientIdentifier& clientIdentifier)
{
auto addResult = m_clientsUsingRegistration.ensure(clientIdentifier.serverConnectionIdentifier, [] {
- return HashSet<uint64_t> { };
- }).iterator->value.add(clientIdentifier.scriptExecutionContextIdentifier);
+ return HashSet<DocumentIdentifier> { };
+ }).iterator->value.add(clientIdentifier.contextIdentifier);
ASSERT_UNUSED(addResult, addResult.isNewEntry);
}
@@ -156,7 +156,7 @@
{
auto iterator = m_clientsUsingRegistration.find(clientIdentifier.serverConnectionIdentifier);
ASSERT(iterator != m_clientsUsingRegistration.end());
- bool wasRemoved = iterator->value.remove(clientIdentifier.scriptExecutionContextIdentifier);
+ bool wasRemoved = iterator->value.remove(clientIdentifier.contextIdentifier);
ASSERT_UNUSED(wasRemoved, wasRemoved);
if (iterator->value.isEmpty())
Modified: trunk/Source/WebCore/workers/service/server/SWServerRegistration.h (225183 => 225184)
--- trunk/Source/WebCore/workers/service/server/SWServerRegistration.h 2017-11-27 19:40:45 UTC (rev 225183)
+++ trunk/Source/WebCore/workers/service/server/SWServerRegistration.h 2017-11-27 19:51:13 UTC (rev 225184)
@@ -100,7 +100,7 @@
SWServer& m_server;
MonotonicTime m_creationTime;
- HashMap<SWServerConnectionIdentifier, HashSet<uint64_t /* scriptExecutionContextIdentifier */>> m_clientsUsingRegistration;
+ HashMap<SWServerConnectionIdentifier, HashSet<DocumentIdentifier>> m_clientsUsingRegistration;
};
} // namespace WebCore
Modified: trunk/Source/WebKit/ChangeLog (225183 => 225184)
--- trunk/Source/WebKit/ChangeLog 2017-11-27 19:40:45 UTC (rev 225183)
+++ trunk/Source/WebKit/ChangeLog 2017-11-27 19:51:13 UTC (rev 225184)
@@ -1,3 +1,31 @@
+2017-11-27 Chris Dumez <[email protected]>
+
+ Give Document a strongly typed identifier instead of a uint64_t
+ https://bugs.webkit.org/show_bug.cgi?id=180041
+
+ Reviewed by Youenn Fablet.
+
+ Give Document a strongly typed identifier instead of a uint64_t, for clarity.
+
+ * Platform/IPC/ArgumentCoders.h:
+ * Scripts/webkit/messages.py:
+ (forward_declarations_and_headers):
+ * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
+ (WebKit::WebSWServerConnection::notifyClientsOfControllerChange):
+ (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
+ (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
+ * StorageProcess/ServiceWorker/WebSWServerConnection.h:
+ * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
+ * StorageProcess/StorageProcess.cpp:
+ (WebKit::StorageProcess::postMessageToServiceWorkerClient):
+ * WebProcess/Storage/WebSWClientConnection.cpp:
+ (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
+ (WebKit::WebSWClientConnection::serviceWorkerStartedControllingClient):
+ (WebKit::WebSWClientConnection::serviceWorkerStoppedControllingClient):
+ (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient):
+ * WebProcess/Storage/WebSWClientConnection.h:
+ * WebProcess/Storage/WebSWClientConnection.messages.in:
+
2017-11-27 Yacine Bandou <[email protected]>
[GTK][WPE] Add "enable-encrypted-media" property to WebKitWebSettings
Modified: trunk/Source/WebKit/Platform/IPC/ArgumentCoders.h (225183 => 225184)
--- trunk/Source/WebKit/Platform/IPC/ArgumentCoders.h 2017-11-27 19:40:45 UTC (rev 225183)
+++ trunk/Source/WebKit/Platform/IPC/ArgumentCoders.h 2017-11-27 19:51:13 UTC (rev 225184)
@@ -424,11 +424,12 @@
HashSetType tempHashSet;
for (uint64_t i = 0; i < hashSetSize; ++i) {
- KeyArg key;
- if (!decoder.decode(key))
+ std::optional<KeyArg> key;
+ decoder >> key;
+ if (!key)
return false;
- if (!tempHashSet.add(key).isNewEntry) {
+ if (!tempHashSet.add(*key).isNewEntry) {
// The hash map already has the specified key, bail.
decoder.markInvalid();
return false;
Modified: trunk/Source/WebKit/Scripts/webkit/messages.py (225183 => 225184)
--- trunk/Source/WebKit/Scripts/webkit/messages.py 2017-11-27 19:40:45 UTC (rev 225183)
+++ trunk/Source/WebKit/Scripts/webkit/messages.py 2017-11-27 19:51:13 UTC (rev 225184)
@@ -184,6 +184,7 @@
types_by_namespace['IPC'].update([('class', 'Connection')])
no_forward_declaration_types = frozenset([
+ 'WebCore::DocumentIdentifier',
'WebCore::ServiceWorkerIdentifier',
'WebCore::ServiceWorkerRegistrationIdentifier',
'WebCore::SWServerConnectionIdentifier',
Modified: trunk/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.cpp (225183 => 225184)
--- trunk/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.cpp 2017-11-27 19:40:45 UTC (rev 225183)
+++ trunk/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.cpp 2017-11-27 19:51:13 UTC (rev 225184)
@@ -104,9 +104,9 @@
send(Messages::WebSWClientConnection::FireUpdateFoundEvent(identifier));
}
-void WebSWServerConnection::notifyClientsOfControllerChange(const HashSet<uint64_t>& scriptExecutionContexts, const ServiceWorkerData& newController)
+void WebSWServerConnection::notifyClientsOfControllerChange(const HashSet<DocumentIdentifier>& contextIdentifiers, const ServiceWorkerData& newController)
{
- send(Messages::WebSWClientConnection::NotifyClientsOfControllerChange(scriptExecutionContexts, newController));
+ send(Messages::WebSWClientConnection::NotifyClientsOfControllerChange(contextIdentifiers, newController));
}
void WebSWServerConnection::updateWorkerStateInClient(ServiceWorkerIdentifier worker, ServiceWorkerState state)
@@ -119,7 +119,7 @@
sendToContextProcess(Messages::WebSWContextManagerConnection::StartFetch { identifier(), fetchIdentifier, serviceWorkerIdentifier, request, options, formData });
}
-void WebSWServerConnection::postMessageToServiceWorkerGlobalScope(ServiceWorkerIdentifier destinationServiceWorkerIdentifier, const IPC::DataReference& message, uint64_t sourceContextIdentifier, ServiceWorkerClientData&& sourceData)
+void WebSWServerConnection::postMessageToServiceWorkerGlobalScope(ServiceWorkerIdentifier destinationServiceWorkerIdentifier, const IPC::DataReference& message, DocumentIdentifier sourceContextIdentifier, ServiceWorkerClientData&& sourceData)
{
ServiceWorkerClientIdentifier sourceIdentifier { identifier(), sourceContextIdentifier };
sendToContextProcess(Messages::WebSWContextManagerConnection::PostMessageToServiceWorkerGlobalScope { destinationServiceWorkerIdentifier, message, sourceIdentifier, WTFMove(sourceData) });
@@ -155,13 +155,13 @@
m_contentConnection->send(Messages::ServiceWorkerClientFetch::DidNotHandle { }, fetchIdentifier);
}
-void WebSWServerConnection::postMessageToServiceWorkerClient(uint64_t destinationScriptExecutionContextIdentifier, const IPC::DataReference& message, ServiceWorkerIdentifier sourceIdentifier, const String& sourceOrigin)
+void WebSWServerConnection::postMessageToServiceWorkerClient(DocumentIdentifier destinationContextIdentifier, const IPC::DataReference& message, ServiceWorkerIdentifier sourceIdentifier, const String& sourceOrigin)
{
auto* sourceServiceWorker = server().workerByID(sourceIdentifier);
if (!sourceServiceWorker)
return;
- send(Messages::WebSWClientConnection::PostMessageToServiceWorkerClient { destinationScriptExecutionContextIdentifier, message, sourceServiceWorker->data(), sourceOrigin });
+ send(Messages::WebSWClientConnection::PostMessageToServiceWorkerClient { destinationContextIdentifier, message, sourceServiceWorker->data(), sourceOrigin });
}
void WebSWServerConnection::matchRegistration(uint64_t registrationMatchRequestIdentifier, const SecurityOriginData& topOrigin, const URL& clientURL)
Modified: trunk/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.h (225183 => 225184)
--- trunk/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.h 2017-11-27 19:40:45 UTC (rev 225183)
+++ trunk/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.h 2017-11-27 19:51:13 UTC (rev 225184)
@@ -62,7 +62,7 @@
void didFailFetch(uint64_t fetchIdentifier);
void didNotHandleFetch(uint64_t fetchIdentifier);
- void postMessageToServiceWorkerClient(uint64_t destinationScriptExecutionContextIdentifier, const IPC::DataReference& message, WebCore::ServiceWorkerIdentifier sourceServiceWorkerIdentifier, const String& sourceOrigin);
+ void postMessageToServiceWorkerClient(WebCore::DocumentIdentifier destinationContextIdentifier, const IPC::DataReference& message, WebCore::ServiceWorkerIdentifier sourceServiceWorkerIdentifier, const String& sourceOrigin);
private:
// Implement SWServer::Connection (Messages to the client WebProcess)
@@ -73,11 +73,11 @@
void updateRegistrationStateInClient(WebCore::ServiceWorkerRegistrationIdentifier, WebCore::ServiceWorkerRegistrationState, const std::optional<WebCore::ServiceWorkerData>&) final;
void updateWorkerStateInClient(WebCore::ServiceWorkerIdentifier, WebCore::ServiceWorkerState) final;
void fireUpdateFoundEvent(WebCore::ServiceWorkerRegistrationIdentifier) final;
- void notifyClientsOfControllerChange(const HashSet<uint64_t>& scriptExecutionContexts, const WebCore::ServiceWorkerData& newController);
+ void notifyClientsOfControllerChange(const HashSet<WebCore::DocumentIdentifier>& contextIdentifiers, const WebCore::ServiceWorkerData& newController);
void startFetch(uint64_t fetchIdentifier, std::optional<WebCore::ServiceWorkerIdentifier>, const WebCore::ResourceRequest&, const WebCore::FetchOptions&, const IPC::FormDataReference&);
- void postMessageToServiceWorkerGlobalScope(WebCore::ServiceWorkerIdentifier destinationIdentifier, const IPC::DataReference& message, uint64_t sourceContextIdentifier, WebCore::ServiceWorkerClientData&& source);
+ void postMessageToServiceWorkerGlobalScope(WebCore::ServiceWorkerIdentifier destinationIdentifier, const IPC::DataReference& message, WebCore::DocumentIdentifier sourceContextIdentifier, WebCore::ServiceWorkerClientData&& source);
void matchRegistration(uint64_t registrationMatchRequestIdentifier, const WebCore::SecurityOriginData& topOrigin, const WebCore::URL& clientURL);
void getRegistrations(uint64_t registrationMatchRequestIdentifier, const WebCore::SecurityOriginData& topOrigin, const WebCore::URL& clientURL);
Modified: trunk/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.messages.in (225183 => 225184)
--- trunk/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.messages.in 2017-11-27 19:40:45 UTC (rev 225183)
+++ trunk/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.messages.in 2017-11-27 19:51:13 UTC (rev 225184)
@@ -28,11 +28,11 @@
FinishFetchingScriptInServer(struct WebCore::ServiceWorkerFetchResult result)
AddServiceWorkerRegistrationInServer(WebCore::ServiceWorkerRegistrationKey key, WebCore::ServiceWorkerRegistrationIdentifier identifier)
RemoveServiceWorkerRegistrationInServer(WebCore::ServiceWorkerRegistrationKey key, WebCore::ServiceWorkerRegistrationIdentifier identifier)
- ServiceWorkerStartedControllingClient(WebCore::ServiceWorkerIdentifier serviceWorkerIdentifier, uint64_t scriptExecutionContextIdentifier)
- ServiceWorkerStoppedControllingClient(WebCore::ServiceWorkerIdentifier serviceWorkerIdentifier, uint64_t scriptExecutionContextIdentifier)
+ ServiceWorkerStartedControllingClient(WebCore::ServiceWorkerIdentifier serviceWorkerIdentifier, WebCore::DocumentIdentifier contextIdentifier)
+ ServiceWorkerStoppedControllingClient(WebCore::ServiceWorkerIdentifier serviceWorkerIdentifier, WebCore::DocumentIdentifier contextIdentifier)
StartFetch(uint64_t identifier, std::optional<WebCore::ServiceWorkerIdentifier> serviceWorkerIdentifier, WebCore::ResourceRequest request, struct WebCore::FetchOptions options, IPC::FormDataReference requestBody)
- PostMessageToServiceWorkerGlobalScope(WebCore::ServiceWorkerIdentifier destinationServiceWorkerIdentifier, IPC::DataReference message, uint64_t sourceContextIdentifier, struct WebCore::ServiceWorkerClientData source)
+ PostMessageToServiceWorkerGlobalScope(WebCore::ServiceWorkerIdentifier destinationServiceWorkerIdentifier, IPC::DataReference message, WebCore::DocumentIdentifier sourceContextIdentifier, struct WebCore::ServiceWorkerClientData source)
DidResolveRegistrationPromise(WebCore::ServiceWorkerRegistrationKey key)
Modified: trunk/Source/WebKit/StorageProcess/StorageProcess.cpp (225183 => 225184)
--- trunk/Source/WebKit/StorageProcess/StorageProcess.cpp 2017-11-27 19:40:45 UTC (rev 225183)
+++ trunk/Source/WebKit/StorageProcess/StorageProcess.cpp 2017-11-27 19:51:13 UTC (rev 225184)
@@ -449,7 +449,7 @@
void StorageProcess::postMessageToServiceWorkerClient(const ServiceWorkerClientIdentifier& destinationIdentifier, const IPC::DataReference& message, ServiceWorkerIdentifier sourceIdentifier, const String& sourceOrigin)
{
if (auto* connection = m_swServerConnections.get(destinationIdentifier.serverConnectionIdentifier))
- connection->postMessageToServiceWorkerClient(destinationIdentifier.scriptExecutionContextIdentifier, message, sourceIdentifier, sourceOrigin);
+ connection->postMessageToServiceWorkerClient(destinationIdentifier.contextIdentifier, message, sourceIdentifier, sourceOrigin);
}
void StorageProcess::registerSWServerConnection(WebSWServerConnection& connection)
Modified: trunk/Source/WebKit/WebProcess/Storage/WebSWClientConnection.cpp (225183 => 225184)
--- trunk/Source/WebKit/WebProcess/Storage/WebSWClientConnection.cpp 2017-11-27 19:40:45 UTC (rev 225183)
+++ trunk/Source/WebKit/WebProcess/Storage/WebSWClientConnection.cpp 2017-11-27 19:51:13 UTC (rev 225184)
@@ -82,19 +82,19 @@
send(Messages::WebSWServerConnection::RemoveServiceWorkerRegistrationInServer(key, identifier));
}
-void WebSWClientConnection::postMessageToServiceWorkerGlobalScope(ServiceWorkerIdentifier destinationIdentifier, Ref<SerializedScriptValue>&& scriptValue, uint64_t sourceContextIdentifier, ServiceWorkerClientData&& source)
+void WebSWClientConnection::postMessageToServiceWorkerGlobalScope(ServiceWorkerIdentifier destinationIdentifier, Ref<SerializedScriptValue>&& scriptValue, DocumentIdentifier sourceContextIdentifier, ServiceWorkerClientData&& source)
{
send(Messages::WebSWServerConnection::PostMessageToServiceWorkerGlobalScope(destinationIdentifier, IPC::DataReference { scriptValue->data() }, sourceContextIdentifier, WTFMove(source)));
}
-void WebSWClientConnection::serviceWorkerStartedControllingClient(ServiceWorkerIdentifier serviceWorkerIdentifier, uint64_t scriptExecutionContextIdentifier)
+void WebSWClientConnection::serviceWorkerStartedControllingClient(ServiceWorkerIdentifier serviceWorkerIdentifier, DocumentIdentifier contextIdentifier)
{
- send(Messages::WebSWServerConnection::ServiceWorkerStartedControllingClient(serviceWorkerIdentifier, scriptExecutionContextIdentifier));
+ send(Messages::WebSWServerConnection::ServiceWorkerStartedControllingClient(serviceWorkerIdentifier, contextIdentifier));
}
-void WebSWClientConnection::serviceWorkerStoppedControllingClient(ServiceWorkerIdentifier serviceWorkerIdentifier, uint64_t scriptExecutionContextIdentifier)
+void WebSWClientConnection::serviceWorkerStoppedControllingClient(ServiceWorkerIdentifier serviceWorkerIdentifier, DocumentIdentifier contextIdentifier)
{
- send(Messages::WebSWServerConnection::ServiceWorkerStoppedControllingClient(serviceWorkerIdentifier, scriptExecutionContextIdentifier));
+ send(Messages::WebSWServerConnection::ServiceWorkerStoppedControllingClient(serviceWorkerIdentifier, contextIdentifier));
}
void WebSWClientConnection::didResolveRegistrationPromise(const ServiceWorkerRegistrationKey& key)
@@ -164,9 +164,9 @@
return ServiceWorkerClientFetch::create(provider, WTFMove(loader), identifier, m_connection.get(), WTFMove(callback));
}
-void WebSWClientConnection::postMessageToServiceWorkerClient(uint64_t destinationScriptExecutionContextIdentifier, const IPC::DataReference& message, ServiceWorkerData&& source, const String& sourceOrigin)
+void WebSWClientConnection::postMessageToServiceWorkerClient(DocumentIdentifier destinationContextIdentifier, const IPC::DataReference& message, ServiceWorkerData&& source, const String& sourceOrigin)
{
- SWClientConnection::postMessageToServiceWorkerClient(destinationScriptExecutionContextIdentifier, SerializedScriptValue::adopt(message.vector()), WTFMove(source), sourceOrigin);
+ SWClientConnection::postMessageToServiceWorkerClient(destinationContextIdentifier, SerializedScriptValue::adopt(message.vector()), WTFMove(source), sourceOrigin);
}
} // namespace WebKit
Modified: trunk/Source/WebKit/WebProcess/Storage/WebSWClientConnection.h (225183 => 225184)
--- trunk/Source/WebKit/WebProcess/Storage/WebSWClientConnection.h 2017-11-27 19:40:45 UTC (rev 225183)
+++ trunk/Source/WebKit/WebProcess/Storage/WebSWClientConnection.h 2017-11-27 19:51:13 UTC (rev 225184)
@@ -63,14 +63,14 @@
bool mayHaveServiceWorkerRegisteredForOrigin(const WebCore::SecurityOrigin&) const final;
Ref<ServiceWorkerClientFetch> startFetch(WebServiceWorkerProvider&, Ref<WebCore::ResourceLoader>&&, uint64_t identifier, ServiceWorkerClientFetch::Callback&&);
- void postMessageToServiceWorkerClient(uint64_t destinationScriptExecutionContextIdentifier, const IPC::DataReference& message, WebCore::ServiceWorkerData&& source, const String& sourceOrigin);
+ void postMessageToServiceWorkerClient(WebCore::DocumentIdentifier destinationContextIdentifier, const IPC::DataReference& message, WebCore::ServiceWorkerData&& source, const String& sourceOrigin);
private:
void scheduleJobInServer(const WebCore::ServiceWorkerJobData&) final;
void finishFetchingScriptInServer(const WebCore::ServiceWorkerFetchResult&) final;
- void postMessageToServiceWorkerGlobalScope(WebCore::ServiceWorkerIdentifier destinationIdentifier, Ref<WebCore::SerializedScriptValue>&&, uint64_t sourceContextIdentifier, WebCore::ServiceWorkerClientData&& source) final;
- void serviceWorkerStartedControllingClient(WebCore::ServiceWorkerIdentifier, uint64_t scriptExecutionContextIdentifier) final;
- void serviceWorkerStoppedControllingClient(WebCore::ServiceWorkerIdentifier, uint64_t scriptExecutionContextIdentifier) final;
+ void postMessageToServiceWorkerGlobalScope(WebCore::ServiceWorkerIdentifier destinationIdentifier, Ref<WebCore::SerializedScriptValue>&&, WebCore::DocumentIdentifier sourceContextIdentifier, WebCore::ServiceWorkerClientData&& source) final;
+ void serviceWorkerStartedControllingClient(WebCore::ServiceWorkerIdentifier, WebCore::DocumentIdentifier) final;
+ void serviceWorkerStoppedControllingClient(WebCore::ServiceWorkerIdentifier, WebCore::DocumentIdentifier) final;
void matchRegistration(const WebCore::SecurityOrigin& topOrigin, const WebCore::URL& clientURL, RegistrationCallback&&) final;
void didMatchRegistration(uint64_t matchRequestIdentifier, std::optional<WebCore::ServiceWorkerRegistrationData>&&);
Modified: trunk/Source/WebKit/WebProcess/Storage/WebSWClientConnection.messages.in (225183 => 225184)
--- trunk/Source/WebKit/WebProcess/Storage/WebSWClientConnection.messages.in 2017-11-27 19:40:45 UTC (rev 225183)
+++ trunk/Source/WebKit/WebProcess/Storage/WebSWClientConnection.messages.in 2017-11-27 19:51:13 UTC (rev 225184)
@@ -31,11 +31,11 @@
UpdateRegistrationState(WebCore::ServiceWorkerRegistrationIdentifier identifier, enum WebCore::ServiceWorkerRegistrationState state, std::optional<WebCore::ServiceWorkerData> serviceWorkerIdentifier)
UpdateWorkerState(WebCore::ServiceWorkerIdentifier serviceWorkerIdentifier, enum WebCore::ServiceWorkerState state)
FireUpdateFoundEvent(WebCore::ServiceWorkerRegistrationIdentifier identifier)
- NotifyClientsOfControllerChange(HashSet<uint64_t> scriptExecutionContexts, struct WebCore::ServiceWorkerData newController)
+ NotifyClientsOfControllerChange(HashSet<WebCore::DocumentIdentifier> contextIdentifiers, struct WebCore::ServiceWorkerData newController)
InitializeSWOriginTableAsEmpty()
SetSWOriginTableSharedMemory(WebKit::SharedMemory::Handle handle)
- PostMessageToServiceWorkerClient(uint64_t destinationScriptExecutionContextIdentifier, IPC::DataReference message, struct WebCore::ServiceWorkerData source, String sourceOrigin)
+ PostMessageToServiceWorkerClient(WebCore::DocumentIdentifier destinationContextIdentifier, IPC::DataReference message, struct WebCore::ServiceWorkerData source, String sourceOrigin)
DidMatchRegistration(uint64_t matchRequestIdentifier, std::optional<WebCore::ServiceWorkerRegistrationData> data)
DidGetRegistrations(uint64_t matchRequestIdentifier, Vector<WebCore::ServiceWorkerRegistrationData> registrations)