Diff
Modified: trunk/Source/WebCore/ChangeLog (213104 => 213105)
--- trunk/Source/WebCore/ChangeLog 2017-02-28 01:10:39 UTC (rev 213104)
+++ trunk/Source/WebCore/ChangeLog 2017-02-28 01:13:58 UTC (rev 213105)
@@ -1,5 +1,16 @@
2017-02-27 Andy Estes <[email protected]>
+ [Cocoa] Rename FileMac.mm to FileCocoa.mm
+ https://bugs.webkit.org/show_bug.cgi?id=168947
+
+ Reviewed by Zalan Bujtas.
+
+ * PlatformMac.cmake:
+ * WebCore.xcodeproj/project.pbxproj:
+ * fileapi/FileCocoa.mm: Renamed from Source/WebCore/fileapi/FileMac.mm.
+
+2017-02-27 Andy Estes <[email protected]>
+
[iOS] Enable file replacement
https://bugs.webkit.org/show_bug.cgi?id=168907
<rdar://problem/22258242>
Modified: trunk/Source/WebCore/PlatformMac.cmake (213104 => 213105)
--- trunk/Source/WebCore/PlatformMac.cmake 2017-02-28 01:10:39 UTC (rev 213104)
+++ trunk/Source/WebCore/PlatformMac.cmake 2017-02-28 01:13:58 UTC (rev 213105)
@@ -227,7 +227,7 @@
editing/mac/TextAlternativeWithRange.mm
editing/mac/TextUndoInsertionMarkupMac.mm
- fileapi/FileMac.mm
+ fileapi/FileCocoa.mm
html/HTMLSlotElement.cpp
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (213104 => 213105)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2017-02-28 01:10:39 UTC (rev 213104)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2017-02-28 01:13:58 UTC (rev 213105)
@@ -6274,7 +6274,7 @@
E15A36D71104572000B7B639 /* XMLNSNames.h in Headers */ = {isa = PBXBuildFile; fileRef = E15A36D61104572000B7B639 /* XMLNSNames.h */; };
E15A36D91104572700B7B639 /* XMLNSNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E15A36D81104572700B7B639 /* XMLNSNames.cpp */; };
E15FF7D518C9553800FE4C87 /* KeypressCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = E15FF7D418C9553800FE4C87 /* KeypressCommand.h */; settings = {ATTRIBUTES = (Private, ); }; };
- E164A2E9191AC5BB0010737D /* FileMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = E164A2E7191AC5BB0010737D /* FileMac.mm */; };
+ E164A2E9191AC5BB0010737D /* FileCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = E164A2E7191AC5BB0010737D /* FileCocoa.mm */; };
E164A2ED191AE6350010737D /* BlobDataFileReferenceMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = E164A2EB191AE6350010737D /* BlobDataFileReferenceMac.mm */; };
E164FAA318315BF400DB4E61 /* CryptoKeyRSA.h in Headers */ = {isa = PBXBuildFile; fileRef = E164FAA218315BF400DB4E61 /* CryptoKeyRSA.h */; };
E164FAA518315E1A00DB4E61 /* CryptoKeyRSAMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E164FAA418315E1A00DB4E61 /* CryptoKeyRSAMac.cpp */; };
@@ -14453,7 +14453,7 @@
E15A36D61104572000B7B639 /* XMLNSNames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLNSNames.h; sourceTree = "<group>"; };
E15A36D81104572700B7B639 /* XMLNSNames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XMLNSNames.cpp; sourceTree = "<group>"; };
E15FF7D418C9553800FE4C87 /* KeypressCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeypressCommand.h; sourceTree = "<group>"; };
- E164A2E7191AC5BB0010737D /* FileMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FileMac.mm; sourceTree = "<group>"; };
+ E164A2E7191AC5BB0010737D /* FileCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FileCocoa.mm; sourceTree = "<group>"; };
E164A2EB191AE6350010737D /* BlobDataFileReferenceMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BlobDataFileReferenceMac.mm; sourceTree = "<group>"; };
E164FAA218315BF400DB4E61 /* CryptoKeyRSA.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoKeyRSA.h; sourceTree = "<group>"; };
E164FAA418315E1A00DB4E61 /* CryptoKeyRSAMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoKeyRSAMac.cpp; sourceTree = "<group>"; };
@@ -19867,6 +19867,7 @@
976D6C61122B8A3D001FD1F7 /* File.cpp */,
976D6C62122B8A3D001FD1F7 /* File.h */,
E1AB1EB714E9E35800449E13 /* File.idl */,
+ E164A2E7191AC5BB0010737D /* FileCocoa.mm */,
976D6C64122B8A3D001FD1F7 /* FileError.h */,
E1AB1EBB14E9E37A00449E13 /* FileError.idl */,
978D07B5145A0F030096908D /* FileException.cpp */,
@@ -19875,7 +19876,6 @@
976D6C66122B8A3D001FD1F7 /* FileList.cpp */,
976D6C67122B8A3D001FD1F7 /* FileList.h */,
E1AB1EA814E9E27D00449E13 /* FileList.idl */,
- E164A2E7191AC5BB0010737D /* FileMac.mm */,
976D6C69122B8A3D001FD1F7 /* FileReader.cpp */,
976D6C6A122B8A3D001FD1F7 /* FileReader.h */,
14BDF59A1365399100148393 /* FileReader.idl */,
@@ -30018,7 +30018,7 @@
1A88A90417553CD7000C74F9 /* FileIconLoader.cpp in Sources */,
F55B3DBD1251F12D003EF269 /* FileInputType.cpp in Sources */,
976D6C85122B8A3D001FD1F7 /* FileList.cpp in Sources */,
- E164A2E9191AC5BB0010737D /* FileMac.mm in Sources */,
+ E164A2E9191AC5BB0010737D /* FileCocoa.mm in Sources */,
976D6C88122B8A3D001FD1F7 /* FileReader.cpp in Sources */,
2E75841D12779ADA0062628B /* FileReaderLoader.cpp in Sources */,
2EDF369C122C94B4002F7D4E /* FileReaderSync.cpp in Sources */,
Copied: trunk/Source/WebCore/fileapi/FileCocoa.mm (from rev 213104, trunk/Source/WebCore/fileapi/FileMac.mm) (0 => 213105)
--- trunk/Source/WebCore/fileapi/FileCocoa.mm (rev 0)
+++ trunk/Source/WebCore/fileapi/FileCocoa.mm 2017-02-28 01:13:58 UTC (rev 213105)
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2014-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.
+ *
+ * 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 "File.h"
+
+#if ENABLE(FILE_REPLACEMENT)
+
+#import "FileSystem.h"
+
+#if PLATFORM(IOS)
+#import <MobileCoreServices/MobileCoreServices.h>
+#endif
+
+namespace WebCore {
+
+bool File::shouldReplaceFile(const String& path)
+{
+ if (path.isEmpty())
+ return false;
+
+ NSError *error;
+ NSURL *pathURL = [NSURL URLByResolvingAliasFileAtURL:[NSURL fileURLWithPath:path isDirectory:NO] options:NSURLBookmarkResolutionWithoutUI error:&error];
+ if (!pathURL) {
+ LOG_ERROR("Failed to resolve alias at path %s with error %@.\n", path.utf8().data(), error);
+ return false;
+ }
+
+ NSString *uti;
+ if (![pathURL getResourceValue:&uti forKey:NSURLTypeIdentifierKey error:&error]) {
+ LOG_ERROR("Failed to get type identifier of resource at URL %@ with error %@.\n", pathURL, error);
+ return false;
+ }
+
+ return UTTypeConformsTo((CFStringRef)uti, kUTTypePackage);
+}
+
+void File::computeNameAndContentTypeForReplacedFile(const String& path, const String& nameOverride, String& effectiveName, String& effectiveContentType)
+{
+ ASSERT(!pathGetFileName(path).endsWith('/')); // Expecting to get a path without trailing slash, even for directories.
+ effectiveContentType = ASCIILiteral("application/zip");
+ effectiveName = (nameOverride.isNull() ? pathGetFileName(path) : nameOverride) + ASCIILiteral(".zip");
+}
+
+}
+
+#endif // ENABLE(FILE_REPLACEMENT)
Deleted: trunk/Source/WebCore/fileapi/FileMac.mm (213104 => 213105)
--- trunk/Source/WebCore/fileapi/FileMac.mm 2017-02-28 01:10:39 UTC (rev 213104)
+++ trunk/Source/WebCore/fileapi/FileMac.mm 2017-02-28 01:13:58 UTC (rev 213105)
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2014 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.
- *
- * 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 "File.h"
-
-#if ENABLE(FILE_REPLACEMENT)
-
-#import "FileSystem.h"
-
-#if PLATFORM(IOS)
-#import <MobileCoreServices/MobileCoreServices.h>
-#endif
-
-namespace WebCore {
-
-bool File::shouldReplaceFile(const String& path)
-{
- if (path.isEmpty())
- return false;
-
- NSError *error;
- NSURL *pathURL = [NSURL URLByResolvingAliasFileAtURL:[NSURL fileURLWithPath:path isDirectory:NO] options:NSURLBookmarkResolutionWithoutUI error:&error];
- if (!pathURL) {
- LOG_ERROR("Failed to resolve alias at path %s with error %@.\n", path.utf8().data(), error);
- return false;
- }
-
- NSString *uti;
- if (![pathURL getResourceValue:&uti forKey:NSURLTypeIdentifierKey error:&error]) {
- LOG_ERROR("Failed to get type identifier of resource at URL %@ with error %@.\n", pathURL, error);
- return false;
- }
-
- return UTTypeConformsTo((CFStringRef)uti, kUTTypePackage);
-}
-
-void File::computeNameAndContentTypeForReplacedFile(const String& path, const String& nameOverride, String& effectiveName, String& effectiveContentType)
-{
- ASSERT(!pathGetFileName(path).endsWith('/')); // Expecting to get a path without trailing slash, even for directories.
- effectiveContentType = ASCIILiteral("application/zip");
- effectiveName = (nameOverride.isNull() ? pathGetFileName(path) : nameOverride) + ASCIILiteral(".zip");
-}
-
-}
-
-#endif