[Cocoa] Use the isDirectory: variants of NSURL methods more to eliminate unnecessary...
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Jun 2018 15:03:54 +0000 (15:03 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Jun 2018 15:03:54 +0000 (15:03 +0000)
commitbf9b075a03e117d5e04b515cf91c4f9bc4924b9d
tree8d177f21c229e60d7012828a6a9a3094cfee75fa
parente2ca3f25ca72451216186d4abdf9fa25c76bea43
[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.

Source/JavaScriptCore:

* API/tests/testapi.mm:
(testObjectiveCAPIMain): Use isDirectory:NO when creating a URL for a JavaScript file.

Source/WebCore:

* platform/cocoa/ThemeCocoa.mm:
(WebCore::passKitBundle): Use isDirectory:YES when creating a URL pointing to a framework,
since frameworks are directories.

Source/WebKit:

* 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.

Source/WebKitLegacy/mac:

* 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.

Tools:

* 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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233079 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
Source/JavaScriptCore/API/tests/testapi.mm
Source/JavaScriptCore/ChangeLog
Source/WebCore/ChangeLog
Source/WebCore/platform/cocoa/ThemeCocoa.mm
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm
Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm
Source/WebKit/UIProcess/WebStorage/ios/LocalStorageDatabaseTrackerIOS.mm
Source/WebKit/UIProcess/ios/ResourceLoadStatisticsPersistentStorageIOS.mm
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm
Source/WebKit/UIProcess/mac/WebInspectorProxyMac.mm
Source/WebKit/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm
Source/WebKit/WebProcess/WebPage/mac/WebInspectorUIMac.mm
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebView/WebHTMLView.mm
Source/WebKitLegacy/mac/WebView/WebPreferences.mm
Source/WebKitLegacy/mac/WebView/WebView.mm
Tools/ChangeLog
Tools/DumpRenderTree/mac/DumpRenderTree.mm
Tools/WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm