WebKit Bugzilla
Attachment 360463 Details for
Bug 193848
: Make sure WTF::generateObjectIdentifier() internal counter does not get duplicated
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193848-20190129085850.patch (text/plain), 29.08 KB, created by
Chris Dumez
on 2019-01-29 08:58:51 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2019-01-29 08:58:51 PST
Size:
29.08 KB
patch
obsolete
>Subversion Revision: 240658 >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index 0723582a826984dd4cda100fb058113e464fb5d1..7fde76908542e3348a3308484aa716bd8fd486bf 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,26 @@ >+2019-01-25 Chris Dumez <cdumez@apple.com> >+ >+ Make sure WTF::generateObjectIdentifier() internal counter does not get duplicated >+ https://bugs.webkit.org/show_bug.cgi?id=193848 >+ >+ Reviewed by Ryosuke Niwa. >+ >+ Move WTF::generateObjectIdentifier()'s internal counter out-of-line so make sure it never gets >+ duplicated at each call site. This has caused some hard-to-debug issues with duplicate >+ identifiers such as Bug 193761. >+ >+ Also move it to ObjectIdentifier and rename it to generate() as this make call sites nicer >+ when they have a typedef for the ObjectIdentifier<T> type. >+ >+ * WTF.xcodeproj/project.pbxproj: >+ * wtf/CMakeLists.txt: >+ * wtf/ObjectIdentifier.cpp: Copied from Source/WebCore/platform/Process.cpp. >+ (WTF::ObjectIdentifierBase::generateIdentifierInternal): >+ (WTF::ObjectIdentifierBase::generateThreadSafeIdentifierInternal): >+ * wtf/ObjectIdentifier.h: >+ (WTF::ObjectIdentifier::generate): >+ (WTF::ObjectIdentifier::generateThreadSafe): >+ > 2019-01-28 Ross Kirsling <ross.kirsling@sony.com> > > Move platform-specific files out of WTF root directory. >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index fe06edf97195e8d7fd9841ff876e2223a1debffa..4d14a3cf2b94ea5d76ea607f2dc62f97b815e982 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,35 @@ >+2019-01-25 Chris Dumez <cdumez@apple.com> >+ >+ Make sure WTF::generateObjectIdentifier() internal counter does not get duplicated >+ https://bugs.webkit.org/show_bug.cgi?id=193848 >+ >+ Reviewed by Ryosuke Niwa. >+ >+ * dom/Document.cpp: >+ * dom/MessageChannel.cpp: >+ (WebCore::MessageChannel::MessageChannel): >+ * dom/ScriptExecutionContext.cpp: >+ (WebCore::ScriptExecutionContext::contextIdentifier const): >+ * history/HistoryItem.cpp: >+ (WebCore::HistoryItem::HistoryItem): >+ * loader/DocumentLoader.cpp: >+ (WebCore::DocumentLoader::registerTemporaryServiceWorkerClient): >+ * page/DOMWindow.cpp: >+ (WebCore::DOMWindow::DOMWindow): >+ * platform/Process.cpp: >+ (WebCore::Process::identifier): >+ * workers/service/ServiceWorkerJobData.cpp: >+ (WebCore::ServiceWorkerJobData::ServiceWorkerJobData): >+ * workers/service/server/RegistrationDatabase.cpp: >+ (WebCore::RegistrationDatabase::importRecords): >+ * workers/service/server/SWServer.cpp: >+ (WebCore::SWServer::Connection::Connection): >+ (WebCore::SWServer::updateWorker): >+ * workers/service/server/SWServerRegistration.cpp: >+ (WebCore::generateServiceWorkerRegistrationIdentifier): >+ * workers/service/server/SWServerToContextConnection.cpp: >+ (WebCore::generateServerToContextConnectionIdentifier): >+ > > 2019-01-29 Alex Christensen <achristensen@webkit.org> > >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 4300795d73777468be0aa2c42d59e445260bcc48..1cb96e9f7407c4a8e9c48384a4731cc66e6a0e63 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,21 @@ >+2019-01-25 Chris Dumez <cdumez@apple.com> >+ >+ Make sure WTF::generateObjectIdentifier() internal counter does not get duplicated >+ https://bugs.webkit.org/show_bug.cgi?id=193848 >+ >+ Reviewed by Ryosuke Niwa. >+ >+ * Platform/IPC/Connection.cpp: >+ (IPC::Connection::Connection): >+ * UIProcess/ChildProcessProxy.h: >+ * UIProcess/UserContent/WebUserContentControllerProxy.cpp: >+ (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy): >+ * UIProcess/WebBackForwardList.cpp: >+ (WebKit::WebBackForwardList::restoreFromState): >+ * UIProcess/WebProcessPool.cpp: >+ * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: >+ (WebKit::UserMediaPermissionRequestManager::addDeviceChangeObserver): >+ > 2019-01-28 Ryosuke Niwa <rniwa@webkit.org> > > User agent string override for navigator.userAgent should be site specific quirks >diff --git a/Source/WTF/WTF.xcodeproj/project.pbxproj b/Source/WTF/WTF.xcodeproj/project.pbxproj >index 127ca509d727d092acdfac2abe717daf1a30debe..5ad514da9e964edeff3ec8aa54345166fd3304f8 100644 >--- a/Source/WTF/WTF.xcodeproj/project.pbxproj >+++ b/Source/WTF/WTF.xcodeproj/project.pbxproj >@@ -83,6 +83,7 @@ > 7AF023B52061E17000A8EFD6 /* ProcessPrivilege.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AF023B42061E16F00A8EFD6 /* ProcessPrivilege.cpp */; }; > 7AFEC6B11EB22B5900DADE36 /* UUID.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AFEC6B01EB22B5900DADE36 /* UUID.cpp */; }; > 8134013815B092FD001FF0B8 /* Base64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8134013615B092FD001FF0B8 /* Base64.cpp */; }; >+ 8348BA0E21FBC0D500FD3054 /* ObjectIdentifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8348BA0D21FBC0D400FD3054 /* ObjectIdentifier.cpp */; }; > 93934BD318A1E8C300D0D6A1 /* StringViewCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93934BD218A1E8C300D0D6A1 /* StringViewCocoa.mm */; }; > 93934BD518A1F16900D0D6A1 /* StringViewCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93934BD418A1F16900D0D6A1 /* StringViewCF.cpp */; }; > 93F1993E19D7958D00C2390B /* StringView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F1993D19D7958D00C2390B /* StringView.cpp */; }; >@@ -414,6 +415,7 @@ > 7E29C33D15FFD79B00516D61 /* ObjCRuntimeExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjCRuntimeExtras.h; sourceTree = "<group>"; }; > 8134013615B092FD001FF0B8 /* Base64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Base64.cpp; sourceTree = "<group>"; }; > 8134013715B092FD001FF0B8 /* Base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Base64.h; sourceTree = "<group>"; }; >+ 8348BA0D21FBC0D400FD3054 /* ObjectIdentifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ObjectIdentifier.cpp; sourceTree = "<group>"; }; > 83A8AC3D1FABBE94002064AC /* ObjectIdentifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjectIdentifier.h; sourceTree = "<group>"; }; > 83ABB3C020B3823200BA3306 /* WeakObjCPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakObjCPtr.h; sourceTree = "<group>"; }; > 83F2BADE1CF9524E003E99C3 /* Function.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Function.h; sourceTree = "<group>"; }; >@@ -1033,6 +1035,7 @@ > A8A472D5151A825B004123FF /* NumberOfCores.cpp */, > A8A472D6151A825B004123FF /* NumberOfCores.h */, > 7E29C33D15FFD79B00516D61 /* ObjCRuntimeExtras.h */, >+ 8348BA0D21FBC0D400FD3054 /* ObjectIdentifier.cpp */, > 83A8AC3D1FABBE94002064AC /* ObjectIdentifier.h */, > 1AFDE6521953B23D00C48FFA /* Optional.h */, > 1A4656181C7FC68E00F5920F /* OptionSet.h */, >@@ -1548,6 +1551,7 @@ > 0F66B28C1DC97BAB004A1D3F /* MonotonicTime.cpp in Sources */, > 5CC0EE8A2162BC2200A1A842 /* NSURLExtras.mm in Sources */, > A8A473F4151A825B004123FF /* NumberOfCores.cpp in Sources */, >+ 8348BA0E21FBC0D500FD3054 /* ObjectIdentifier.cpp in Sources */, > A3EE5C3A21FFAC5F00FABD61 /* OSAllocatorPOSIX.cpp in Sources */, > A8A473F9151A825B004123FF /* OSRandomSource.cpp in Sources */, > A8A47402151A825B004123FF /* PageBlock.cpp in Sources */, >diff --git a/Source/WTF/wtf/CMakeLists.txt b/Source/WTF/wtf/CMakeLists.txt >index 178383dff491b4b1bb1a2d69000d2f6a430e0b52..1c6d7300581228b55dbd4e34469ebefc43977fc2 100644 >--- a/Source/WTF/wtf/CMakeLists.txt >+++ b/Source/WTF/wtf/CMakeLists.txt >@@ -375,6 +375,7 @@ set(WTF_SOURCES > MonotonicTime.cpp > NumberOfCores.cpp > OSRandomSource.cpp >+ ObjectIdentifier.cpp > PageBlock.cpp > ParallelHelperPool.cpp > ParallelJobsGeneric.cpp >diff --git a/Source/WTF/wtf/ObjectIdentifier.cpp b/Source/WTF/wtf/ObjectIdentifier.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..7e40d48a2ff798a6d8e9f2dd92aa6011123c6f2b >--- /dev/null >+++ b/Source/WTF/wtf/ObjectIdentifier.cpp >@@ -0,0 +1,48 @@ >+/* >+ * Copyright (C) 2019 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. >+ */ >+ >+#include "config.h" >+#include "ObjectIdentifier.h" >+ >+ >+namespace WTF { >+ >+uint64_t ObjectIdentifierBase::generateIdentifierInternal() >+{ >+ static uint64_t current; >+ return ++current; >+} >+ >+uint64_t ObjectIdentifierBase::generateThreadSafeIdentifierInternal() >+{ >+ static LazyNeverDestroyed<std::atomic<uint64_t>> current; >+ static std::once_flag initializeCurrentIdentifier; >+ std::call_once(initializeCurrentIdentifier, [] { >+ current.construct(0); >+ }); >+ return ++current.get(); >+} >+ >+} // namespace WTF >diff --git a/Source/WTF/wtf/ObjectIdentifier.h b/Source/WTF/wtf/ObjectIdentifier.h >index 6615269979340828a1c0eb7cc4a00713f19cbfe7..40897b59d07a3c0550ae2323c1c19bb295339fd8 100644 >--- a/Source/WTF/wtf/ObjectIdentifier.h >+++ b/Source/WTF/wtf/ObjectIdentifier.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2017 Apple Inc. All rights reserved. >+ * Copyright (C) 2017-2019 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -33,8 +33,24 @@ > > namespace WTF { > >-template<typename T> class ObjectIdentifier { >+class ObjectIdentifierBase { >+protected: >+ WTF_EXPORT_PRIVATE static uint64_t generateIdentifierInternal(); >+ WTF_EXPORT_PRIVATE static uint64_t generateThreadSafeIdentifierInternal(); >+}; >+ >+template<typename T> class ObjectIdentifier : private ObjectIdentifierBase { > public: >+ static ObjectIdentifier generate() >+ { >+ return ObjectIdentifier { generateIdentifierInternal() }; >+ } >+ >+ static ObjectIdentifier generateThreadSafe() >+ { >+ return ObjectIdentifier { generateThreadSafeIdentifierInternal() }; >+ } >+ > ObjectIdentifier() = default; > > ObjectIdentifier(HashTableDeletedValueType) : m_identifier(hashTableDeletedValue()) { } >@@ -74,8 +90,6 @@ public: > } > > private: >- template<typename U> friend ObjectIdentifier<U> generateObjectIdentifier(); >- template<typename U> friend ObjectIdentifier<U> generateThreadSafeObjectIdentifier(); > template<typename U> friend ObjectIdentifier<U> makeObjectIdentifier(uint64_t); > friend struct HashTraits<ObjectIdentifier>; > template<typename U> friend struct ObjectIdentifierHash; >@@ -91,22 +105,6 @@ private: > uint64_t m_identifier { 0 }; > }; > >-template<typename T> inline ObjectIdentifier<T> generateObjectIdentifier() >-{ >- static uint64_t currentIdentifier; >- return ObjectIdentifier<T> { ++currentIdentifier }; >-} >- >-template<typename T> inline ObjectIdentifier<T> generateThreadSafeObjectIdentifier() >-{ >- static LazyNeverDestroyed<std::atomic<uint64_t>> currentIdentifier; >- static std::once_flag initializeCurrentIdentifier; >- std::call_once(initializeCurrentIdentifier, [] { >- currentIdentifier.construct(0); >- }); >- return ObjectIdentifier<T> { ++currentIdentifier.get() }; >-} >- > template<typename T> inline ObjectIdentifier<T> makeObjectIdentifier(uint64_t identifier) > { > return ObjectIdentifier<T> { identifier }; >@@ -127,6 +125,4 @@ template<typename T> struct DefaultHash<ObjectIdentifier<T>> { > } // namespace WTF > > using WTF::ObjectIdentifier; >-using WTF::generateObjectIdentifier; >-using WTF::generateThreadSafeObjectIdentifier; > using WTF::makeObjectIdentifier; >diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp >index 03254121014e5cdc55a3f1dae25df329be75b13b..50bccefcde471977ce9bf431e310104a809b9e2a 100644 >--- a/Source/WebCore/dom/Document.cpp >+++ b/Source/WebCore/dom/Document.cpp >@@ -533,7 +533,7 @@ Document::Document(Frame* frame, const URL& url, unsigned documentClasses, unsig > , m_isSynthesized(constructionFlags & Synthesized) > , m_isNonRenderedPlaceholder(constructionFlags & NonRenderedPlaceholder) > , m_orientationNotifier(currentOrientation(frame)) >- , m_identifier(generateObjectIdentifier<DocumentIdentifierType>()) >+ , m_identifier(DocumentIdentifier::generate()) > , m_undoManager(UndoManager::create(*this)) > { > auto addResult = allDocumentsMap().add(m_identifier, this); >diff --git a/Source/WebCore/dom/MessageChannel.cpp b/Source/WebCore/dom/MessageChannel.cpp >index 72932d852bcd28ee5854870800383e262efd0b24..8dcfe1f7ba2195bcd290c1da79d635d2169809c9 100644 >--- a/Source/WebCore/dom/MessageChannel.cpp >+++ b/Source/WebCore/dom/MessageChannel.cpp >@@ -39,8 +39,8 @@ Ref<MessageChannel> MessageChannel::create(ScriptExecutionContext& context) > > MessageChannel::MessageChannel(ScriptExecutionContext& context) > { >- MessagePortIdentifier id1 = { Process::identifier(), generateObjectIdentifier<MessagePortIdentifier::PortIdentifierType>() }; >- MessagePortIdentifier id2 = { Process::identifier(), generateObjectIdentifier<MessagePortIdentifier::PortIdentifierType>() }; >+ MessagePortIdentifier id1 = { Process::identifier(), ObjectIdentifier<MessagePortIdentifier::PortIdentifierType>::generate() }; >+ MessagePortIdentifier id2 = { Process::identifier(), ObjectIdentifier<MessagePortIdentifier::PortIdentifierType>::generate() }; > > m_port1 = MessagePort::create(context, id1, id2); > m_port2 = MessagePort::create(context, id2, id1); >diff --git a/Source/WebCore/dom/ScriptExecutionContext.cpp b/Source/WebCore/dom/ScriptExecutionContext.cpp >index 3cfeb0579426e275fa52334988a4096dbc776ccd..e85985223f78e31b4a2b7fb08c6b10d81cfd2709 100644 >--- a/Source/WebCore/dom/ScriptExecutionContext.cpp >+++ b/Source/WebCore/dom/ScriptExecutionContext.cpp >@@ -105,7 +105,7 @@ ScriptExecutionContextIdentifier ScriptExecutionContext::contextIdentifier() con > if (!m_contextIdentifier) { > Locker<Lock> locker(allScriptExecutionContextsMapLock); > >- m_contextIdentifier = generateObjectIdentifier<ScriptExecutionContextIdentifierType>(); >+ m_contextIdentifier = ScriptExecutionContextIdentifier::generate(); > > ASSERT(!allScriptExecutionContextsMap().contains(m_contextIdentifier)); > allScriptExecutionContextsMap().add(m_contextIdentifier, const_cast<ScriptExecutionContext*>(this)); >diff --git a/Source/WebCore/history/HistoryItem.cpp b/Source/WebCore/history/HistoryItem.cpp >index 44d49c76f930f2f6d8ac846a90519ebd8e5af7f5..3c059e685b83fd70890a3ae65fba80d6270e6154 100644 >--- a/Source/WebCore/history/HistoryItem.cpp >+++ b/Source/WebCore/history/HistoryItem.cpp >@@ -66,7 +66,7 @@ HistoryItem::HistoryItem(const String& urlString, const String& title) > } > > HistoryItem::HistoryItem(const String& urlString, const String& title, const String& alternateTitle) >- : HistoryItem(urlString, title, alternateTitle, { Process::identifier(), generateObjectIdentifier<BackForwardItemIdentifier::ItemIdentifierType>() }) >+ : HistoryItem(urlString, title, alternateTitle, { Process::identifier(), ObjectIdentifier<BackForwardItemIdentifier::ItemIdentifierType>::generate() }) > { > } > >diff --git a/Source/WebCore/loader/DocumentLoader.cpp b/Source/WebCore/loader/DocumentLoader.cpp >index 4754beab7aa95a6f1e3f925322b91e9f169c56f6..6ac2131cdad8967a410a136d2c8b2e10e2d636ec 100644 >--- a/Source/WebCore/loader/DocumentLoader.cpp >+++ b/Source/WebCore/loader/DocumentLoader.cpp >@@ -1779,7 +1779,7 @@ void DocumentLoader::registerTemporaryServiceWorkerClient(const URL& url) > return; > > m_temporaryServiceWorkerClient = TemporaryServiceWorkerClient { >- generateObjectIdentifier<DocumentIdentifierType>(), >+ DocumentIdentifier::generate(), > *ServiceWorkerProvider::singleton().existingServiceWorkerConnectionForSession(m_frame->page()->sessionID()) > }; > >diff --git a/Source/WebCore/page/DOMWindow.cpp b/Source/WebCore/page/DOMWindow.cpp >index 58e0b0851a3b39900a3727d3a6c564918988df20..0979336d0a58e08adac1f8b83230104c0f7454ae 100644 >--- a/Source/WebCore/page/DOMWindow.cpp >+++ b/Source/WebCore/page/DOMWindow.cpp >@@ -404,7 +404,7 @@ void DOMWindow::setCanShowModalDialogOverride(bool allow) > } > > DOMWindow::DOMWindow(Document& document) >- : AbstractDOMWindow(GlobalWindowIdentifier { Process::identifier(), generateObjectIdentifier<WindowIdentifierType>() }) >+ : AbstractDOMWindow(GlobalWindowIdentifier { Process::identifier(), WindowIdentifier::generate() }) > , ContextDestructionObserver(&document) > { > ASSERT(frame()); >diff --git a/Source/WebCore/platform/ProcessIdentifier.cpp b/Source/WebCore/platform/ProcessIdentifier.cpp >index 94dc5ea3b635fd83fae0d230cc1bff5b8c417e00..e9dd68df2fb4ed617c3baeeff389bb7d98678146 100644 >--- a/Source/WebCore/platform/ProcessIdentifier.cpp >+++ b/Source/WebCore/platform/ProcessIdentifier.cpp >@@ -44,7 +44,7 @@ ProcessIdentifier identifier() > static std::once_flag onceFlag; > std::call_once(onceFlag, [] { > if (!globalIdentifier) >- globalIdentifier = generateObjectIdentifier<ProcessIdentifierType>(); >+ globalIdentifier = ProcessIdentifier::generate(); > }); > > return *globalIdentifier; >diff --git a/Source/WebCore/workers/service/ServiceWorkerJobData.cpp b/Source/WebCore/workers/service/ServiceWorkerJobData.cpp >index 29c80e17762a66a3f8bb0a6226376bb4c961a4bf..47a79f0a3f766dd5e54821a9b2ed23255d6cf41e 100644 >--- a/Source/WebCore/workers/service/ServiceWorkerJobData.cpp >+++ b/Source/WebCore/workers/service/ServiceWorkerJobData.cpp >@@ -36,7 +36,7 @@ ServiceWorkerJobData::ServiceWorkerJobData(const Identifier& identifier) > } > > ServiceWorkerJobData::ServiceWorkerJobData(SWServerConnectionIdentifier connectionIdentifier, const DocumentOrWorkerIdentifier& localSourceContext) >- : m_identifier { connectionIdentifier, generateThreadSafeObjectIdentifier<ServiceWorkerJobIdentifierType>() } >+ : m_identifier { connectionIdentifier, ServiceWorkerJobIdentifier::generateThreadSafe() } > { > WTF::switchOn(localSourceContext, [&](DocumentIdentifier documentIdentifier) { > sourceContext = ServiceWorkerClientIdentifier { connectionIdentifier, documentIdentifier }; >diff --git a/Source/WebCore/workers/service/server/RegistrationDatabase.cpp b/Source/WebCore/workers/service/server/RegistrationDatabase.cpp >index 56dd9bc8e3305388bbf577f56ae65261d24ae379..b629f4326f9722b167366bba648870a1d6f85e78 100644 >--- a/Source/WebCore/workers/service/server/RegistrationDatabase.cpp >+++ b/Source/WebCore/workers/service/server/RegistrationDatabase.cpp >@@ -400,8 +400,8 @@ String RegistrationDatabase::importRecords() > if (!key || !originURL.isValid() || !topOrigin || !updateViaCache || !scriptURL.isValid() || !workerType) > continue; > >- auto workerIdentifier = generateObjectIdentifier<ServiceWorkerIdentifierType>(); >- auto registrationIdentifier = generateObjectIdentifier<ServiceWorkerRegistrationIdentifierType>(); >+ auto workerIdentifier = ServiceWorkerIdentifier::generate(); >+ 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) }; >diff --git a/Source/WebCore/workers/service/server/SWServer.cpp b/Source/WebCore/workers/service/server/SWServer.cpp >index 044bc841388279dd52a6634e6b2b1335674c66be..df2b8ee24535a62239808927628aaf7ce01f1d84 100644 >--- a/Source/WebCore/workers/service/server/SWServer.cpp >+++ b/Source/WebCore/workers/service/server/SWServer.cpp >@@ -52,7 +52,7 @@ static Seconds terminationDelay { 10_s }; > > SWServer::Connection::Connection(SWServer& server) > : m_server(server) >- , m_identifier(generateObjectIdentifier<SWServerConnectionIdentifierType>()) >+ , m_identifier(SWServerConnectionIdentifier::generate()) > { > } > >@@ -505,7 +505,7 @@ void SWServer::removeClientServiceWorkerRegistration(Connection& connection, Ser > > 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(), generateObjectIdentifier<ServiceWorkerIdentifierType>(), script, contentSecurityPolicy, referrerPolicy, url, type, sessionID(), false, WTFMove(scriptResourceMap) }); >+ tryInstallContextData({ jobDataIdentifier, registration.data(), ServiceWorkerIdentifier::generate(), script, contentSecurityPolicy, referrerPolicy, url, type, sessionID(), false, WTFMove(scriptResourceMap) }); > } > > void SWServer::tryInstallContextData(ServiceWorkerContextData&& data) >diff --git a/Source/WebCore/workers/service/server/SWServerRegistration.cpp b/Source/WebCore/workers/service/server/SWServerRegistration.cpp >index 6567ca4fbbbcd949388d4d1e4c0d41a980918739..4d1c554f4602a955e2eb13413f723cd0b523bcf5 100644 >--- a/Source/WebCore/workers/service/server/SWServerRegistration.cpp >+++ b/Source/WebCore/workers/service/server/SWServerRegistration.cpp >@@ -37,7 +37,7 @@ namespace WebCore { > > static ServiceWorkerRegistrationIdentifier generateServiceWorkerRegistrationIdentifier() > { >- return generateObjectIdentifier<ServiceWorkerRegistrationIdentifierType>(); >+ return ServiceWorkerRegistrationIdentifier::generate(); > } > > SWServerRegistration::SWServerRegistration(SWServer& server, const ServiceWorkerRegistrationKey& key, ServiceWorkerUpdateViaCache updateViaCache, const URL& scopeURL, const URL& scriptURL) >diff --git a/Source/WebCore/workers/service/server/SWServerToContextConnection.cpp b/Source/WebCore/workers/service/server/SWServerToContextConnection.cpp >index 3ea309d307ded63a7c5a4833194ac66c8c748ee8..70caf2f92b14ac6302a6ae42c46d3db1fc71e05d 100644 >--- a/Source/WebCore/workers/service/server/SWServerToContextConnection.cpp >+++ b/Source/WebCore/workers/service/server/SWServerToContextConnection.cpp >@@ -36,7 +36,7 @@ namespace WebCore { > > static SWServerToContextConnectionIdentifier generateServerToContextConnectionIdentifier() > { >- return generateObjectIdentifier<SWServerToContextConnectionIdentifierType>(); >+ return SWServerToContextConnectionIdentifier::generate(); > } > > static HashMap<SecurityOriginData, SWServerToContextConnection*>& allConnectionsByOrigin() >diff --git a/Source/WebKit/Platform/IPC/Connection.cpp b/Source/WebKit/Platform/IPC/Connection.cpp >index a4236cb86cd188e65a2def828b09690281fdecb7..174b04c1ea0ac13d3fa87aa93002bc542d145b6f 100644 >--- a/Source/WebKit/Platform/IPC/Connection.cpp >+++ b/Source/WebKit/Platform/IPC/Connection.cpp >@@ -245,7 +245,7 @@ static HashMap<uintptr_t, HashMap<uint64_t, CompletionHandler<void(Decoder*)>>>& > > Connection::Connection(Identifier identifier, bool isServer, Client& client) > : m_client(client) >- , m_uniqueID(generateObjectIdentifier<UniqueIDType>()) >+ , m_uniqueID(UniqueID::generate()) > , m_isServer(isServer) > , m_syncRequestID(0) > , m_onlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage(false) >diff --git a/Source/WebKit/UIProcess/ChildProcessProxy.h b/Source/WebKit/UIProcess/ChildProcessProxy.h >index 1bd0b9bbf2aa80f2ffffda23efedc3eea5709332..83f804844796a075cb974d3f940d4ad076a27918 100644 >--- a/Source/WebKit/UIProcess/ChildProcessProxy.h >+++ b/Source/WebKit/UIProcess/ChildProcessProxy.h >@@ -105,7 +105,7 @@ private: > RefPtr<IPC::Connection> m_connection; > IPC::MessageReceiverMap m_messageReceiverMap; > bool m_alwaysRunsAtBackgroundPriority { false }; >- WebCore::ProcessIdentifier m_processIdentifier { generateObjectIdentifier<WebCore::ProcessIdentifierType>() }; >+ WebCore::ProcessIdentifier m_processIdentifier { WebCore::ProcessIdentifier::generate() }; > }; > > template<typename T> >diff --git a/Source/WebKit/UIProcess/UserContent/WebUserContentControllerProxy.cpp b/Source/WebKit/UIProcess/UserContent/WebUserContentControllerProxy.cpp >index 751ace51aa976dbeb3f13256d50f86780df73353..9711b2337215879116c3dd8b466ef5585ae98582 100644 >--- a/Source/WebKit/UIProcess/UserContent/WebUserContentControllerProxy.cpp >+++ b/Source/WebKit/UIProcess/UserContent/WebUserContentControllerProxy.cpp >@@ -62,7 +62,7 @@ WebUserContentControllerProxy* WebUserContentControllerProxy::get(UserContentCon > } > > WebUserContentControllerProxy::WebUserContentControllerProxy() >- : m_identifier(generateObjectIdentifier<UserContentControllerIdentifierType>()) >+ : m_identifier(UserContentControllerIdentifier::generate()) > , m_userScripts(API::Array::create()) > , m_userStyleSheets(API::Array::create()) > { >diff --git a/Source/WebKit/UIProcess/WebBackForwardList.cpp b/Source/WebKit/UIProcess/WebBackForwardList.cpp >index 7ae26b2f3b832df30abf5cf2b24d1be6231a5407..f2d5a162c407213ca829164d94ea265b9dd1c5c8 100644 >--- a/Source/WebKit/UIProcess/WebBackForwardList.cpp >+++ b/Source/WebKit/UIProcess/WebBackForwardList.cpp >@@ -434,7 +434,7 @@ void WebBackForwardList::restoreFromState(BackForwardListState backForwardListSt > items.reserveInitialCapacity(backForwardListState.items.size()); > > for (auto& backForwardListItemState : backForwardListState.items) { >- backForwardListItemState.identifier = { Process::identifier(), generateObjectIdentifier<BackForwardItemIdentifier::ItemIdentifierType>() }; >+ backForwardListItemState.identifier = { Process::identifier(), ObjectIdentifier<BackForwardItemIdentifier::ItemIdentifierType>::generate() }; > items.uncheckedAppend(WebBackForwardListItem::create(WTFMove(backForwardListItemState), m_page->pageID())); > } > m_currentIndex = backForwardListState.currentIndex ? Optional<size_t>(*backForwardListState.currentIndex) : WTF::nullopt; >diff --git a/Source/WebKit/UIProcess/WebProcessPool.cpp b/Source/WebKit/UIProcess/WebProcessPool.cpp >index 7f78c6eadbbdf5bf163ad4fbcb469137051d5e7f..b681d865de09c65a9ed946671a9136276739ccbb 100644 >--- a/Source/WebKit/UIProcess/WebProcessPool.cpp >+++ b/Source/WebKit/UIProcess/WebProcessPool.cpp >@@ -260,7 +260,7 @@ WebProcessPool::WebProcessPool(API::ProcessPoolConfiguration& configuration) > std::call_once(onceFlag, [] { > WTF::setProcessPrivileges(allPrivileges()); > WebCore::NetworkStorageSession::permitProcessToUseCookieAPI(true); >- Process::setIdentifier(generateObjectIdentifier<WebCore::ProcessIdentifierType>()); >+ Process::setIdentifier(WebCore::ProcessIdentifier::generate()); > }); > > if (m_configuration->shouldHaveLegacyDataStore()) >diff --git a/Source/WebKit/WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp b/Source/WebKit/WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp >index 5623cc03140ab66a9f6cf5563970be527653faf0..c179e8d8d32b05dee4be76043a4678b95898625a 100644 >--- a/Source/WebKit/WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp >+++ b/Source/WebKit/WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp >@@ -232,7 +232,7 @@ void UserMediaPermissionRequestManager::revokeUserMediaDeviceSandboxExtensions(c > > UserMediaClient::DeviceChangeObserverToken UserMediaPermissionRequestManager::addDeviceChangeObserver(WTF::Function<void()>&& observer) > { >- auto identifier = generateObjectIdentifier<WebCore::UserMediaClient::DeviceChangeObserverTokenType>(); >+ auto identifier = WebCore::UserMediaClient::DeviceChangeObserverToken::generate(); > m_deviceChangeObserverMap.add(identifier, WTFMove(observer)); > > if (!m_monitoringDeviceChange) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193848
:
360173
|
360463
|
360465