Title: [150222] trunk/Source/WebCore
Revision
150222
Author
par...@webkit.org
Date
2013-05-16 17:19:34 -0700 (Thu, 16 May 2013)

Log Message

Remove unused function safeCreateFile() from WebCore
https://bugs.webkit.org/show_bug.cgi?id=116211

Reviewed by Anders Carlsson.

* platform/FileSystem.h:
* platform/win/FileSystemWin.cpp:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (150221 => 150222)


--- trunk/Source/WebCore/ChangeLog	2013-05-17 00:17:46 UTC (rev 150221)
+++ trunk/Source/WebCore/ChangeLog	2013-05-17 00:19:34 UTC (rev 150222)
@@ -1,3 +1,13 @@
+2013-05-16  Patrick Gansterer  <par...@webkit.org>
+
+        Remove unused function safeCreateFile() from WebCore
+        https://bugs.webkit.org/show_bug.cgi?id=116211
+
+        Reviewed by Anders Carlsson.
+
+        * platform/FileSystem.h:
+        * platform/win/FileSystemWin.cpp:
+
 2013-05-16  Peter Gal  <galpe...@inf.u-szeged.hu>
 
         [curl] MIME type should be in lowercase

Modified: trunk/Source/WebCore/platform/FileSystem.h (150221 => 150222)


--- trunk/Source/WebCore/platform/FileSystem.h	2013-05-17 00:17:46 UTC (rev 150221)
+++ trunk/Source/WebCore/platform/FileSystem.h	2013-05-17 00:19:34 UTC (rev 150222)
@@ -227,10 +227,6 @@
 String roamingUserSpecificStorageDirectory();
 #endif
 
-#if PLATFORM(WIN) && USE(CF)
-bool safeCreateFile(const String&, CFDataRef);
-#endif
-
 } // namespace WebCore
 
 #endif // FileSystem_h

Modified: trunk/Source/WebCore/platform/win/FileSystemWin.cpp (150221 => 150222)


--- trunk/Source/WebCore/platform/win/FileSystemWin.cpp	2013-05-17 00:17:46 UTC (rev 150221)
+++ trunk/Source/WebCore/platform/win/FileSystemWin.cpp	2013-05-17 00:19:34 UTC (rev 150222)
@@ -367,40 +367,6 @@
     return cachedStorageDirectory(CSIDL_APPDATA);
 }
 
-#if USE(CF)
-
-bool safeCreateFile(const String& path, CFDataRef data)
-{
-    // Create a temporary file.
-    WCHAR tempDirPath[MAX_PATH];
-    if (!GetTempPathW(WTF_ARRAY_LENGTH(tempDirPath), tempDirPath))
-        return false;
-
-    WCHAR tempPath[MAX_PATH];
-    if (!GetTempFileNameW(tempDirPath, L"WEBKIT", 0, tempPath))
-        return false;
-
-    HANDLE tempFileHandle = CreateFileW(tempPath, GENERIC_READ | GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
-    if (tempFileHandle == INVALID_HANDLE_VALUE)
-        return false;
-
-    // Write the data to this temp file.
-    DWORD written;
-    if (!WriteFile(tempFileHandle, CFDataGetBytePtr(data), static_cast<DWORD>(CFDataGetLength(data)), &written, 0))
-        return false;
-
-    CloseHandle(tempFileHandle);
-
-    // Copy the temp file to the destination file.
-    String destination = path;
-    if (!MoveFileExW(tempPath, destination.charactersWithNullTermination(), MOVEFILE_REPLACE_EXISTING | MOVEFILE_COPY_ALLOWED))
-        return false;
-
-    return true;
-}
-
-#endif // USE(CF)
-
 Vector<String> listDirectory(const String& directory, const String& filter)
 {
     Vector<String> entries;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to