Diff
Modified: trunk/Source/_javascript_Core/API/tests/testapi.mm (233078 => 233079)
--- trunk/Source/_javascript_Core/API/tests/testapi.mm 2018-06-22 14:02:30 UTC (rev 233078)
+++ trunk/Source/_javascript_Core/API/tests/testapi.mm 2018-06-22 15:03:54 UTC (rev 233079)
@@ -706,7 +706,7 @@
context.exceptionHandler = ^(JSContext *, JSValue *exception) {
exceptionSourceURL = [exception[@"sourceURL"] toString];
};
- NSURL *url = "" fileURLWithPath:@"/foo/bar.js"];
+ NSURL *url = "" fileURLWithPath:@"/foo/bar.js" isDirectory:NO];
[context evaluateScript:@"!@#$%^&*() THIS IS NOT VALID _javascript_ SYNTAX !@#$%^&*()" withSourceURL:url];
checkResult(@"evaluateScript:withSourceURL: exception has expected sourceURL", [exceptionSourceURL isEqualToString:[url absoluteString]]);
}
Modified: trunk/Source/_javascript_Core/ChangeLog (233078 => 233079)
--- trunk/Source/_javascript_Core/ChangeLog 2018-06-22 14:02:30 UTC (rev 233078)
+++ trunk/Source/_javascript_Core/ChangeLog 2018-06-22 15:03:54 UTC (rev 233079)
@@ -1,3 +1,13 @@
+2018-06-20 Darin Adler <[email protected]>
+
+ [Cocoa] Use the isDirectory: variants of NSURL methods more to eliminate unnecessary file system activity
+ https://bugs.webkit.org/show_bug.cgi?id=186875
+
+ Reviewed by Anders Carlsson.
+
+ * API/tests/testapi.mm:
+ (testObjectiveCAPIMain): Use isDirectory:NO when creating a URL for a _javascript_ file.
+
2018-06-22 Carlos Garcia Campos <[email protected]>
[GTK] WebDriver: use a dictionary for session capabilities in StartAutomationSession message
Modified: trunk/Source/WebCore/ChangeLog (233078 => 233079)
--- trunk/Source/WebCore/ChangeLog 2018-06-22 14:02:30 UTC (rev 233078)
+++ trunk/Source/WebCore/ChangeLog 2018-06-22 15:03:54 UTC (rev 233079)
@@ -1,3 +1,14 @@
+2018-06-20 Darin Adler <[email protected]>
+
+ [Cocoa] Use the isDirectory: variants of NSURL methods more to eliminate unnecessary file system activity
+ https://bugs.webkit.org/show_bug.cgi?id=186875
+
+ Reviewed by Anders Carlsson.
+
+ * platform/cocoa/ThemeCocoa.mm:
+ (WebCore::passKitBundle): Use isDirectory:YES when creating a URL pointing to a framework,
+ since frameworks are directories.
+
2018-06-22 Miguel Gomez <[email protected]>
[WPE][ThreadedRendering] WPE crashes rendering SVG content when using ThreadedRendering
Modified: trunk/Source/WebCore/platform/cocoa/ThemeCocoa.mm (233078 => 233079)
--- trunk/Source/WebCore/platform/cocoa/ThemeCocoa.mm 2018-06-22 14:02:30 UTC (rev 233078)
+++ trunk/Source/WebCore/platform/cocoa/ThemeCocoa.mm 2018-06-22 15:03:54 UTC (rev 233079)
@@ -59,7 +59,7 @@
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
#if PLATFORM(MAC)
- passKitBundle = [NSBundle bundleWithURL:[NSURL fileURLWithPath:@"/System/Library/PrivateFrameworks/PassKit.framework"]];
+ passKitBundle = [NSBundle bundleWithURL:[NSURL fileURLWithPath:@"/System/Library/PrivateFrameworks/PassKit.framework" isDirectory:YES]];
#else
dlopen("/System/Library/Frameworks/PassKit.framework/PassKit", RTLD_NOW);
passKitBundle = [NSBundle bundleForClass:NSClassFromString(@"PKPaymentAuthorizationViewController")];
Modified: trunk/Source/WebKit/ChangeLog (233078 => 233079)
--- trunk/Source/WebKit/ChangeLog 2018-06-22 14:02:30 UTC (rev 233078)
+++ trunk/Source/WebKit/ChangeLog 2018-06-22 15:03:54 UTC (rev 233079)
@@ -1,3 +1,38 @@
+2018-06-20 Darin Adler <[email protected]>
+
+ [Cocoa] Use the isDirectory: variants of NSURL methods more to eliminate unnecessary file system activity
+ https://bugs.webkit.org/show_bug.cgi?id=186875
+
+ Reviewed by Anders Carlsson.
+
+ * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
+ (API::WebsiteDataStore::tempDirectoryFileSystemRepresentation): Use isDirectory:YES to create a URL
+ to the temporary directory.
+ * UIProcess/Cocoa/WebViewImpl.mm:
+ (WebKit::WebViewImpl::namesOfPromisedFilesDroppedAtDestination): Use isDirectory:NO to create a URL
+ pointing to the write location.
+ * UIProcess/WebStorage/ios/LocalStorageDatabaseTrackerIOS.mm:
+ (WebKit::LocalStorageDatabaseTracker::platformMaybeExcludeFromBackup const): Use isDirectory:YES to
+ create a URL for the local storage directory.
+ * UIProcess/ios/ResourceLoadStatisticsPersistentStorageIOS.mm:
+ (WebKit::ResourceLoadStatisticsPersistentStorage::excludeFromBackup const): Use isDirectory:NO to
+ create a URL for the storage directory.
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView _prepareToDragPromisedBlob:]): Use isDirectory:NO to create a URL for the temporary
+ file location.
+ * UIProcess/ios/forms/WKFileUploadPanel.mm:
+ (-[WKFileUploadPanel _uploadItemForImageData:imageName:successBlock:failureBlock:]): Use isDirectory:NO
+ to create a URL for the image file to upload.
+ * UIProcess/mac/WebInspectorProxyMac.mm:
+ (WebKit::WebInspectorProxy::inspectorPageURL): Use isDirectory:NO to create a URL for the HTML file.
+ (WebKit::WebInspectorProxy::inspectorTestPageURL): Ditto.
+ (WebKit::WebInspectorProxy::inspectorBaseURL): Ditto.
+ * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
+ (WebKit::WebChromeClient::createIconForFiles): Use isDirectory:NO to create a URL for the image file.
+ * WebProcess/WebPage/mac/WebInspectorUIMac.mm:
+ (WebKit::webInspectorUILocalizedStringsURL): Use isDirectory:NO to create a URL for the localized
+ strings file.
+
2018-06-21 Chris Dumez <[email protected]>
Unreviewed, rolling out r232995.
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm (233078 => 233079)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm 2018-06-22 14:02:30 UTC (rev 233078)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm 2018-06-22 15:03:54 UTC (rev 233079)
@@ -108,7 +108,7 @@
static NSURL *tempURL;
dispatch_once(&onceToken, ^{
- NSURL *url = "" fileURLWithPath:NSTemporaryDirectory()];
+ NSURL *url = "" fileURLWithPath:NSTemporaryDirectory() isDirectory:YES];
if (!url)
RELEASE_ASSERT_NOT_REACHED();
Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm (233078 => 233079)
--- trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm 2018-06-22 14:02:30 UTC (rev 233078)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm 2018-06-22 15:03:54 UTC (rev 233079)
@@ -3959,7 +3959,7 @@
// FIXME: Report an error if we fail to create a file.
NSString *path = [[dropDestination path] stringByAppendingPathComponent:[wrapper preferredFilename]];
path = pathWithUniqueFilenameForPath(path);
- if (![wrapper writeToURL:[NSURL fileURLWithPath:path] options:NSFileWrapperWritingWithNameUpdating originalContentsURL:nil error:nullptr])
+ if (![wrapper writeToURL:[NSURL fileURLWithPath:path isDirectory:NO] options:NSFileWrapperWritingWithNameUpdating originalContentsURL:nil error:nullptr])
LOG_ERROR("Failed to create image file via -[NSFileWrapper writeToURL:options:originalContentsURL:error:]");
if (!m_promisedURL.isEmpty())
Modified: trunk/Source/WebKit/UIProcess/WebStorage/ios/LocalStorageDatabaseTrackerIOS.mm (233078 => 233079)
--- trunk/Source/WebKit/UIProcess/WebStorage/ios/LocalStorageDatabaseTrackerIOS.mm 2018-06-22 14:02:30 UTC (rev 233078)
+++ trunk/Source/WebKit/UIProcess/WebStorage/ios/LocalStorageDatabaseTrackerIOS.mm 2018-06-22 15:03:54 UTC (rev 233079)
@@ -40,7 +40,7 @@
m_hasExcludedFromBackup = true;
if (linkedOnOrAfter(SDKVersion::FirstToExcludeLocalStorageFromBackup))
- [[NSURL fileURLWithPath:(NSString *)m_localStorageDirectory] setResourceValue:@YES forKey:NSURLIsExcludedFromBackupKey error:nil];
+ [[NSURL fileURLWithPath:(NSString *)m_localStorageDirectory isDirectory:YES] setResourceValue:@YES forKey:NSURLIsExcludedFromBackupKey error:nil];
}
} // namespace WebKit
Modified: trunk/Source/WebKit/UIProcess/ios/ResourceLoadStatisticsPersistentStorageIOS.mm (233078 => 233079)
--- trunk/Source/WebKit/UIProcess/ios/ResourceLoadStatisticsPersistentStorageIOS.mm 2018-06-22 14:02:30 UTC (rev 233078)
+++ trunk/Source/WebKit/UIProcess/ios/ResourceLoadStatisticsPersistentStorageIOS.mm 2018-06-22 15:03:54 UTC (rev 233079)
@@ -32,7 +32,7 @@
void ResourceLoadStatisticsPersistentStorage::excludeFromBackup() const
{
- [[NSURL fileURLWithPath:(NSString *)m_storageDirectoryPath] setResourceValue:@YES forKey:NSURLIsExcludedFromBackupKey error:nil];
+ [[NSURL fileURLWithPath:(NSString *)m_storageDirectoryPath isDirectory:YES] setResourceValue:@YES forKey:NSURLIsExcludedFromBackupKey error:nil];
}
}
Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (233078 => 233079)
--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2018-06-22 14:02:30 UTC (rev 233078)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2018-06-22 15:03:54 UTC (rev 233079)
@@ -5056,7 +5056,7 @@
}
NSString *temporaryBlobDirectory = FileSystem::createTemporaryDirectory(@"blobs");
- NSURL *destinationURL = [NSURL fileURLWithPath:[temporaryBlobDirectory stringByAppendingPathComponent:[NSUUID UUID].UUIDString]];
+ NSURL *destinationURL = [NSURL fileURLWithPath:[temporaryBlobDirectory stringByAppendingPathComponent:[NSUUID UUID].UUIDString] isDirectory:NO];
RELEASE_LOG(DragAndDrop, "Drag session: %p delivering promised blob at path: %@", session.get(), destinationURL.path);
strongSelf->_page->writeBlobToFilePath(url, destinationURL.path, [protectedURL = retainPtr(destinationURL), protectedCallback = makeBlockPtr(callback)] (bool success) {
Modified: trunk/Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm (233078 => 233079)
--- trunk/Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm 2018-06-22 14:02:30 UTC (rev 233078)
+++ trunk/Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm 2018-06-22 15:03:54 UTC (rev 233079)
@@ -629,7 +629,7 @@
return;
}
- successBlock(adoptNS([[_WKImageFileUploadItem alloc] initWithFileURL:[NSURL fileURLWithPath:filePath]]).get());
+ successBlock(adoptNS([[_WKImageFileUploadItem alloc] initWithFileURL:[NSURL fileURLWithPath:filePath isDirectory:NO]]).get());
}
- (void)_uploadItemForJPEGRepresentationOfImage:(UIImage *)image successBlock:(void (^)(_WKFileUploadItem *))successBlock failureBlock:(void (^)(void))failureBlock
Modified: trunk/Source/WebKit/UIProcess/mac/WebInspectorProxyMac.mm (233078 => 233079)
--- trunk/Source/WebKit/UIProcess/mac/WebInspectorProxyMac.mm 2018-06-22 14:02:30 UTC (rev 233078)
+++ trunk/Source/WebKit/UIProcess/mac/WebInspectorProxyMac.mm 2018-06-22 15:03:54 UTC (rev 233079)
@@ -656,7 +656,7 @@
NSString *path = [[NSBundle bundleWithIdentifier:@"com.apple.WebInspectorUI"] pathForResource:@"Main" ofType:@"html"];
ASSERT([path length]);
- return [[NSURL fileURLWithPath:path] absoluteString];
+ return [[NSURL fileURLWithPath:path isDirectory:NO] absoluteString];
}
String WebInspectorProxy::inspectorTestPageURL()
@@ -670,7 +670,7 @@
if (!path)
return String();
- return [[NSURL fileURLWithPath:path] absoluteString];
+ return [[NSURL fileURLWithPath:path isDirectory:NO] absoluteString];
}
String WebInspectorProxy::inspectorBaseURL()
@@ -681,7 +681,7 @@
NSString *path = [[NSBundle bundleWithIdentifier:@"com.apple.WebInspectorUI"] resourcePath];
ASSERT([path length]);
- return [[NSURL fileURLWithPath:path] absoluteString];
+ return [[NSURL fileURLWithPath:path isDirectory:YES] absoluteString];
}
} // namespace WebKit
Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm (233078 => 233079)
--- trunk/Source/WebKit/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm 2018-06-22 14:02:30 UTC (rev 233078)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm 2018-06-22 15:03:54 UTC (rev 233079)
@@ -157,7 +157,7 @@
// FIXME: We should generate an icon showing multiple files here, if applicable. Currently, if there are multiple
// files, we only use the first URL to generate an icon.
- return Icon::createIconForImage(iconForFile([NSURL fileURLWithPath:filenames[0]]).CGImage);
+ return Icon::createIconForImage(iconForFile([NSURL fileURLWithPath:filenames[0] isDirectory:NO]).CGImage);
}
} // namespace WebKit
Modified: trunk/Source/WebKit/WebProcess/WebPage/mac/WebInspectorUIMac.mm (233078 => 233079)
--- trunk/Source/WebKit/WebProcess/WebPage/mac/WebInspectorUIMac.mm 2018-06-22 14:02:30 UTC (rev 233078)
+++ trunk/Source/WebKit/WebProcess/WebPage/mac/WebInspectorUIMac.mm 2018-06-22 15:03:54 UTC (rev 233079)
@@ -45,7 +45,7 @@
NSString *path = [[NSBundle bundleWithIdentifier:@"com.apple.WebInspectorUI"] pathForResource:@"localizedStrings" ofType:@"js"];
if (path.length)
- return [[NSURL fileURLWithPath:path] absoluteString];
+ return [[NSURL fileURLWithPath:path isDirectory:NO] absoluteString];
return String();
}
Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (233078 => 233079)
--- trunk/Source/WebKitLegacy/mac/ChangeLog 2018-06-22 14:02:30 UTC (rev 233078)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog 2018-06-22 15:03:54 UTC (rev 233079)
@@ -1,3 +1,18 @@
+2018-06-20 Darin Adler <[email protected]>
+
+ [Cocoa] Use the isDirectory: variants of NSURL methods more to eliminate unnecessary file system activity
+ https://bugs.webkit.org/show_bug.cgi?id=186875
+
+ Reviewed by Anders Carlsson.
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): Use isDirectory:NO for the URL of the location
+ to write te file to.
+ * WebView/WebPreferences.mm:
+ (-[WebPreferences userStyleSheetLocation]): Use isDirectory:NO to create a URL for the user style sheet.
+ * WebView/WebView.mm:
+ (-[WebView setMainFrameURL:]): Use isDirectory:NO to create a URL for a local webpage to load.
+
2018-06-12 Darin Adler <[email protected]>
[Cocoa] Make some RetainPtr refinements to get more ready for ARC
Modified: trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm (233078 => 233079)
--- trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm 2018-06-22 14:02:30 UTC (rev 233078)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm 2018-06-22 15:03:54 UTC (rev 233079)
@@ -4387,7 +4387,7 @@
// FIXME: Report an error if we fail to create a file.
NSString *path = [[dropDestination path] stringByAppendingPathComponent:[wrapper preferredFilename]];
path = [[NSFileManager defaultManager] _webkit_pathWithUniqueFilenameForPath:path];
- if (![wrapper writeToURL:[NSURL fileURLWithPath:path] options:NSFileWrapperWritingWithNameUpdating originalContentsURL:nil error:nullptr])
+ if (![wrapper writeToURL:[NSURL fileURLWithPath:path isDirectory:NO] options:NSFileWrapperWritingWithNameUpdating originalContentsURL:nil error:nullptr])
LOG_ERROR("Failed to create image file via -[NSFileWrapper writeToURL:options:originalContentsURL:error:]");
if (draggingElementURL)
Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm (233078 => 233079)
--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm 2018-06-22 14:02:30 UTC (rev 233078)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm 2018-06-22 15:03:54 UTC (rev 233079)
@@ -1015,7 +1015,7 @@
return [NSURL _web_URLWithDataAsString:locationString];
} else {
locationString = [locationString stringByExpandingTildeInPath];
- return [NSURL fileURLWithPath:locationString];
+ return [NSURL fileURLWithPath:locationString isDirectory:NO];
}
}
Modified: trunk/Source/WebKitLegacy/mac/WebView/WebView.mm (233078 => 233079)
--- trunk/Source/WebKitLegacy/mac/WebView/WebView.mm 2018-06-22 14:02:30 UTC (rev 233078)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebView.mm 2018-06-22 15:03:54 UTC (rev 233079)
@@ -7103,7 +7103,7 @@
NSURL *url;
if ([URLString hasPrefix:@"/"])
- url = "" fileURLWithPath:URLString];
+ url = "" fileURLWithPath:URLString isDirectory:NO];
else
url = "" _web_URLWithDataAsString:URLString];
Modified: trunk/Tools/ChangeLog (233078 => 233079)
--- trunk/Tools/ChangeLog 2018-06-22 14:02:30 UTC (rev 233078)
+++ trunk/Tools/ChangeLog 2018-06-22 15:03:54 UTC (rev 233079)
@@ -1,3 +1,16 @@
+2018-06-20 Darin Adler <[email protected]>
+
+ [Cocoa] Use the isDirectory: variants of NSURL methods more to eliminate unnecessary file system activity
+ https://bugs.webkit.org/show_bug.cgi?id=186875
+
+ Reviewed by Anders Carlsson.
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (activateTestingFonts): Use isDirectory:NO to create a URL for a font file.
+ * WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm:
+ (WTR::activateFonts): Ditto.
+ (WTR::installFakeHelvetica): Ditto.
+
2018-06-22 Carlos Garcia Campos <[email protected]>
[GTK] WebDriver: use a dictionary for session capabilities in StartAutomationSession message
Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (233078 => 233079)
--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm 2018-06-22 14:02:30 UTC (rev 233078)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm 2018-06-22 15:03:54 UTC (rev 233079)
@@ -520,7 +520,7 @@
NSMutableArray *fontURLs = [NSMutableArray array];
NSURL *resourcesDirectory = [NSURL URLWithString:@"DumpRenderTree.resources" relativeToURL:[[NSBundle mainBundle] executableURL]];
for (unsigned i = 0; fontFileNames[i]; ++i) {
- NSURL *fontURL = [resourcesDirectory URLByAppendingPathComponent:[NSString stringWithUTF8String:fontFileNames[i]]];
+ NSURL *fontURL = [resourcesDirectory URLByAppendingPathComponent:[NSString stringWithUTF8String:fontFileNames[i]] isDirectory:NO];
[fontURLs addObject:[fontURL absoluteURL]];
}
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm (233078 => 233079)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm 2018-06-22 14:02:30 UTC (rev 233078)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm 2018-06-22 15:03:54 UTC (rev 233079)
@@ -117,7 +117,7 @@
NSMutableArray *fontURLs = [NSMutableArray array];
for (unsigned i = 0; fontFileNames[i]; ++i) {
- NSURL *fontURL = [resourcesDirectoryURL() URLByAppendingPathComponent:[NSString stringWithUTF8String:fontFileNames[i]]];
+ NSURL *fontURL = [resourcesDirectoryURL() URLByAppendingPathComponent:[NSString stringWithUTF8String:fontFileNames[i]] isDirectory:NO];
[fontURLs addObject:[fontURL absoluteURL]];
}
@@ -136,7 +136,7 @@
void installFakeHelvetica(WKStringRef configuration)
{
RetainPtr<CFStringRef> configurationString = adoptCF(WKStringCopyCFString(kCFAllocatorDefault, configuration));
- NSURL *resourceURL = [resourcesDirectoryURL() URLByAppendingPathComponent:[NSString stringWithFormat:@"FakeHelvetica-%@.ttf", configurationString.get()]];
+ NSURL *resourceURL = [resourcesDirectoryURL() URLByAppendingPathComponent:[NSString stringWithFormat:@"FakeHelvetica-%@.ttf", configurationString.get()] isDirectory:NO];
CFErrorRef error = nullptr;
CTFontManagerRegisterFontsForURL(static_cast<CFURLRef>(resourceURL), kCTFontManagerScopeProcess, &error);
}