Title: [288950] trunk
Revision
288950
Author
[email protected]
Date
2022-02-02 02:30:01 -0800 (Wed, 02 Feb 2022)

Log Message

Clarify that some UUID routines are dedicated to UUID v4
https://bugs.webkit.org/show_bug.cgi?id=235430

Reviewed by Darin Adler.

Source/WebCore:

No change of behavior, this is renaming only.

* Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
(WebCore::CDMSessionClearKey::CDMSessionClearKey):
* Modules/entriesapi/DOMFileSystem.cpp:
(WebCore::DOMFileSystem::DOMFileSystem):
* Modules/highlight/AppHighlightStorage.cpp:
(WebCore::createAppHighlightRangeData):
* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::generateUUID):
* Modules/mediastream/MediaDevices.cpp:
(WebCore::MediaDevices::MediaDevices):
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::create):
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::generateDatabaseFileName):
* accessibility/atspi/AccessibilityAtspi.cpp:
(WebCore::AccessibilityAtspi::registerRoot):
(WebCore::AccessibilityAtspi::registerObject):
(WebCore::AccessibilityAtspi::registerHyperlink):
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::copyPropertiesFromSource):
(WebCore::KeyframeEffect::updateBlendingKeyframes):
(WebCore::KeyframeEffect::computeCSSTransitionBlendingKeyframes):
* dom/Document.cpp:
(WebCore::Document::originIdentifierForPasteboard const):
(WebCore::Document::didInsertAttachmentElement):
* fileapi/BlobURL.cpp:
(WebCore::BlobURL::createBlobURL):
* html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::ensureUniqueIdentifier):
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::writeDataToUniqueFileInDirectory):
* page/Crypto.cpp:
(WebCore::Crypto::randomUUID const):
* platform/ScriptExecutionContextIdentifier.h:
(WebCore::ProcessQualified<UUID>::generate):
* platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
(WebCore::CDMSessionAVFoundationCF::CDMSessionAVFoundationCF):
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
(WebCore::CDMSessionAVFoundationObjC::CDMSessionAVFoundationObjC):
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
(WebCore::CDMSessionAVStreamSession::update):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateAnimations):
* platform/mediastream/MediaStreamPrivate.h:
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::create):
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::RealtimeMediaSource):
* platform/mediastream/gstreamer/GStreamerDisplayCaptureDeviceManager.cpp:
(WebCore::GStreamerDisplayCaptureDeviceManager::computeCaptureDevices):
* platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
(webkitMediaStreamSrcPostStreamCollection):
* platform/mediastream/ios/ReplayKitCaptureSource.mm:
(WebCore::screenDeviceUUID):
* testing/Internals.cpp:
(WebCore::Internals::isDocumentAlive const):
* testing/MockCDMFactory.cpp:
(WebCore::MockCDMInstanceSession::requestLicense):

Source/WebDriver:

* glib/SessionHostGlib.cpp:
(WebDriver::SessionHost::startAutomationSession):
* socket/SessionHostSocket.cpp:
(WebDriver::SessionHost::startAutomationSession):

Source/WebKit:

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::ensureSession):
* NetworkProcess/cache/CacheStorageEngineCache.cpp:
(WebKit::CacheStorage::Cache::toRecordInformation):
* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
(WebKit::CacheStorage::Caches::open):
* NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
(WebKit::NetworkMDNSRegister::registerMDNSName):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _insertAttachmentWithFileWrapper:contentType:completion:]):
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::handleForWebPageProxy):
(WebKit::WebAutomationSession::handleForWebFrameID):
* UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
* UIProcess/Cocoa/WKShareSheet.mm:
(+[WKShareSheet createRandomSharingDirectoryForFile:]):
* UIProcess/GeolocationPermissionRequestManagerProxy.cpp:
(WebKit::GeolocationPermissionRequestManagerProxy::didReceiveGeolocationPermissionDecision):
* UIProcess/WebAuthentication/Virtual/VirtualAuthenticatorManager.cpp:
(WebKit::VirtualAuthenticatorManager::createAuthenticator):
* UIProcess/gtk/WaylandCompositor.cpp:
(WebKit::WaylandCompositor::WaylandCompositor):
* UIProcess/ios/WKModelView.mm:
(-[WKModelView createFileForModel:]):
* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::createUUID):
* WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.mm:
(WebKit::ARKitInlinePreviewModelPlayerMac::createFile):
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::openWithPreview):
(WebKit::PDFPlugin::openWithNativeApplication):

Source/WebKitLegacy:

* WebCoreSupport/NetworkStorageSessionMap.cpp:
(NetworkStorageSessionMap::ensureSession):

Source/WTF:

Rename UUID::create to UUID::createVersion4.
Add a UUID::parseVersion4 that validates the parsed UUID is a v4.
Rename createCanonicalUUIDString to createVersion4UUIDString for consistency.

Update UUID constructor to generate a UUID v4 as per spec.
Update UUID::toString to generate a string representation of any UUID, and not specifically to v4.

* wtf/Identified.h:
(WTF::UUIDIdentified::UUIDIdentified):
* wtf/URL.cpp:
(WTF::URL::fakeURLWithRelativePart):
* wtf/UUID.cpp:
(WTF::UUID::UUID):
(WTF::UUID::toString const):
(WTF::UUID::parse):
(WTF::UUID::parseVersion4):
(WTF::createVersion4UUIDString):
(WTF::isVersion4UUID):
(WTF::createCanonicalUUIDString): Deleted.
* wtf/UUID.h:
(WTF::UUID::createVersion4):
(WTF::UUID::create): Deleted.
* wtf/glib/FileSystemGlib.cpp:
(WTF::FileSystemImpl::openTemporaryFile):

Tools:

* TestWebKitAPI/Tests/WTF/UUID.cpp:
(parseAndStringifyUUID):
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/NetworkProcess.mm:
(waitUntilNetworkProcessIsResponsive):
* TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::saltForOrigin):

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (288949 => 288950)


--- trunk/Source/WTF/ChangeLog	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WTF/ChangeLog	2022-02-02 10:30:01 UTC (rev 288950)
@@ -1,3 +1,35 @@
+2022-02-02  Youenn Fablet  <[email protected]>
+
+        Clarify that some UUID routines are dedicated to UUID v4
+        https://bugs.webkit.org/show_bug.cgi?id=235430
+
+        Reviewed by Darin Adler.
+
+        Rename UUID::create to UUID::createVersion4.
+        Add a UUID::parseVersion4 that validates the parsed UUID is a v4.
+        Rename createCanonicalUUIDString to createVersion4UUIDString for consistency.
+
+        Update UUID constructor to generate a UUID v4 as per spec.
+        Update UUID::toString to generate a string representation of any UUID, and not specifically to v4.
+
+        * wtf/Identified.h:
+        (WTF::UUIDIdentified::UUIDIdentified):
+        * wtf/URL.cpp:
+        (WTF::URL::fakeURLWithRelativePart):
+        * wtf/UUID.cpp:
+        (WTF::UUID::UUID):
+        (WTF::UUID::toString const):
+        (WTF::UUID::parse):
+        (WTF::UUID::parseVersion4):
+        (WTF::createVersion4UUIDString):
+        (WTF::isVersion4UUID):
+        (WTF::createCanonicalUUIDString): Deleted.
+        * wtf/UUID.h:
+        (WTF::UUID::createVersion4):
+        (WTF::UUID::create): Deleted.
+        * wtf/glib/FileSystemGlib.cpp:
+        (WTF::FileSystemImpl::openTemporaryFile):
+
 2022-02-01  Wenson Hsieh  <[email protected]>
 
         The default values for a couple of Live Text-related features should respect system feature flags

Modified: trunk/Source/WTF/wtf/Identified.h (288949 => 288950)


--- trunk/Source/WTF/wtf/Identified.h	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WTF/wtf/Identified.h	2022-02-02 10:30:01 UTC (rev 288950)
@@ -109,7 +109,7 @@
 class UUIDIdentified : public IdentifiedBase<UUID, T> {
 protected:
     UUIDIdentified()
-        : IdentifiedBase<UUID, T>(UUID::create())
+        : IdentifiedBase<UUID, T>(UUID::createVersion4())
     {
     }
 

Modified: trunk/Source/WTF/wtf/URL.cpp (288949 => 288950)


--- trunk/Source/WTF/wtf/URL.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WTF/wtf/URL.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -1054,7 +1054,7 @@
 
 URL URL::fakeURLWithRelativePart(StringView relativePart)
 {
-    return URL(URL(), makeString("webkit-fake-url://", createCanonicalUUIDString(), '/', relativePart));
+    return URL(URL(), makeString("webkit-fake-url://", createVersion4UUIDString(), '/', relativePart));
 }
 
 URL URL::fileURLWithFileSystemPath(StringView path)

Modified: trunk/Source/WTF/wtf/UUID.cpp (288949 => 288950)


--- trunk/Source/WTF/wtf/UUID.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WTF/wtf/UUID.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -48,13 +48,11 @@
     static_assert(sizeof(m_data) == 16);
     auto* data = "" char*>(&m_data);
 
-    do {
-        cryptographicallyRandomValues(data, 16);
-    } while (m_data == emptyValue || m_data == deletedValue);
+    cryptographicallyRandomValues(data, 16);
 
-    // We sanitize the value to not loose any information when serializing as Version 4 UUID.
-    auto high = static_cast<uint64_t>((m_data >> 64) & 0xffffffffffff0fff);
-    auto low = static_cast<uint64_t>(m_data & 0x3fffffffffffffff);
+    // By default, we generate a v4 UUID value, as per https://datatracker.ietf.org/doc/html/rfc4122#section-4.4.
+    auto high = static_cast<uint64_t>((m_data >> 64) & 0xffffffffffff0fff) | 0x4000;
+    auto low = static_cast<uint64_t>(m_data & 0x3fffffffffffffff) | 0x8000000000000000;
 
     m_data = (static_cast<UInt128>(high) << 64) | low;
 }
@@ -67,7 +65,7 @@
 String UUID::toString() const
 {
     auto high = static_cast<uint64_t>(m_data >> 64);
-    auto low = static_cast<uint64_t>(m_data & 0x3fffffffffffffff);
+    auto low = static_cast<uint64_t>(m_data & 0xffffffffffffffff);
 
     // Format as Version 4 UUID.
     return makeString(
@@ -74,11 +72,11 @@
         hex(high >> 32, 8, Lowercase),
         '-',
         hex((high >> 16) & 0xffff, 4, Lowercase),
-        "-4",
-        hex(high & 0xfff, 3, Lowercase),
         '-',
-        hex((low >> 48) | 0x8000, 4, Lowercase),
+        hex(high & 0xffff, 4, Lowercase),
         '-',
+        hex(low >> 48, 4, Lowercase),
+        '-',
         hex(low & 0xffffffffffff, 12, Lowercase)
     );
 }
@@ -85,11 +83,11 @@
 
 std::optional<UUID> UUID::parse(StringView value)
 {
-    // Version 4 UUIDs have the form xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx with hexadecimal digits for x and one of 8, 9, A, or B for y.
+    // UUIDs have the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx with hexadecimal digits for x.
     if (value.length() != 36)
         return { };
 
-    if (value[8] != '-' || value[13] != '-'  || value[14] != '4' || value[18] != '-' || value[23] != '-')
+    if (value[8] != '-' || value[13] != '-'  || value[18] != '-' || value[23] != '-')
         return { };
 
     // parseInteger may accept integers starting with +, let's check this beforehand.
@@ -104,7 +102,7 @@
     if (!secondValue)
         return { };
 
-    auto thirdValue = parseInteger<uint64_t>(value.substring(15, 3), 16);
+    auto thirdValue = parseInteger<uint64_t>(value.substring(14, 4), 16);
     if (!thirdValue)
         return { };
 
@@ -112,11 +110,6 @@
     if (!fourthValue)
         return { };
 
-    // Fourth value starts with 'y', it must be above 0x8000 and below 0xBFFFF.
-    if ((*fourthValue & 0xc000) != 0x8000)
-        return { };
-    fourthValue = *fourthValue & 0x3fff;
-
     auto fifthValue = parseInteger<uint64_t>(value.substring(24, 12), 16);
     if (!fifthValue)
         return { };
@@ -125,17 +118,35 @@
     uint64_t low = (*fourthValue << 48) | *fifthValue;
 
     auto result = (static_cast<UInt128>(high) << 64) | low;
-    if (result == emptyValue || result == deletedValue)
+    if (result == deletedValue)
         return { };
 
     return UUID(result);
 }
 
-String createCanonicalUUIDString()
+std::optional<UUID> UUID::parseVersion4(StringView value)
 {
-    return UUID::create().toString();
+    auto uuid = parse(value);
+    if (!uuid)
+        return { };
+
+    // Version 4 UUIDs have the form xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx with hexadecimal digits for x and one of 8, 9, A, or B for y.
+    auto high = static_cast<uint64_t>(uuid->m_data >> 64);
+    if ((high & 0xf000) != 0x4000)
+        return { };
+
+    auto low = static_cast<uint64_t>(uuid->m_data & 0xffffffffffffffff);
+    if ((low >> 62) != 2)
+        return { };
+
+    return uuid;
 }
 
+String createVersion4UUIDString()
+{
+    return UUID::createVersion4().toString();
+}
+
 String bootSessionUUIDString()
 {
 #if OS(DARWIN)
@@ -157,7 +168,7 @@
 
 bool isVersion4UUID(StringView value)
 {
-    return !!UUID::parse(value);
+    return !!UUID::parseVersion4(value);
 }
 
 } // namespace WTF

Modified: trunk/Source/WTF/wtf/UUID.h (288949 => 288950)


--- trunk/Source/WTF/wtf/UUID.h	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WTF/wtf/UUID.h	2022-02-02 10:30:01 UTC (rev 288950)
@@ -44,12 +44,13 @@
     static constexpr UInt128 emptyValue = 0;
     static constexpr UInt128 deletedValue = 1;
 
-    static UUID create()
+    static UUID createVersion4()
     {
         return UUID { };
     }
 
-    WTF_EXPORT_PRIVATE static std::optional<UUID> parse(StringView);
+    static std::optional<UUID> parse(StringView);
+    WTF_EXPORT_PRIVATE static std::optional<UUID> parseVersion4(StringView);
 
     explicit UUID(Span<const uint8_t, 16> span)
     {
@@ -141,7 +142,7 @@
 // data source. Version 4 UUIDs have the form xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx with hexadecimal digits for x and one of 8,
 // 9, A, or B for y.
 
-WTF_EXPORT_PRIVATE String createCanonicalUUIDString();
+WTF_EXPORT_PRIVATE String createVersion4UUIDString();
 
 WTF_EXPORT_PRIVATE String bootSessionUUIDString();
 WTF_EXPORT_PRIVATE bool isVersion4UUID(StringView);
@@ -149,5 +150,5 @@
 }
 
 using WTF::UUID;
-using WTF::createCanonicalUUIDString;
+using WTF::createVersion4UUIDString;
 using WTF::bootSessionUUIDString;

Modified: trunk/Source/WTF/wtf/glib/FileSystemGlib.cpp (288949 => 288950)


--- trunk/Source/WTF/wtf/glib/FileSystemGlib.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WTF/wtf/glib/FileSystemGlib.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -145,7 +145,7 @@
     // FIXME: Suffix is not supported, but OK for now since the code using it is macOS-port-only.
     ASSERT_UNUSED(suffix, suffix.isEmpty());
 
-    GUniquePtr<gchar> filename(g_strdup_printf("%s%s", prefix.utf8().data(), createCanonicalUUIDString().utf8().data()));
+    GUniquePtr<gchar> filename(g_strdup_printf("%s%s", prefix.utf8().data(), createVersion4UUIDString().utf8().data()));
     GUniquePtr<gchar> tempPath(g_build_filename(g_get_tmp_dir(), filename.get(), nullptr));
     GRefPtr<GFile> file = adoptGRef(g_file_new_for_path(tempPath.get()));
 

Modified: trunk/Source/WebCore/ChangeLog (288949 => 288950)


--- trunk/Source/WebCore/ChangeLog	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebCore/ChangeLog	2022-02-02 10:30:01 UTC (rev 288950)
@@ -1,3 +1,71 @@
+2022-02-02  Youenn Fablet  <[email protected]>
+
+        Clarify that some UUID routines are dedicated to UUID v4
+        https://bugs.webkit.org/show_bug.cgi?id=235430
+
+        Reviewed by Darin Adler.
+
+        No change of behavior, this is renaming only.
+
+        * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
+        (WebCore::CDMSessionClearKey::CDMSessionClearKey):
+        * Modules/entriesapi/DOMFileSystem.cpp:
+        (WebCore::DOMFileSystem::DOMFileSystem):
+        * Modules/highlight/AppHighlightStorage.cpp:
+        (WebCore::createAppHighlightRangeData):
+        * Modules/mediacontrols/MediaControlsHost.cpp:
+        (WebCore::MediaControlsHost::generateUUID):
+        * Modules/mediastream/MediaDevices.cpp:
+        (WebCore::MediaDevices::MediaDevices):
+        * Modules/paymentrequest/PaymentRequest.cpp:
+        (WebCore::PaymentRequest::create):
+        * Modules/webdatabase/DatabaseTracker.cpp:
+        (WebCore::generateDatabaseFileName):
+        * accessibility/atspi/AccessibilityAtspi.cpp:
+        (WebCore::AccessibilityAtspi::registerRoot):
+        (WebCore::AccessibilityAtspi::registerObject):
+        (WebCore::AccessibilityAtspi::registerHyperlink):
+        * animation/KeyframeEffect.cpp:
+        (WebCore::KeyframeEffect::copyPropertiesFromSource):
+        (WebCore::KeyframeEffect::updateBlendingKeyframes):
+        (WebCore::KeyframeEffect::computeCSSTransitionBlendingKeyframes):
+        * dom/Document.cpp:
+        (WebCore::Document::originIdentifierForPasteboard const):
+        (WebCore::Document::didInsertAttachmentElement):
+        * fileapi/BlobURL.cpp:
+        (WebCore::BlobURL::createBlobURL):
+        * html/HTMLAttachmentElement.cpp:
+        (WebCore::HTMLAttachmentElement::ensureUniqueIdentifier):
+        * loader/appcache/ApplicationCacheStorage.cpp:
+        (WebCore::ApplicationCacheStorage::writeDataToUniqueFileInDirectory):
+        * page/Crypto.cpp:
+        (WebCore::Crypto::randomUUID const):
+        * platform/ScriptExecutionContextIdentifier.h:
+        (WebCore::ProcessQualified<UUID>::generate):
+        * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
+        (WebCore::CDMSessionAVFoundationCF::CDMSessionAVFoundationCF):
+        * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
+        (WebCore::CDMSessionAVFoundationObjC::CDMSessionAVFoundationObjC):
+        * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
+        (WebCore::CDMSessionAVStreamSession::update):
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::updateAnimations):
+        * platform/mediastream/MediaStreamPrivate.h:
+        * platform/mediastream/MediaStreamTrackPrivate.cpp:
+        (WebCore::MediaStreamTrackPrivate::create):
+        * platform/mediastream/RealtimeMediaSource.cpp:
+        (WebCore::RealtimeMediaSource::RealtimeMediaSource):
+        * platform/mediastream/gstreamer/GStreamerDisplayCaptureDeviceManager.cpp:
+        (WebCore::GStreamerDisplayCaptureDeviceManager::computeCaptureDevices):
+        * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
+        (webkitMediaStreamSrcPostStreamCollection):
+        * platform/mediastream/ios/ReplayKitCaptureSource.mm:
+        (WebCore::screenDeviceUUID):
+        * testing/Internals.cpp:
+        (WebCore::Internals::isDocumentAlive const):
+        * testing/MockCDMFactory.cpp:
+        (WebCore::MockCDMInstanceSession::requestLicense):
+
 2022-02-02  Philippe Normand  <[email protected]>
 
         [GStreamer] Add support for custom message handling in simpleBusMessageCallback

Modified: trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp (288949 => 288950)


--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -51,7 +51,7 @@
 
 CDMSessionClearKey::CDMSessionClearKey(LegacyCDMSessionClient* client)
     : m_client(client)
-    , m_sessionId(createCanonicalUUIDString())
+    , m_sessionId(createVersion4UUIDString())
 {
 }
 

Modified: trunk/Source/WebCore/Modules/entriesapi/DOMFileSystem.cpp (288949 => 288950)


--- trunk/Source/WebCore/Modules/entriesapi/DOMFileSystem.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebCore/Modules/entriesapi/DOMFileSystem.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -151,7 +151,7 @@
 }
 
 DOMFileSystem::DOMFileSystem(Ref<File>&& file)
-    : m_name(createCanonicalUUIDString())
+    : m_name(createVersion4UUIDString())
     , m_file(WTFMove(file))
     , m_rootPath(FileSystem::parentPath(m_file->path()))
     , m_workQueue(WorkQueue::create("DOMFileSystem work queue"))

Modified: trunk/Source/WebCore/Modules/highlight/AppHighlightStorage.cpp (288949 => 288950)


--- trunk/Source/WebCore/Modules/highlight/AppHighlightStorage.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebCore/Modules/highlight/AppHighlightStorage.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -205,7 +205,7 @@
 {
     auto text = plainText(range);
     text.truncate(textPreviewLength);
-    auto identifier = createCanonicalUUIDString();
+    auto identifier = createVersion4UUIDString();
 
     return {
         identifier,

Modified: trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp (288949 => 288950)


--- trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -346,7 +346,7 @@
 
 String MediaControlsHost::generateUUID()
 {
-    return createCanonicalUUIDString();
+    return createVersion4UUIDString();
 }
 
 #if ENABLE(MODERN_MEDIA_CONTROLS)

Modified: trunk/Source/WebCore/Modules/mediastream/MediaDevices.cpp (288949 => 288950)


--- trunk/Source/WebCore/Modules/mediastream/MediaDevices.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebCore/Modules/mediastream/MediaDevices.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -57,7 +57,7 @@
     : ActiveDOMObject(document)
     , m_scheduledEventTimer(*this, &MediaDevices::scheduledEventTimerFired)
     , m_eventNames(eventNames())
-    , m_groupIdHashSalt(createCanonicalUUIDString())
+    , m_groupIdHashSalt(createVersion4UUIDString())
 {
     static_assert(static_cast<size_t>(MediaDevices::DisplayCaptureSurfaceType::Monitor) == static_cast<size_t>(RealtimeMediaSourceSettings::DisplaySurfaceType::Monitor), "MediaDevices::DisplayCaptureSurfaceType::Monitor is not equal to RealtimeMediaSourceSettings::DisplaySurfaceType::Monitor as expected");
     static_assert(static_cast<size_t>(MediaDevices::DisplayCaptureSurfaceType::Window) == static_cast<size_t>(RealtimeMediaSourceSettings::DisplaySurfaceType::Window), "MediaDevices::DisplayCaptureSurfaceType::Window is not RealtimeMediaSourceSettings::DisplaySurfaceType::Window as expected");

Modified: trunk/Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp (288949 => 288950)


--- trunk/Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -301,7 +301,7 @@
         return canCreateSession.releaseException();
 
     if (details.id.isNull())
-        details.id = createCanonicalUUIDString();
+        details.id = createVersion4UUIDString();
 
     if (methodData.isEmpty())
         return Exception { TypeError, "At least one payment method is required."_s };

Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp (288949 => 288950)


--- trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -308,7 +308,7 @@
 
 static String generateDatabaseFileName()
 {
-    return makeString(createCanonicalUUIDString(), ".db");
+    return makeString(createVersion4UUIDString(), ".db");
 }
 
 String DatabaseTracker::fullPathForDatabaseNoLock(const SecurityOriginData& origin, const String& name, bool createIfNotExists)

Modified: trunk/Source/WebCore/accessibility/atspi/AccessibilityAtspi.cpp (288949 => 288950)


--- trunk/Source/WebCore/accessibility/atspi/AccessibilityAtspi.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebCore/accessibility/atspi/AccessibilityAtspi.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -288,7 +288,7 @@
     }
 
     ensureCache();
-    String path = makeString("/org/a11y/webkit/accessible/", createCanonicalUUIDString().replace('-', '_'));
+    String path = makeString("/org/a11y/webkit/accessible/", createVersion4UUIDString().replace('-', '_'));
     Vector<unsigned, 3> registeredObjects;
     registeredObjects.reserveInitialCapacity(interfaces.size());
     for (const auto& interface : interfaces) {
@@ -323,7 +323,7 @@
         return { };
 
     ensureCache();
-    String path = makeString("/org/a11y/atspi/accessible/", createCanonicalUUIDString().replace('-', '_'));
+    String path = makeString("/org/a11y/atspi/accessible/", createVersion4UUIDString().replace('-', '_'));
     Vector<unsigned, 20> registeredObjects;
     registeredObjects.reserveInitialCapacity(interfaces.size());
     for (const auto& interface : interfaces) {
@@ -373,7 +373,7 @@
     if (!m_connection)
         return { };
 
-    String path = makeString("/org/a11y/atspi/accessible/", createCanonicalUUIDString().replace('-', '_'));
+    String path = makeString("/org/a11y/atspi/accessible/", createVersion4UUIDString().replace('-', '_'));
     Vector<unsigned, 1> registeredObjects;
     registeredObjects.reserveInitialCapacity(interfaces.size());
     for (const auto& interface : interfaces) {

Modified: trunk/Source/WebCore/animation/KeyframeEffect.cpp (288949 => 288950)


--- trunk/Source/WebCore/animation/KeyframeEffect.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebCore/animation/KeyframeEffect.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -576,7 +576,7 @@
     setIterationDuration(source->iterationDuration());
     updateStaticTimingProperties();
 
-    KeyframeList keyframeList("keyframe-effect-" + createCanonicalUUIDString());
+    KeyframeList keyframeList("keyframe-effect-" + createVersion4UUIDString());
     keyframeList.copyKeyframes(source->m_blendingKeyframes);
     setBlendingKeyframes(keyframeList);
 }
@@ -822,7 +822,7 @@
     if (!m_blendingKeyframes.isEmpty() || !m_target)
         return;
 
-    KeyframeList keyframeList("keyframe-effect-" + createCanonicalUUIDString());
+    KeyframeList keyframeList("keyframe-effect-" + createVersion4UUIDString());
     auto& styleResolver = m_target->styleResolver();
 
     for (auto& keyframe : m_parsedKeyframes) {
@@ -1073,7 +1073,7 @@
     if (m_target)
         Style::loadPendingResources(*toStyle, *document(), m_target.get());
 
-    KeyframeList keyframeList("keyframe-effect-" + createCanonicalUUIDString());
+    KeyframeList keyframeList("keyframe-effect-" + createVersion4UUIDString());
     keyframeList.addProperty(property);
 
     KeyframeValue fromKeyframeValue(0, RenderStyle::clonePtr(*oldStyle));

Modified: trunk/Source/WebCore/dom/Document.cpp (288949 => 288950)


--- trunk/Source/WebCore/dom/Document.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebCore/dom/Document.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -6197,7 +6197,7 @@
     if (origin != "null")
         return origin;
     if (!m_uniqueIdentifier)
-        m_uniqueIdentifier = "null:" + createCanonicalUUIDString();
+        m_uniqueIdentifier = "null:" + createVersion4UUIDString();
     return m_uniqueIdentifier;
 }
 
@@ -8577,7 +8577,7 @@
     bool previousIdentifierIsNotUnique = !previousIdentifier.isEmpty() && m_attachmentIdentifierToElementMap.contains(previousIdentifier);
     if (identifier.isEmpty() || previousIdentifierIsNotUnique) {
         previousIdentifier = identifier;
-        identifier = createCanonicalUUIDString();
+        identifier = createVersion4UUIDString();
         attachment.setUniqueIdentifier(identifier);
     }
 

Modified: trunk/Source/WebCore/fileapi/BlobURL.cpp (288949 => 288950)


--- trunk/Source/WebCore/fileapi/BlobURL.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebCore/fileapi/BlobURL.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -92,7 +92,7 @@
 URL BlobURL::createBlobURL(const String& originString)
 {
     ASSERT(!originString.isEmpty());
-    String urlString = "blob:" + originString + '/' + createCanonicalUUIDString();
+    String urlString = "blob:" + originString + '/' + createVersion4UUIDString();
     return URL({ }, urlString);
 }
 

Modified: trunk/Source/WebCore/html/HTMLAttachmentElement.cpp (288949 => 288950)


--- trunk/Source/WebCore/html/HTMLAttachmentElement.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebCore/html/HTMLAttachmentElement.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -148,7 +148,7 @@
 const String& HTMLAttachmentElement::ensureUniqueIdentifier()
 {
     if (m_uniqueIdentifier.isEmpty())
-        m_uniqueIdentifier = createCanonicalUUIDString();
+        m_uniqueIdentifier = createVersion4UUIDString();
     return m_uniqueIdentifier;
 }
 

Modified: trunk/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp (288949 => 288950)


--- trunk/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -1277,9 +1277,9 @@
     String fullPath;
     
     do {
-        path = FileSystem::encodeForFileName(createCanonicalUUIDString()) + fileExtension;
+        path = FileSystem::encodeForFileName(createVersion4UUIDString()) + fileExtension;
         // Guard against the above function being called on a platform which does not implement
-        // createCanonicalUUIDString().
+        // createVersion4UUIDString().
         ASSERT(!path.isEmpty());
         if (path.isEmpty())
             return false;

Modified: trunk/Source/WebCore/page/Crypto.cpp (288949 => 288950)


--- trunk/Source/WebCore/page/Crypto.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebCore/page/Crypto.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -71,7 +71,7 @@
 
 String Crypto::randomUUID() const
 {
-    return createCanonicalUUIDString();
+    return createVersion4UUIDString();
 }
 
 #if ENABLE(WEB_CRYPTO)

Modified: trunk/Source/WebCore/platform/ScriptExecutionContextIdentifier.h (288949 => 288950)


--- trunk/Source/WebCore/platform/ScriptExecutionContextIdentifier.h	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebCore/platform/ScriptExecutionContextIdentifier.h	2022-02-02 10:30:01 UTC (rev 288950)
@@ -34,7 +34,7 @@
 template <>
 class ProcessQualified<UUID> {
 public:
-    static ProcessQualified generate() { return { UUID::create(), Process::identifier() }; }
+    static ProcessQualified generate() { return { UUID::createVersion4(), Process::identifier() }; }
 
     ProcessQualified()
         : m_object(UUID::emptyValue)

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp (288949 => 288950)


--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -47,7 +47,7 @@
 
 CDMSessionAVFoundationCF::CDMSessionAVFoundationCF(MediaPlayerPrivateAVFoundationCF& parent, LegacyCDMSessionClient*)
     : m_parent(parent)
-    , m_sessionId(createCanonicalUUIDString())
+    , m_sessionId(createVersion4UUIDString())
 {
 }
 

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm (288949 => 288950)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm	2022-02-02 10:30:01 UTC (rev 288950)
@@ -46,7 +46,7 @@
 CDMSessionAVFoundationObjC::CDMSessionAVFoundationObjC(MediaPlayerPrivateAVFoundationObjC* parent, LegacyCDMSessionClient* client)
     : m_parent(*parent)
     , m_client(client)
-    , m_sessionId(createCanonicalUUIDString())
+    , m_sessionId(createVersion4UUIDString())
 {
 }
 

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm (288949 => 288950)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm	2022-02-02 10:30:01 UTC (rev 288950)
@@ -238,7 +238,7 @@
         ALLOW_DEPRECATED_DECLARATIONS_END
 
         if (![protectedSourceBuffer->streamDataParser() respondsToSelector:@selector(contentProtectionSessionIdentifier)])
-            m_sessionId = createCanonicalUUIDString();
+            m_sessionId = createVersion4UUIDString();
 
         if (error) {
             LOG(Media, "CDMSessionAVStreamSession::update(%p) - error:%@", this, [error description]);

Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (288949 => 288950)


--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -3105,7 +3105,7 @@
         caAnimationGroup->setDuration(infiniteDuration);
         caAnimationGroup->setAnimations(animations);
 
-        auto animationGroup = LayerPropertyAnimation(WTFMove(caAnimationGroup), "group-" + createCanonicalUUIDString(), property, 0, 0, 0_s);
+        auto animationGroup = LayerPropertyAnimation(WTFMove(caAnimationGroup), "group-" + createVersion4UUIDString(), property, 0, 0, 0_s);
         animationGroup.m_beginTime = animationGroupBeginTime;
 
         setAnimationOnLayer(animationGroup);
@@ -3153,7 +3153,7 @@
         caAnimation->setFromValue(matrix);
         caAnimation->setToValue(matrix);
 
-        auto animation = LayerPropertyAnimation(WTFMove(caAnimation), "base-transform-" + createCanonicalUUIDString(), property, 0, 0, 0_s);
+        auto animation = LayerPropertyAnimation(WTFMove(caAnimation), "base-transform-" + createVersion4UUIDString(), property, 0, 0, 0_s);
         if (delay)
             animation.m_beginTime = currentTime - animationGroupBeginTime;
 

Modified: trunk/Source/WebCore/platform/mediastream/MediaStreamPrivate.h (288949 => 288950)


--- trunk/Source/WebCore/platform/mediastream/MediaStreamPrivate.h	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebCore/platform/mediastream/MediaStreamPrivate.h	2022-02-02 10:30:01 UTC (rev 288950)
@@ -71,7 +71,7 @@
 
     static Ref<MediaStreamPrivate> create(Ref<const Logger>&&, Ref<RealtimeMediaSource>&&);
     static Ref<MediaStreamPrivate> create(Ref<const Logger>&&, RefPtr<RealtimeMediaSource>&& audioSource, RefPtr<RealtimeMediaSource>&& videoSource);
-    static Ref<MediaStreamPrivate> create(Ref<const Logger>&& logger, const MediaStreamTrackPrivateVector& tracks, String&& id = createCanonicalUUIDString()) { return adoptRef(*new MediaStreamPrivate(WTFMove(logger), tracks, WTFMove(id))); }
+    static Ref<MediaStreamPrivate> create(Ref<const Logger>&& logger, const MediaStreamTrackPrivateVector& tracks, String&& id = createVersion4UUIDString()) { return adoptRef(*new MediaStreamPrivate(WTFMove(logger), tracks, WTFMove(id))); }
 
     WEBCORE_EXPORT virtual ~MediaStreamPrivate();
 

Modified: trunk/Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.cpp (288949 => 288950)


--- trunk/Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -48,7 +48,7 @@
 
 Ref<MediaStreamTrackPrivate> MediaStreamTrackPrivate::create(Ref<const Logger>&& logger, Ref<RealtimeMediaSource>&& source)
 {
-    return create(WTFMove(logger), WTFMove(source), createCanonicalUUIDString());
+    return create(WTFMove(logger), WTFMove(source), createVersion4UUIDString());
 }
 
 Ref<MediaStreamTrackPrivate> MediaStreamTrackPrivate::create(Ref<const Logger>&& logger, Ref<RealtimeMediaSource>&& source, String&& id)

Modified: trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp (288949 => 288950)


--- trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -55,7 +55,7 @@
     , m_name(WTFMove(name))
 {
     if (m_persistentID.isEmpty())
-        m_persistentID = createCanonicalUUIDString();
+        m_persistentID = createVersion4UUIDString();
 
     m_hashedID = RealtimeMediaSourceCenter::singleton().hashStringWithSalt(m_persistentID, m_idHashSalt);
 }

Modified: trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerDisplayCaptureDeviceManager.cpp (288949 => 288950)


--- trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerDisplayCaptureDeviceManager.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerDisplayCaptureDeviceManager.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -53,7 +53,7 @@
 {
     m_devices.clear();
 
-    CaptureDevice screenCaptureDevice(createCanonicalUUIDString(), CaptureDevice::DeviceType::Screen, makeString("Capture Screen"));
+    CaptureDevice screenCaptureDevice(createVersion4UUIDString(), CaptureDevice::DeviceType::Screen, makeString("Capture Screen"));
     screenCaptureDevice.setEnabled(true);
     m_devices.append(WTFMove(screenCaptureDevice));
     callback();

Modified: trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp (288949 => 288950)


--- trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -577,7 +577,7 @@
         return;
     }
 
-    auto upstreamId = priv->stream ? priv->stream->id() : createCanonicalUUIDString();
+    auto upstreamId = priv->stream ? priv->stream->id() : createVersion4UUIDString();
     priv->streamCollection = adoptGRef(gst_stream_collection_new(upstreamId.ascii().data()));
     for (auto& track : priv->tracks) {
         if (!track->isActive())

Modified: trunk/Source/WebCore/platform/mediastream/ios/ReplayKitCaptureSource.mm (288949 => 288950)


--- trunk/Source/WebCore/platform/mediastream/ios/ReplayKitCaptureSource.mm	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebCore/platform/mediastream/ios/ReplayKitCaptureSource.mm	2022-02-02 10:30:01 UTC (rev 288950)
@@ -245,7 +245,7 @@
 
 static String screenDeviceUUID()
 {
-    static NeverDestroyed<String> screenID = createCanonicalUUIDString();
+    static NeverDestroyed<String> screenID = createVersion4UUIDString();
     return screenID;
 }
 

Modified: trunk/Source/WebCore/testing/Internals.cpp (288949 => 288950)


--- trunk/Source/WebCore/testing/Internals.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebCore/testing/Internals.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -2768,7 +2768,7 @@
 
 bool Internals::isDocumentAlive(const String& documentIdentifier) const
 {
-    auto uuid = UUID::parse(documentIdentifier);
+    auto uuid = UUID::parseVersion4(documentIdentifier);
     ASSERT(uuid);
     return uuid ? Document::allDocumentsMap().contains({ *uuid, Process::identifier() }) : false;
 }

Modified: trunk/Source/WebCore/testing/MockCDMFactory.cpp (288949 => 288950)


--- trunk/Source/WebCore/testing/MockCDMFactory.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebCore/testing/MockCDMFactory.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -317,7 +317,7 @@
         return;
     }
 
-    String sessionID = createCanonicalUUIDString();
+    String sessionID = createVersion4UUIDString();
     factory->addKeysToSessionWithID(sessionID, WTFMove(keyIDs.value()));
 
     CString license { "license" };

Modified: trunk/Source/WebDriver/ChangeLog (288949 => 288950)


--- trunk/Source/WebDriver/ChangeLog	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebDriver/ChangeLog	2022-02-02 10:30:01 UTC (rev 288950)
@@ -1,3 +1,15 @@
+2022-02-02  Youenn Fablet  <[email protected]>
+
+        Clarify that some UUID routines are dedicated to UUID v4
+        https://bugs.webkit.org/show_bug.cgi?id=235430
+
+        Reviewed by Darin Adler.
+
+        * glib/SessionHostGlib.cpp:
+        (WebDriver::SessionHost::startAutomationSession):
+        * socket/SessionHostSocket.cpp:
+        (WebDriver::SessionHost::startAutomationSession):
+
 2021-09-20  Chris Dumez  <[email protected]>
 
         Stop using makeRef(*this) / makeRefPtr(this)

Modified: trunk/Source/WebDriver/glib/SessionHostGlib.cpp (288949 => 288950)


--- trunk/Source/WebDriver/glib/SessionHostGlib.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebDriver/glib/SessionHostGlib.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -306,7 +306,7 @@
     ASSERT(m_socketConnection);
     ASSERT(!m_startSessionCompletionHandler);
     m_startSessionCompletionHandler = WTFMove(completionHandler);
-    m_sessionID = createCanonicalUUIDString();
+    m_sessionID = createVersion4UUIDString();
     GVariantBuilder builder;
     m_socketConnection->sendMessage("StartAutomationSession", g_variant_new("(sa{sv})", m_sessionID.utf8().data(), buildSessionCapabilities(&builder) ? &builder : nullptr));
 }

Modified: trunk/Source/WebDriver/socket/SessionHostSocket.cpp (288949 => 288950)


--- trunk/Source/WebDriver/socket/SessionHostSocket.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebDriver/socket/SessionHostSocket.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -150,7 +150,7 @@
 {
     ASSERT(!m_startSessionCompletionHandler);
     m_startSessionCompletionHandler = WTFMove(completionHandler);
-    m_sessionID = createCanonicalUUIDString();
+    m_sessionID = createVersion4UUIDString();
 
     auto sendMessageEvent = JSON::Object::create();
     sendMessageEvent->setString("event"_s, "StartAutomationSession"_s);

Modified: trunk/Source/WebKit/ChangeLog (288949 => 288950)


--- trunk/Source/WebKit/ChangeLog	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebKit/ChangeLog	2022-02-02 10:30:01 UTC (rev 288950)
@@ -1,5 +1,44 @@
 2022-02-02  Youenn Fablet  <[email protected]>
 
+        Clarify that some UUID routines are dedicated to UUID v4
+        https://bugs.webkit.org/show_bug.cgi?id=235430
+
+        Reviewed by Darin Adler.
+
+        * NetworkProcess/NetworkProcess.cpp:
+        (WebKit::NetworkProcess::ensureSession):
+        * NetworkProcess/cache/CacheStorageEngineCache.cpp:
+        (WebKit::CacheStorage::Cache::toRecordInformation):
+        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
+        (WebKit::CacheStorage::Caches::open):
+        * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
+        (WebKit::NetworkMDNSRegister::registerMDNSName):
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _insertAttachmentWithFileWrapper:contentType:completion:]):
+        * UIProcess/Automation/WebAutomationSession.cpp:
+        (WebKit::WebAutomationSession::handleForWebPageProxy):
+        (WebKit::WebAutomationSession::handleForWebFrameID):
+        * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
+        * UIProcess/Cocoa/WKShareSheet.mm:
+        (+[WKShareSheet createRandomSharingDirectoryForFile:]):
+        * UIProcess/GeolocationPermissionRequestManagerProxy.cpp:
+        (WebKit::GeolocationPermissionRequestManagerProxy::didReceiveGeolocationPermissionDecision):
+        * UIProcess/WebAuthentication/Virtual/VirtualAuthenticatorManager.cpp:
+        (WebKit::VirtualAuthenticatorManager::createAuthenticator):
+        * UIProcess/gtk/WaylandCompositor.cpp:
+        (WebKit::WaylandCompositor::WaylandCompositor):
+        * UIProcess/ios/WKModelView.mm:
+        (-[WKModelView createFileForModel:]):
+        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
+        (WebKit::createUUID):
+        * WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.mm:
+        (WebKit::ARKitInlinePreviewModelPlayerMac::createFile):
+        * WebProcess/Plugins/PDF/PDFPlugin.mm:
+        (WebKit::PDFPlugin::openWithPreview):
+        (WebKit::PDFPlugin::openWithNativeApplication):
+
+2022-02-02  Youenn Fablet  <[email protected]>
+
         ServiceWorkerNavigationPreloader should only be used once
         https://bugs.webkit.org/show_bug.cgi?id=235882
         <rdar://88226432>

Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp (288949 => 288950)


--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -473,7 +473,7 @@
     
 #if PLATFORM(COCOA)
     RetainPtr<CFURLStorageSessionRef> storageSession;
-    RetainPtr<CFStringRef> cfIdentifier = makeString(identifierBase, ".PrivateBrowsing.", createCanonicalUUIDString()).createCFString();
+    RetainPtr<CFStringRef> cfIdentifier = makeString(identifierBase, ".PrivateBrowsing.", createVersion4UUIDString()).createCFString();
     if (sessionID.isEphemeral())
         storageSession = createPrivateStorageSession(cfIdentifier.get(), std::nullopt, WebCore::NetworkStorageSession::ShouldDisableCFURLCache::Yes);
     else if (sessionID != PAL::SessionID::defaultSessionID())

Modified: trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCache.cpp (288949 => 288950)


--- trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCache.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCache.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -99,7 +99,7 @@
 
 RecordInformation Cache::toRecordInformation(const Record& record)
 {
-    Key key { "record"_s, m_uniqueName, { }, createCanonicalUUIDString(), m_caches.salt() };
+    Key key { "record"_s, m_uniqueName, { }, createVersion4UUIDString(), m_caches.salt() };
     RecordInformation recordInformation { WTFMove(key), MonotonicTime::now().secondsSinceEpoch().milliseconds(), record.identifier, 0 , record.responseBodySize, record.request.url(), false, { } };
 
     updateVaryInformation(recordInformation, record.request, record.response);

Modified: trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp (288949 => 288950)


--- trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -323,7 +323,7 @@
     makeDirty();
 
     uint64_t cacheIdentifier = m_engine->nextCacheIdentifier();
-    m_caches.append(Cache { *this, cacheIdentifier, Cache::State::Open, String { name }, createCanonicalUUIDString() });
+    m_caches.append(Cache { *this, cacheIdentifier, Cache::State::Open, String { name }, createVersion4UUIDString() });
 
     writeCachesToDisk([callback = WTFMove(callback), cacheIdentifier](std::optional<Error>&& error) mutable {
         callback(CacheIdentifierOperationResult { cacheIdentifier, !!error });

Modified: trunk/Source/WebKit/NetworkProcess/webrtc/NetworkMDNSRegister.cpp (288949 => 288950)


--- trunk/Source/WebKit/NetworkProcess/webrtc/NetworkMDNSRegister.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebKit/NetworkProcess/webrtc/NetworkMDNSRegister.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -106,7 +106,7 @@
 
 void NetworkMDNSRegister::registerMDNSName(MDNSRegisterIdentifier requestIdentifier, WebCore::ScriptExecutionContextIdentifier documentIdentifier, const String& ipAddress)
 {
-    auto name = makeString(createCanonicalUUIDString(), ".local");
+    auto name = makeString(createVersion4UUIDString(), ".local");
 
     DNSServiceRef service;
     auto iterator = m_services.find(documentIdentifier);
@@ -172,7 +172,7 @@
 void NetworkMDNSRegister::registerMDNSName(MDNSRegisterIdentifier requestIdentifier, WebCore::ScriptExecutionContextIdentifier documentIdentifier, const String& ipAddress)
 {
     MDNS_RELEASE_LOG("registerMDNSName not implemented");
-    auto name = makeString(createCanonicalUUIDString(), ".local");
+    auto name = makeString(createVersion4UUIDString(), ".local");
 
     m_connection.connection().send(Messages::WebMDNSRegister::FinishedRegisteringMDNSName { requestIdentifier, name, WebCore::MDNSRegisterError::NotImplemented }, 0);
 }

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (288949 => 288950)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2022-02-02 10:30:01 UTC (rev 288950)
@@ -2740,7 +2740,7 @@
 {
     THROW_IF_SUSPENDED;
 #if ENABLE(ATTACHMENT_ELEMENT)
-    auto identifier = createCanonicalUUIDString();
+    auto identifier = createVersion4UUIDString();
     auto attachment = API::Attachment::create(identifier, *_page);
     attachment->setFileWrapperAndUpdateContentType(fileWrapper, contentType);
     _page->insertAttachment(attachment.copyRef(), [capturedHandler = makeBlockPtr(completionHandler)] {

Modified: trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp (288949 => 288950)


--- trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -190,7 +190,7 @@
     if (iter != m_webPageHandleMap.end())
         return iter->value;
 
-    String handle = "page-" + createCanonicalUUIDString().convertToASCIIUppercase();
+    String handle = "page-" + createVersion4UUIDString().convertToASCIIUppercase();
 
     auto firstAddResult = m_webPageHandleMap.add(webPageProxy.identifier(), handle);
     RELEASE_ASSERT(firstAddResult.isNewEntry);
@@ -239,7 +239,7 @@
     if (iter != m_webFrameHandleMap.end())
         return iter->value;
 
-    String handle = "frame-" + createCanonicalUUIDString().convertToASCIIUppercase();
+    String handle = "frame-" + createVersion4UUIDString().convertToASCIIUppercase();
 
     auto firstAddResult = m_webFrameHandleMap.add(*frameID, handle);
     RELEASE_ASSERT(firstAddResult.isNewEntry);

Modified: trunk/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm (288949 => 288950)


--- trunk/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm	2022-02-02 10:30:01 UTC (rev 288950)
@@ -302,7 +302,7 @@
 
 void SystemPreviewController::triggerSystemPreviewActionWithTargetForTesting(uint64_t elementID, NSString* documentID, uint64_t pageID)
 {
-    auto uuid = UUID::parse(String(documentID));
+    auto uuid = UUID::parseVersion4(String(documentID));
     ASSERT(uuid);
     if (!uuid)
         return;

Modified: trunk/Source/WebKit/UIProcess/Cocoa/WKShareSheet.mm (288949 => 288950)


--- trunk/Source/WebKit/UIProcess/Cocoa/WKShareSheet.mm	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WKShareSheet.mm	2022-02-02 10:30:01 UTC (rev 288950)
@@ -331,7 +331,7 @@
 
 + (NSURL *)createRandomSharingDirectoryForFile:(NSURL *)temporaryDirectory
 {
-    NSString *randomDirectory = createCanonicalUUIDString();
+    NSString *randomDirectory = createVersion4UUIDString();
     if (![randomDirectory length] || !temporaryDirectory)
         return nil;
     NSURL *dataPath = [temporaryDirectory URLByAppendingPathComponent:randomDirectory isDirectory:YES];

Modified: trunk/Source/WebKit/UIProcess/GeolocationPermissionRequestManagerProxy.cpp (288949 => 288950)


--- trunk/Source/WebKit/UIProcess/GeolocationPermissionRequestManagerProxy.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebKit/UIProcess/GeolocationPermissionRequestManagerProxy.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -63,7 +63,7 @@
         return;
 
 #if ENABLE(GEOLOCATION)
-    String authorizationToken = allowed ? createCanonicalUUIDString() : String();
+    String authorizationToken = allowed ? createVersion4UUIDString() : String();
     if (!authorizationToken.isNull())
         m_validAuthorizationTokens.add(authorizationToken);
     m_page.send(Messages::WebPage::DidReceiveGeolocationPermissionDecision(geolocationID, authorizationToken));

Modified: trunk/Source/WebKit/UIProcess/WebAuthentication/Virtual/VirtualAuthenticatorManager.cpp (288949 => 288950)


--- trunk/Source/WebKit/UIProcess/WebAuthentication/Virtual/VirtualAuthenticatorManager.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebKit/UIProcess/WebAuthentication/Virtual/VirtualAuthenticatorManager.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -42,7 +42,7 @@
 {
     if (config.transport != WebCore::AuthenticatorTransport::Internal)
         UNIMPLEMENTED();
-    auto id = createCanonicalUUIDString();
+    auto id = createVersion4UUIDString();
     m_virtualAuthenticators.set(id, makeUniqueRef<VirtualAuthenticatorConfiguration>(config));
 
     return id;

Modified: trunk/Source/WebKit/UIProcess/gtk/WaylandCompositor.cpp (288949 => 288950)


--- trunk/Source/WebKit/UIProcess/gtk/WaylandCompositor.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebKit/UIProcess/gtk/WaylandCompositor.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -501,7 +501,7 @@
         return;
     }
 
-    String displayName = "webkitgtk-wayland-compositor-" + createCanonicalUUIDString();
+    String displayName = "webkitgtk-wayland-compositor-" + createVersion4UUIDString();
     if (wl_display_add_socket(display.get(), displayName.utf8().data()) == -1) {
         WTFLogAlways("Nested Wayland compositor could not create display socket");
         return;

Modified: trunk/Source/WebKit/UIProcess/ios/WKModelView.mm (288949 => 288950)


--- trunk/Source/WebKit/UIProcess/ios/WKModelView.mm	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebKit/UIProcess/ios/WKModelView.mm	2022-02-02 10:30:01 UTC (rev 288950)
@@ -121,7 +121,7 @@
         return NO;
     }
 
-    auto fileName = FileSystem::encodeForFileName(createCanonicalUUIDString()) + ".usdz";
+    auto fileName = FileSystem::encodeForFileName(createVersion4UUIDString()) + ".usdz";
     auto filePath = FileSystem::pathByAppendingComponent(pathToDirectory, fileName);
     auto file = FileSystem::openFile(filePath, FileSystem::FileOpenMode::Write);
     if (file <= 0)

Modified: trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp (288949 => 288950)


--- trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -182,7 +182,7 @@
 
 static JSValueRef createUUID(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
-    return toJSValue(context, createCanonicalUUIDString().convertToASCIIUppercase());
+    return toJSValue(context, createVersion4UUIDString().convertToASCIIUppercase());
 }
 
 static JSValueRef evaluateJavaScriptCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)

Modified: trunk/Source/WebKit/WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.mm (288949 => 288950)


--- trunk/Source/WebKit/WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.mm	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebKit/WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.mm	2022-02-02 10:30:01 UTC (rev 288950)
@@ -100,7 +100,7 @@
     }
 
     // We need to support .reality files as well, https://bugs.webkit.org/show_bug.cgi?id=227568.
-    auto fileName = FileSystem::encodeForFileName(createCanonicalUUIDString()) + ".usdz";
+    auto fileName = FileSystem::encodeForFileName(createVersion4UUIDString()) + ".usdz";
     auto filePath = FileSystem::pathByAppendingComponent(pathToDirectory, fileName);
     auto file = FileSystem::openFile(filePath, FileSystem::FileOpenMode::Write);
     if (file <= 0)

Modified: trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm (288949 => 288950)


--- trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm	2022-02-02 10:30:01 UTC (rev 288950)
@@ -2572,7 +2572,7 @@
     FrameInfoData frameInfo;
     if (m_frame)
         frameInfo = m_frame->info();
-    completionHandler(m_suggestedFilename, WTFMove(frameInfo), IPC:: DataReference { static_cast<const uint8_t*>(data.bytes), data.length }, createCanonicalUUIDString());
+    completionHandler(m_suggestedFilename, WTFMove(frameInfo), IPC:: DataReference { static_cast<const uint8_t*>(data.bytes), data.length }, createVersion4UUIDString());
 }
 
 #else // ENABLE(UI_PROCESS_PDF_HUD)
@@ -2603,7 +2603,7 @@
 
         NSData *data = ""
 
-        m_temporaryPDFUUID = createCanonicalUUIDString();
+        m_temporaryPDFUUID = createVersion4UUIDString();
         ASSERT(m_temporaryPDFUUID);
 
         m_frame->page()->savePDFToTemporaryFolderAndOpenWithNativeApplication(m_suggestedFilename, m_frame->info(), static_cast<const unsigned char *>([data bytes]), [data length], m_temporaryPDFUUID);

Modified: trunk/Source/WebKitLegacy/ChangeLog (288949 => 288950)


--- trunk/Source/WebKitLegacy/ChangeLog	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebKitLegacy/ChangeLog	2022-02-02 10:30:01 UTC (rev 288950)
@@ -1,3 +1,13 @@
+2022-02-02  Youenn Fablet  <[email protected]>
+
+        Clarify that some UUID routines are dedicated to UUID v4
+        https://bugs.webkit.org/show_bug.cgi?id=235430
+
+        Reviewed by Darin Adler.
+
+        * WebCoreSupport/NetworkStorageSessionMap.cpp:
+        (NetworkStorageSessionMap::ensureSession):
+
 2022-01-27  Elliott Williams  <[email protected]>
 
         [XCBuild] Add missing task dependencies on generate-unified-source-bundles.rb

Modified: trunk/Source/WebKitLegacy/WebCoreSupport/NetworkStorageSessionMap.cpp (288949 => 288950)


--- trunk/Source/WebKitLegacy/WebCoreSupport/NetworkStorageSessionMap.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Source/WebKitLegacy/WebCoreSupport/NetworkStorageSessionMap.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -84,7 +84,7 @@
     if (!addResult.isNewEntry)
         return;
 
-    auto identifier = makeString(identifierBase, ".PrivateBrowsing.", createCanonicalUUIDString()).createCFString();
+    auto identifier = makeString(identifierBase, ".PrivateBrowsing.", createVersion4UUIDString()).createCFString();
 
     RetainPtr<CFURLStorageSessionRef> storageSession;
     if (sessionID.isEphemeral())

Modified: trunk/Tools/ChangeLog (288949 => 288950)


--- trunk/Tools/ChangeLog	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Tools/ChangeLog	2022-02-02 10:30:01 UTC (rev 288950)
@@ -1,3 +1,19 @@
+2022-02-02  Youenn Fablet  <[email protected]>
+
+        Clarify that some UUID routines are dedicated to UUID v4
+        https://bugs.webkit.org/show_bug.cgi?id=235430
+
+        Reviewed by Darin Adler.
+
+        * TestWebKitAPI/Tests/WTF/UUID.cpp:
+        (parseAndStringifyUUID):
+        (TEST):
+        * TestWebKitAPI/Tests/WebKitCocoa/NetworkProcess.mm:
+        (waitUntilNetworkProcessIsResponsive):
+        * TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp:
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::saltForOrigin):
+
 2022-02-01  Robert Jenner  <[email protected]>
 
         Update watchOS simulators to run on the newer 44mm display

Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/UUID.cpp (288949 => 288950)


--- trunk/Tools/TestWebKitAPI/Tests/WTF/UUID.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/UUID.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -34,38 +34,40 @@
 
 static String parseAndStringifyUUID(const String& value)
 {
-    auto uuid = UUID::parse(value);
+    auto uuid = UUID::parseVersion4(value);
     if (!uuid)
         return { };
     return uuid->toString();
 }
 
-TEST(WTF, TestUUIDParsing)
+TEST(WTF, TestUUIDVersion4Parsing)
 {
     // xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
 
-    EXPECT_FALSE(!!UUID::parse("12345678-9abc-5de0-89AB-0123456789ab"));
-    EXPECT_FALSE(!!UUID::parse("12345678-9abc-4dea-79AB-0123456789ab"));
-    EXPECT_FALSE(!!UUID::parse("12345678-9abc-4de0-7fff-0123456789ab"));
-    EXPECT_FALSE(!!UUID::parse("12345678-9abc-4de0-c0000-0123456789ab"));
+    EXPECT_FALSE(!!UUID::parseVersion4("12345678-9abc-5de0-89AB-0123456789ab"));
+    EXPECT_FALSE(!!UUID::parseVersion4("12345678-9abc-4dea-79AB-0123456789ab"));
+    EXPECT_FALSE(!!UUID::parseVersion4("12345678-9abc-4de0-7fff-0123456789ab"));
+    EXPECT_FALSE(!!UUID::parseVersion4("12345678-9abc-4de0-c0000-0123456789ab"));
 
-    EXPECT_FALSE(!!UUID::parse("+ef944c1-5cb8-48aa-Ad12-C5f823f005c3"));
-    EXPECT_FALSE(!!UUID::parse("6ef944c1-+cb8-48aa-Ad12-C5f823f005c3"));
-    EXPECT_FALSE(!!UUID::parse("6ef944c1-5cb8-+8aa-Ad12-C5f823f005c3"));
-    EXPECT_FALSE(!!UUID::parse("6ef944c1-5cb8-48aa-+d12-C5f823f005c3"));
-    EXPECT_FALSE(!!UUID::parse("6ef944c1-5cb8-48aa-Ad12-+5f823f005c3"));
+    EXPECT_FALSE(!!UUID::parseVersion4("+ef944c1-5cb8-48aa-Ad12-C5f823f005c3"));
+    EXPECT_FALSE(!!UUID::parseVersion4("6ef944c1-+cb8-48aa-Ad12-C5f823f005c3"));
+    EXPECT_FALSE(!!UUID::parseVersion4("6ef944c1-5cb8-+8aa-Ad12-C5f823f005c3"));
+    EXPECT_FALSE(!!UUID::parseVersion4("6ef944c1-5cb8-48aa-+d12-C5f823f005c3"));
+    EXPECT_FALSE(!!UUID::parseVersion4("6ef944c1-5cb8-48aa-Ad12-+5f823f005c3"));
 
-    EXPECT_FALSE(!!UUID::parse("00000000-0000-4000-8000-000000000000"));
-    EXPECT_FALSE(!!UUID::parse("00000000-0000-4000-8000-000000000001"));
+    EXPECT_FALSE(!!UUID::parseVersion4("00000000-0000-0000-0000-000000000000"));
+    EXPECT_FALSE(!!UUID::parseVersion4("00000000-0000-0000-0000-000000000001"));
+    EXPECT_TRUE(!!UUID::parseVersion4("00000000-0000-4000-8000-000000000000"));
+    EXPECT_TRUE(!!UUID::parseVersion4("00000000-0000-4000-8000-000000000001"));
 
-    for (size_t cptr = 0; cptr < 100; ++cptr) {
-        auto createdUUID = UUID::create();
+    for (size_t cptr = 0; cptr < 10; ++cptr) {
+        auto createdUUID = UUID::createVersion4();
         auto createdString = createdUUID.toString();
         EXPECT_EQ(createdString.length(), 36u);
         EXPECT_EQ(createdString[14], '4');
         EXPECT_TRUE(createdString[19] == '8' || createdString[19] == '9' || createdString[19] == 'a' || createdString[19] == 'b');
 
-        auto uuid = UUID::parse(createdString);
+        auto uuid = UUID::parseVersion4(createdString);
         EXPECT_TRUE(!!uuid);
         EXPECT_EQ(*uuid, createdUUID);
     }

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/NetworkProcess.mm (288949 => 288950)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/NetworkProcess.mm	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/NetworkProcess.mm	2022-02-02 10:30:01 UTC (rev 288950)
@@ -225,7 +225,7 @@
     // we don't want the test to go on with the WebProcesses using stale NetworkProcessConnections, we use the following
     // trick to wait until both WebProcesses are able to communicate with the new NetworkProcess:
     // The first WebProcess tries setting a cookie until the second Webview is able to see it.
-    auto expectedCookieString = makeString("TEST=", createCanonicalUUIDString());
+    auto expectedCookieString = makeString("TEST=", createVersion4UUIDString());
     auto setTestCookieString = makeString("setInterval(() => { document.cookie='", expectedCookieString, "'; }, 100);");
     [webView1 evaluateJavaScript:(NSString *)setTestCookieString completionHandler: [&] (id result, NSError *error) {
         EXPECT_TRUE(!error);

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp (288949 => 288950)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -300,7 +300,7 @@
 
 static void testAutomationSessionRequestSession(AutomationTest* test, gconstpointer)
 {
-    String sessionID = createCanonicalUUIDString();
+    String sessionID = createVersion4UUIDString();
     // WebKitAutomationSession::automation-started is never emitted if automation is not enabled.
     g_assert_false(webkit_web_context_is_automation_allowed(test->m_webContext.get()));
     auto* session = test->requestSession(sessionID.utf8().data());

Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (288949 => 288950)


--- trunk/Tools/WebKitTestRunner/TestController.cpp	2022-02-02 10:15:07 UTC (rev 288949)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp	2022-02-02 10:30:01 UTC (rev 288950)
@@ -2486,13 +2486,13 @@
             return frameSalt;
 
         if (!settings.persistentSalt().length())
-            settings.setPersistentSalt(createCanonicalUUIDString());
+            settings.setPersistentSalt(createVersion4UUIDString());
 
         return settings.persistentSalt();
     }
 
     if (!frameSalt.length()) {
-        frameSalt = createCanonicalUUIDString();
+        frameSalt = createVersion4UUIDString();
         ephemeralSalts.add(frameIdentifier, frameSalt);
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to