Changeset 281284 in webkit


Ignore:
Timestamp:
Aug 19, 2021 5:12:09 PM (11 months ago)
Author:
Chris Dumez
Message:

Implement Crypto.randomUUID()
https://bugs.webkit.org/show_bug.cgi?id=229240

Reviewed by Geoff Garen.

LayoutTests/imported/w3c:

Rebaseline WPT tests that are now passing.

  • web-platform-tests/WebCryptoAPI/randomUUID.https.any-expected.txt:
  • web-platform-tests/WebCryptoAPI/randomUUID.https.any.worker-expected.txt:

Source/WebCore:

Implement Crypto.randomUUID():

Chrome already implements this and Firefox seems to be working on it
(https://bugzilla.mozilla.org/show_bug.cgi?id=1705264).

No new tests, rebaselined existing tests.

  • page/Crypto.cpp:

(WebCore::Crypto::randomUUID const):

  • page/Crypto.h:
  • page/Crypto.idl:
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r281259 r281284  
     12021-08-19  Chris Dumez  <cdumez@apple.com>
     2
     3        Implement Crypto.randomUUID()
     4        https://bugs.webkit.org/show_bug.cgi?id=229240
     5
     6        Reviewed by Geoff Garen.
     7
     8        Rebaseline WPT tests that are now passing.
     9
     10        * web-platform-tests/WebCryptoAPI/randomUUID.https.any-expected.txt:
     11        * web-platform-tests/WebCryptoAPI/randomUUID.https.any.worker-expected.txt:
     12
    1132021-08-19  Zalan Bujtas  <zalan@apple.com>
    214
  • trunk/LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/randomUUID.https.any-expected.txt

    r281215 r281284  
    11
    2 FAIL namespace format self.crypto.randomUUID is not a function. (In 'self.crypto.randomUUID()', 'self.crypto.randomUUID' is undefined)
    3 FAIL version set self.crypto.randomUUID is not a function. (In 'self.crypto.randomUUID()', 'self.crypto.randomUUID' is undefined)
    4 FAIL variant set self.crypto.randomUUID is not a function. (In 'self.crypto.randomUUID()', 'self.crypto.randomUUID' is undefined)
     2PASS namespace format
     3PASS version set
     4PASS variant set
    55
  • trunk/LayoutTests/imported/w3c/web-platform-tests/WebCryptoAPI/randomUUID.https.any.worker-expected.txt

    r281215 r281284  
    11
    2 FAIL namespace format self.crypto.randomUUID is not a function. (In 'self.crypto.randomUUID()', 'self.crypto.randomUUID' is undefined)
    3 FAIL version set self.crypto.randomUUID is not a function. (In 'self.crypto.randomUUID()', 'self.crypto.randomUUID' is undefined)
    4 FAIL variant set self.crypto.randomUUID is not a function. (In 'self.crypto.randomUUID()', 'self.crypto.randomUUID' is undefined)
     2PASS namespace format
     3PASS version set
     4PASS variant set
    55
  • trunk/Source/WebCore/ChangeLog

    r281283 r281284  
     12021-08-19  Chris Dumez  <cdumez@apple.com>
     2
     3        Implement Crypto.randomUUID()
     4        https://bugs.webkit.org/show_bug.cgi?id=229240
     5
     6        Reviewed by Geoff Garen.
     7
     8        Implement Crypto.randomUUID():
     9        - https://wicg.github.io/uuid/#extensions-to-the-crypto-interface
     10
     11        Chrome already implements this and Firefox seems to be working on it
     12        (https://bugzilla.mozilla.org/show_bug.cgi?id=1705264).
     13
     14        No new tests, rebaselined existing tests.
     15
     16        * page/Crypto.cpp:
     17        (WebCore::Crypto::randomUUID const):
     18        * page/Crypto.h:
     19        * page/Crypto.idl:
     20
    1212021-08-19  Simon Fraser  <simon.fraser@apple.com>
    222
  • trunk/Source/WebCore/page/Crypto.cpp

    r281215 r281284  
    3636#include <JavaScriptCore/ArrayBufferView.h>
    3737#include <wtf/CryptographicallyRandomNumber.h>
     38#include <wtf/UUID.h>
    3839
    3940#if OS(DARWIN)
     
    6970}
    7071
     72String Crypto::randomUUID() const
     73{
     74    return createCanonicalUUIDString();
     75}
     76
    7177#if ENABLE(WEB_CRYPTO)
    7278
  • trunk/Source/WebCore/page/Crypto.h

    r281215 r281284  
    4747
    4848    ExceptionOr<void> getRandomValues(JSC::ArrayBufferView&);
     49    String randomUUID() const;
    4950
    5051#if ENABLE(WEB_CRYPTO)
  • trunk/Source/WebCore/page/Crypto.idl

    r281215 r281284  
    3434    [Conditional=WEB_CRYPTO, SecureContext] readonly attribute SubtleCrypto subtle;
    3535    ArrayBufferView getRandomValues([ReturnValue] ArrayBufferView array);
     36    [SecureContext] DOMString randomUUID();
    3637};
Note: See TracChangeset for help on using the changeset viewer.