[webkit-changes] [WebKit/WebKit] 484500: [SHA1] Add fast path when adding UTF8 bytes from a...

Chris Dumez noreply at github.com
Thu May 30 07:40:44 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 484500b2c078b29f80e12b8130c3f95ca698e2d3
      https://github.com/WebKit/WebKit/commit/484500b2c078b29f80e12b8130c3f95ca698e2d3
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2024-05-30 (Thu, 30 May 2024)

  Changed paths:
    M Source/JavaScriptCore/bytecode/CodeBlockHash.cpp
    M Source/JavaScriptCore/bytecode/ParseHash.cpp
    M Source/WTF/wtf/SHA1.cpp
    M Source/WTF/wtf/SHA1.h
    M Source/WebCore/inspector/DOMPatchSupport.cpp
    M Source/WebCore/platform/WebCorePersistentCoders.cpp
    M Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.cpp
    M Source/WebKit/NetworkProcess/cache/NetworkCacheKey.cpp
    M Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.h
    M Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionContextCocoa.mm

  Log Message:
  -----------
  [SHA1] Add fast path when adding UTF8 bytes from a String that only contains ASCII
https://bugs.webkit.org/show_bug.cgi?id=274873

Reviewed by Darin Adler and Timothy Hatcher.

Add fast path when adding UTF8 bytes from a String that only contains ASCII.
Also fix a bug in our HTTP disk cache hashing function where there was already
a fast path and this fast path was hashing the null terminator, where was the
slow path wasn't. Align both code paths so that we never hash the null
terminator and bump the HTTP cache version since this change is not backward
compatible.

* Source/JavaScriptCore/bytecode/CodeBlockHash.cpp:
(JSC::CodeBlockHash::CodeBlockHash):
* Source/JavaScriptCore/bytecode/ParseHash.cpp:
(JSC::ParseHash::ParseHash):
* Source/WTF/wtf/SHA1.cpp:
(WTF::SHA1::addUTF8Bytes):
* Source/WTF/wtf/SHA1.h:
(WTF::SHA1::addUTF8Bytes):
* Source/WebCore/inspector/DOMPatchSupport.cpp:
(WebCore::addStringToSHA1):
* Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::addStringToSHA1):
* Source/WebKit/NetworkProcess/cache/NetworkCacheKey.cpp:
(WebKit::NetworkCache::hashString):
* Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.h:
* Source/WebKit/UIProcess/Extensions/Cocoa/WebExtensionContextCocoa.mm:
(WebKit::computeStringHashForContentBlockerRules):

Canonical link: https://commits.webkit.org/279513@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list