Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: faae309df854b228ebf98ab1f9593b1c98d9eaab
      
https://github.com/WebKit/WebKit/commit/faae309df854b228ebf98ab1f9593b1c98d9eaab
  Author: Sihui Liu <sihui_...@apple.com>
  Date:   2023-05-22 (Mon, 22 May 2023)

  Changed paths:
    M Source/WebKit/NetworkProcess/storage/CacheStorageDiskStore.cpp
    M Source/WebKit/NetworkProcess/storage/CacheStorageDiskStore.h

  Log Message:
  -----------
  v2: CrashTracer: com.apple.WebKit.Networking at JavaScriptCore: 
WTF::StringImpl::hashSlowCase const
rdar://106965632

Reviewed by Youenn Fablet and Ryosuke Niwa.

Moving a lambda might involve copying its captured variables. According to 
crash trace, recordInfos
(Vector<CacheStorageRecordInformation>) captured by didReadRecordFiles is 
copied when running on the WorkQueue of
CacheStorageDiskStore (com.apple.WebKit.CacheStorageCache). This is an issue as 
CacheStorageRecordInformation is not
thread-safe. To avoid this, we now replace the lambda with CompletionHandler, 
which has a more definitive move behavior
that does not involves copy.

* Source/WebKit/NetworkProcess/storage/CacheStorageDiskStore.cpp:
(WebKit::CacheStorageDiskStore::readAllRecordInfosInternal):
(WebKit::CacheStorageDiskStore::readAllRecordInfos):
(WebKit::CacheStorageDiskStore::readRecordsInternal):
(WebKit::CacheStorageDiskStore::readRecords):
* Source/WebKit/NetworkProcess/storage/CacheStorageDiskStore.h:

Originally-landed-as: 259548.577@safari-7615-branch (3679790c14ce). 
rdar://106965632
Canonical link: https://commits.webkit.org/264368@main


_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to