Changeset 224885 in webkit


Ignore:
Timestamp:
Nov 15, 2017 10:36:57 AM (6 years ago)
Author:
achristensen@apple.com
Message:

Move a compiled WKContentRuleList to its destination before calling mmap
https://bugs.webkit.org/show_bug.cgi?id=179719

Reviewed by Brady Eidson.

Right now we compile a WKContentRuleList to a temporary file, call mmap, close the file, then move it.
Sometimes, especially on bots running tests, the move fails because the temporary file doesn't exist
any more. Moving the file before mmaping and closing the file might prevent this failure.

  • UIProcess/API/APIContentRuleListStore.cpp:

(API::compiledToFile):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r224880 r224885  
     12017-11-15  Alex Christensen  <achristensen@webkit.org>
     2
     3        Move a compiled WKContentRuleList to its destination before calling mmap
     4        https://bugs.webkit.org/show_bug.cgi?id=179719
     5
     6        Reviewed by Brady Eidson.
     7
     8        Right now we compile a WKContentRuleList to a temporary file, call mmap, close the file, then move it.
     9        Sometimes, especially on bots running tests, the move fails because the temporary file doesn't exist
     10        any more.  Moving the file before mmaping and closing the file might prevent this failure.
     11
     12        * UIProcess/API/APIContentRuleListStore.cpp:
     13        (API::compiledToFile):
     14
    1152017-11-15  Chris Dumez  <cdumez@apple.com>
    216
  • trunk/Source/WebKit/UIProcess/API/APIContentRuleListStore.cpp

    r224790 r224885  
    350350        return ContentRuleListStore::Error::CompileFailed;
    351351    }
    352    
     352
     353    if (!moveFile(temporaryFilePath, finalFilePath)) {
     354        WTFLogAlways("Content Rule List compiling failed: Moving file failed.");
     355        return ContentRuleListStore::Error::CompileFailed;
     356    }
     357
    353358    mappedData = adoptAndMapFile(temporaryFileHandle, 0, metaData.fileSize());
    354359    if (mappedData.isNull()) {
    355360        WTFLogAlways("Content Rule List compiling failed: Mapping file failed.");
    356         return ContentRuleListStore::Error::CompileFailed;
    357     }
    358 
    359     if (!moveFile(temporaryFilePath, finalFilePath)) {
    360         WTFLogAlways("Content Rule List compiling failed: Moving file failed.");
     361        deleteFile(finalFilePath);
    361362        return ContentRuleListStore::Error::CompileFailed;
    362363    }
Note: See TracChangeset for help on using the changeset viewer.