[Cocoa] Split FileSystemMac.mm into Mac and Cocoa parts
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Feb 2017 01:39:45 +0000 (01:39 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Feb 2017 01:39:45 +0000 (01:39 +0000)
https://bugs.webkit.org/show_bug.cgi?id=167908

Reviewed by Sam Weinig.

Kept the Mac-only functions in FileSystemMac.mm and moved the rest into FileSystemCocoa.mm.

* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* platform/cocoa/FileSystemCocoa.mm: Copied from Source/WebCore/platform/mac/FileSystemMac.mm.
* platform/mac/FileSystemMac.mm:
(-[WebFileManagerDelegate fileManager:shouldProceedAfterError:movingItemAtURL:toURL:]): Moved to FileSystemCocoa.mm.
(WebCore::homeDirectoryPath): Ditto.
(WebCore::openTemporaryFile): Ditto.
(WebCore::moveFile): Ditto.
(WebCore::getVolumeFreeSpace): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211762 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/PlatformMac.cmake
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/platform/cocoa/FileSystemCocoa.mm [new file with mode: 0644]
Source/WebCore/platform/mac/FileSystemMac.mm

index e3055cc..be59782 100644 (file)
@@ -1,3 +1,22 @@
+2017-02-06  Andy Estes  <aestes@apple.com>
+
+        [Cocoa] Split FileSystemMac.mm into Mac and Cocoa parts
+        https://bugs.webkit.org/show_bug.cgi?id=167908
+
+        Reviewed by Sam Weinig.
+
+        Kept the Mac-only functions in FileSystemMac.mm and moved the rest into FileSystemCocoa.mm.
+
+        * PlatformMac.cmake:
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/cocoa/FileSystemCocoa.mm: Copied from Source/WebCore/platform/mac/FileSystemMac.mm.
+        * platform/mac/FileSystemMac.mm:
+        (-[WebFileManagerDelegate fileManager:shouldProceedAfterError:movingItemAtURL:toURL:]): Moved to FileSystemCocoa.mm.
+        (WebCore::homeDirectoryPath): Ditto.
+        (WebCore::openTemporaryFile): Ditto.
+        (WebCore::moveFile): Ditto.
+        (WebCore::getVolumeFreeSpace): Ditto.
+
 2017-02-06  Eric Carlson  <eric.carlson@apple.com>
 
         [MediaStream Mac] Remove some unused code
index d0640b9..2e6b1a1 100644 (file)
@@ -317,6 +317,7 @@ list(APPEND WebCore_SOURCES
     platform/cocoa/ContentFilterUnblockHandlerCocoa.mm
     platform/cocoa/CoreVideoSoftLink.cpp
     platform/cocoa/DisplaySleepDisablerCocoa.cpp
+    platform/cocoa/FileSystemCocoa.mm
     platform/cocoa/KeyEventCocoa.mm
     platform/cocoa/LocalizedStringsCocoa.mm
     platform/cocoa/MIMETypeRegistryCocoa.mm
index 918b67f..b8abc7c 100644 (file)
                5148453E1BB9D07E006A72ED /* IDBError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5148453C1BB9D076006A72ED /* IDBError.cpp */; };
                5148453F1BB9D07E006A72ED /* IDBError.h in Headers */ = {isa = PBXBuildFile; fileRef = 5148453D1BB9D076006A72ED /* IDBError.h */; settings = {ATTRIBUTES = (Private, ); }; };
                514B3F730C722047000530DF /* FileSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 514B3F720C722047000530DF /* FileSystem.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               514B3F760C722055000530DF /* FileSystemMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 514B3F750C722055000530DF /* FileSystemMac.mm */; };
+               514B3F760C722055000530DF /* FileSystemCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 514B3F750C722055000530DF /* FileSystemCocoa.mm */; };
                514C76370CE9225E007EF3CD /* JSSQLError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 514C76350CE9225E007EF3CD /* JSSQLError.cpp */; };
                514C76380CE9225E007EF3CD /* JSSQLTransaction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 514C76360CE9225E007EF3CD /* JSSQLTransaction.cpp */; };
                514C764C0CE9234E007EF3CD /* AuthenticationMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 514C76420CE9234E007EF3CD /* AuthenticationMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A1C150791E3F2B3E0032C98C /* PreviewConverter.mm in Sources */ = {isa = PBXBuildFile; fileRef = A1C150771E3F2B3E0032C98C /* PreviewConverter.mm */; };
                A1C1507A1E3F2B3E0032C98C /* PreviewConverter.h in Headers */ = {isa = PBXBuildFile; fileRef = A1C150781E3F2B3E0032C98C /* PreviewConverter.h */; };
                A1C7FAA2133A5D3500D6732D /* JSXPathResultCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1C7FAA1133A5D3500D6732D /* JSXPathResultCustom.cpp */; };
+               A1CC11641E493D0100EFA69C /* FileSystemMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A1CC11621E493D0100EFA69C /* FileSystemMac.mm */; };
                A1DE712D18612AC100734192 /* TouchEvents.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1DE712B18612AC100734192 /* TouchEvents.cpp */; };
                A1DE71321861322200734192 /* TouchConstructors.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1DE71301861322200734192 /* TouchConstructors.cpp */; };
                A1E1154413015C3D0054AC8C /* DistantLightSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1E1154313015C3D0054AC8C /* DistantLightSource.cpp */; };
                5148453C1BB9D076006A72ED /* IDBError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBError.cpp; sourceTree = "<group>"; };
                5148453D1BB9D076006A72ED /* IDBError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBError.h; sourceTree = "<group>"; };
                514B3F720C722047000530DF /* FileSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileSystem.h; sourceTree = "<group>"; };
-               514B3F750C722055000530DF /* FileSystemMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FileSystemMac.mm; sourceTree = "<group>"; };
+               514B3F750C722055000530DF /* FileSystemCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FileSystemCocoa.mm; sourceTree = "<group>"; };
                514C76350CE9225E007EF3CD /* JSSQLError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSQLError.cpp; sourceTree = "<group>"; };
                514C76360CE9225E007EF3CD /* JSSQLTransaction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSQLTransaction.cpp; sourceTree = "<group>"; };
                514C76420CE9234E007EF3CD /* AuthenticationMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthenticationMac.h; sourceTree = "<group>"; };
                A1C150771E3F2B3E0032C98C /* PreviewConverter.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PreviewConverter.mm; sourceTree = "<group>"; };
                A1C150781E3F2B3E0032C98C /* PreviewConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PreviewConverter.h; sourceTree = "<group>"; };
                A1C7FAA1133A5D3500D6732D /* JSXPathResultCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSXPathResultCustom.cpp; sourceTree = "<group>"; };
+               A1CC11621E493D0100EFA69C /* FileSystemMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FileSystemMac.mm; sourceTree = "<group>"; };
                A1DE712B18612AC100734192 /* TouchEvents.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TouchEvents.cpp; sourceTree = "<group>"; };
                A1DE71301861322200734192 /* TouchConstructors.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TouchConstructors.cpp; sourceTree = "<group>"; };
                A1E1154313015C3D0054AC8C /* DistantLightSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DistantLightSource.cpp; sourceTree = "<group>"; };
                                A7CFB3D40B7ED1180070C32D /* DragImageMac.mm */,
                                E1BA66F01742BD8600C20251 /* DynamicLinkerInterposing.h */,
                                1CA19E030DC255950065A994 /* EventLoopMac.mm */,
-                               514B3F750C722055000530DF /* FileSystemMac.mm */,
+                               A1CC11621E493D0100EFA69C /* FileSystemMac.mm */,
                                935C476E09AC4D7300A6AAB4 /* KeyEventMac.mm */,
                                521D46F511AEC98100514613 /* KillRingMac.mm */,
                                06E81ED60AB5D5E900C87837 /* LocalCurrentGraphicsContext.h */,
                                7C7941E21C56C29300A4C58E /* DataDetectorsCoreSoftLink.mm */,
                                5D8C4DBD1428222C0026CE72 /* DisplaySleepDisablerCocoa.cpp */,
                                5D8C4DBE1428222C0026CE72 /* DisplaySleepDisablerCocoa.h */,
+                               514B3F750C722055000530DF /* FileSystemCocoa.mm */,
                                A5C974CF11485FF10066F2AB /* KeyEventCocoa.h */,
                                A5C974D011485FF10066F2AB /* KeyEventCocoa.mm */,
                                1A4832B21A953BA6008B4DFE /* LocalizedStringsCocoa.mm */,
                                C57FEDE11212EE9C0097BE65 /* FileSystem.cpp in Sources */,
                                5160306C0CC4362300C8AC25 /* FileSystemCF.cpp in Sources */,
                                26C17A3F1491D2D400D12BA2 /* FileSystemIOS.mm in Sources */,
-                               514B3F760C722055000530DF /* FileSystemMac.mm in Sources */,
+                               514B3F760C722055000530DF /* FileSystemCocoa.mm in Sources */,
                                5160300B0CC4251200C8AC25 /* FileSystemPOSIX.cpp in Sources */,
                                BC5EB69E0E81DAEB00B25965 /* FillLayer.cpp in Sources */,
                                08C925190FCC7C4A00480DEC /* FilterEffect.cpp in Sources */,
                                BCD9C2620C17AA67005C90A2 /* JSDOMWindowCustom.cpp in Sources */,
                                460CBF351D4BCD0E0092E88E /* JSDOMWindowProperties.cpp in Sources */,
                                BCBFB53C0DCD29CF0019B3E5 /* JSDOMWindowShell.cpp in Sources */,
+                               A1CC11641E493D0100EFA69C /* FileSystemMac.mm in Sources */,
                                4170A2EA1D8C0CCA00318452 /* JSDOMWrapper.cpp in Sources */,
                                93A8061D1E03B585008A1F26 /* JSDoubleRange.cpp in Sources */,
                                FD7868B9136B999200D403DF /* JSDynamicsCompressorNode.cpp in Sources */,
diff --git a/Source/WebCore/platform/cocoa/FileSystemCocoa.mm b/Source/WebCore/platform/cocoa/FileSystemCocoa.mm
new file mode 100644 (file)
index 0000000..51e2259
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2007-2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer. 
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution. 
+ * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission. 
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "FileSystem.h"
+
+@interface WebFileManagerDelegate : NSObject <NSFileManagerDelegate>
+@end
+
+@implementation WebFileManagerDelegate
+
+- (BOOL)fileManager:(NSFileManager *)fileManager shouldProceedAfterError:(NSError *)error movingItemAtURL:(NSURL *)srcURL toURL:(NSURL *)dstURL
+{
+    UNUSED_PARAM(fileManager);
+    UNUSED_PARAM(srcURL);
+    UNUSED_PARAM(dstURL);    
+    return error.code == NSFileWriteFileExistsError;
+}
+
+@end
+
+namespace WebCore {
+
+String homeDirectoryPath()
+{
+    return NSHomeDirectory();
+}
+
+String openTemporaryFile(const String& prefix, PlatformFileHandle& platformFileHandle)
+{
+    platformFileHandle = invalidPlatformFileHandle;
+    
+    Vector<char> temporaryFilePath(PATH_MAX);
+    if (!confstr(_CS_DARWIN_USER_TEMP_DIR, temporaryFilePath.data(), temporaryFilePath.size()))
+        return String();
+
+    // Shrink the vector.   
+    temporaryFilePath.shrink(strlen(temporaryFilePath.data()));
+
+    // FIXME: Change to a runtime assertion that the path ends with a slash once <rdar://problem/23579077> is
+    // fixed in all iOS Simulator versions that we use.
+    if (temporaryFilePath.last() != '/')
+        temporaryFilePath.append('/');
+
+    // Append the file name.
+    CString prefixUtf8 = prefix.utf8();
+    temporaryFilePath.append(prefixUtf8.data(), prefixUtf8.length());
+    temporaryFilePath.append("XXXXXX", 6);
+    temporaryFilePath.append('\0');
+
+    platformFileHandle = mkstemp(temporaryFilePath.data());
+    if (platformFileHandle == invalidPlatformFileHandle)
+        return String();
+
+    return String::fromUTF8(temporaryFilePath.data());
+}
+
+bool moveFile(const String& oldPath, const String& newPath)
+{
+    // Overwrite existing files.
+    auto manager = adoptNS([[NSFileManager alloc] init]);
+    auto delegate = adoptNS([[WebFileManagerDelegate alloc] init]);
+    [manager setDelegate:delegate.get()];
+    
+    return [manager moveItemAtURL:[NSURL fileURLWithPath:oldPath] toURL:[NSURL fileURLWithPath:newPath] error:nil];
+}
+
+bool getVolumeFreeSpace(const String& path, uint64_t& freeSpace)
+{
+    NSDictionary *fileSystemAttributesDictionary = [[NSFileManager defaultManager] attributesOfFileSystemForPath:(NSString *)path error:NULL];
+    if (!fileSystemAttributesDictionary)
+        return false;
+    freeSpace = [[fileSystemAttributesDictionary objectForKey:NSFileSystemFreeSize] unsignedLongLongValue];
+    return true;
+}
+
+} // namespace WebCore
index 605387a..1cc732b 100644 (file)
 /*
- * Copyright (C) 2007, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2007-2017 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
  *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer. 
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution. 
- * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission. 
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 #import "config.h"
 #import "FileSystem.h"
 
+#if PLATFORM(MAC)
+
 #import "WebCoreNSURLExtras.h"
 #import "WebCoreSystemInterface.h"
-#import <Foundation/FoundationErrors.h>
-#import <Foundation/NSFileManager.h>
-#import <wtf/RetainPtr.h>
-#import <wtf/text/CString.h>
 #import <wtf/text/WTFString.h>
 
-@interface WebFileManagerDelegate : NSObject <NSFileManagerDelegate>
-@end
-
-@implementation WebFileManagerDelegate
-
-- (BOOL)fileManager:(NSFileManager *)fileManager shouldProceedAfterError:(NSError *)error movingItemAtURL:(NSURL *)srcURL toURL:(NSURL *)dstURL
-{
-    UNUSED_PARAM(fileManager);
-    UNUSED_PARAM(srcURL);
-    UNUSED_PARAM(dstURL);    
-    return error.code == NSFileWriteFileExistsError;
-}
-
-@end
-
 namespace WebCore {
 
-String homeDirectoryPath()
-{
-    return NSHomeDirectory();
-}
-
-String openTemporaryFile(const String& prefix, PlatformFileHandle& platformFileHandle)
-{
-    platformFileHandle = invalidPlatformFileHandle;
-    
-    Vector<char> temporaryFilePath(PATH_MAX);
-    if (!confstr(_CS_DARWIN_USER_TEMP_DIR, temporaryFilePath.data(), temporaryFilePath.size()))
-        return String();
-
-    // Shrink the vector.   
-    temporaryFilePath.shrink(strlen(temporaryFilePath.data()));
-
-    // FIXME: Change to a runtime assertion that the path ends with a slash once <rdar://problem/23579077> is
-    // fixed in all iOS Simulator versions that we use.
-    if (temporaryFilePath.last() != '/')
-        temporaryFilePath.append('/');
-
-    // Append the file name.
-    CString prefixUtf8 = prefix.utf8();
-    temporaryFilePath.append(prefixUtf8.data(), prefixUtf8.length());
-    temporaryFilePath.append("XXXXXX", 6);
-    temporaryFilePath.append('\0');
-
-    platformFileHandle = mkstemp(temporaryFilePath.data());
-    if (platformFileHandle == invalidPlatformFileHandle)
-        return String();
-
-    return String::fromUTF8(temporaryFilePath.data());
-}
-
-bool moveFile(const String& oldPath, const String& newPath)
-{
-    // Overwrite existing files.
-    auto manager = adoptNS([[NSFileManager alloc] init]);
-    auto delegate = adoptNS([[WebFileManagerDelegate alloc] init]);
-    [manager setDelegate:delegate.get()];
-    
-    return [manager moveItemAtURL:[NSURL fileURLWithPath:oldPath] toURL:[NSURL fileURLWithPath:newPath] error:nil];
-}
-
-bool getVolumeFreeSpace(const String& path, uint64_t& freeSpace)
-{
-    NSDictionary *fileSystemAttributesDictionary = [[NSFileManager defaultManager] attributesOfFileSystemForPath:(NSString *)path error:NULL];
-    if (!fileSystemAttributesDictionary)
-        return false;
-    freeSpace = [[fileSystemAttributesDictionary objectForKey:NSFileSystemFreeSize] unsignedLongLongValue];
-    return true;
-}
-
-#if !PLATFORM(IOS)
 bool deleteEmptyDirectory(const String& path)
 {
     auto fileManager = adoptNS([[NSFileManager alloc] init]);
@@ -149,6 +75,6 @@ bool excludeFromBackup(const String& path)
     return true;
 }
 
-#endif
-
 } // namespace WebCore
+
+#endif // PLATFORM(MAC)