Changeset 244997 in webkit


Ignore:
Timestamp:
May 6, 2019 5:42:44 PM (5 years ago)
Author:
Chris Dumez
Message:

ASSERT at WebKit::NetworkCache::makeSafeToUseMemoryMapForPath under Storage::StoreBodyAsBlob when running WebDriver tests
https://bugs.webkit.org/show_bug.cgi?id=197635
<rdar://problem/50473149>

Reviewed by Geoffrey Garen.

We need to make sure the the path at blobPathString exists before calling FileSystem::makeSafeToUseMemoryMapForPath().
If the blob does not already exist when BlobStorage::add() is called, what will create it is the call to Data::mapToFile().

  • NetworkProcess/cache/NetworkCacheBlobStorage.cpp:

(WebKit::NetworkCache::BlobStorage::add):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r244993 r244997  
     12019-05-06  Chris Dumez  <cdumez@apple.com>
     2
     3        ASSERT at WebKit::NetworkCache::makeSafeToUseMemoryMapForPath under Storage::StoreBodyAsBlob when running WebDriver tests
     4        https://bugs.webkit.org/show_bug.cgi?id=197635
     5        <rdar://problem/50473149>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        We need to make sure the the path at blobPathString exists before calling FileSystem::makeSafeToUseMemoryMapForPath().
     10        If the blob does not already exist when BlobStorage::add() is called, what will create it is the call to Data::mapToFile().
     11
     12        * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
     13        (WebKit::NetworkCache::BlobStorage::add):
     14
    1152019-05-06  Wenson Hsieh  <wenson_hsieh@apple.com>
    216
  • trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheBlobStorage.cpp

    r244921 r244997  
    9595
    9696    String blobPathString = blobPathForHash(hash);
    97     FileSystem::makeSafeToUseMemoryMapForPath(blobPathString);
    9897   
    9998    auto blobPath = FileSystem::fileSystemRepresentation(blobPathString);
     
    103102    bool blobExists = access(blobPath.data(), F_OK) != -1;
    104103    if (blobExists) {
     104        FileSystem::makeSafeToUseMemoryMapForPath(blobPathString);
    105105        auto existingData = mapFile(blobPath.data());
    106106        if (bytesEqual(existingData, data)) {
     
    115115    if (mappedData.isNull())
    116116        return { };
     117
     118    FileSystem::makeSafeToUseMemoryMapForPath(blobPathString);
    117119
    118120    if (link(blobPath.data(), linkPath.data()) == -1)
Note: See TracChangeset for help on using the changeset viewer.