Title: [111127] trunk/Source/WebCore
Revision
111127
Author
[email protected]
Date
2012-03-17 15:56:02 -0700 (Sat, 17 Mar 2012)

Log Message

[BlackBerry] Implement openTemporaryFile in FileSystem
https://bugs.webkit.org/show_bug.cgi?id=81373

Reviewed by George Staikos.

Move the Efl implementation to Posix, this way BlackBerry port can reuse it.

* platform/blackberry/FileSystemBlackBerry.cpp:
* platform/efl/FileSystemEfl.cpp:
* platform/posix/FileSystemPOSIX.cpp:
(WebCore::openTemporaryFile):
(WebCore):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (111126 => 111127)


--- trunk/Source/WebCore/ChangeLog	2012-03-17 19:54:09 UTC (rev 111126)
+++ trunk/Source/WebCore/ChangeLog	2012-03-17 22:56:02 UTC (rev 111127)
@@ -1,3 +1,18 @@
+2012-03-17  Rob Buis  <[email protected]>
+
+        [BlackBerry] Implement openTemporaryFile in FileSystem
+        https://bugs.webkit.org/show_bug.cgi?id=81373
+
+        Reviewed by George Staikos.
+
+        Move the Efl implementation to Posix, this way BlackBerry port can reuse it.
+
+        * platform/blackberry/FileSystemBlackBerry.cpp:
+        * platform/efl/FileSystemEfl.cpp:
+        * platform/posix/FileSystemPOSIX.cpp:
+        (WebCore::openTemporaryFile):
+        (WebCore):
+
 2012-03-17  Joe Thomas  <[email protected]>
 
         move calc*Value functions out from Length (and platform)

Modified: trunk/Source/WebCore/platform/blackberry/FileSystemBlackBerry.cpp (111126 => 111127)


--- trunk/Source/WebCore/platform/blackberry/FileSystemBlackBerry.cpp	2012-03-17 19:54:09 UTC (rev 111126)
+++ trunk/Source/WebCore/platform/blackberry/FileSystemBlackBerry.cpp	2012-03-17 22:56:02 UTC (rev 111127)
@@ -39,9 +39,4 @@
     return false;
 }
 
-String openTemporaryFile(const String&, PlatformFileHandle&)
-{
-    return "";
-}
-
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/efl/FileSystemEfl.cpp (111126 => 111127)


--- trunk/Source/WebCore/platform/efl/FileSystemEfl.cpp	2012-03-17 19:54:09 UTC (rev 111126)
+++ trunk/Source/WebCore/platform/efl/FileSystemEfl.cpp	2012-03-17 22:56:02 UTC (rev 111127)
@@ -65,28 +65,6 @@
 #endif
 }
 
-String openTemporaryFile(const String& prefix, PlatformFileHandle& handle)
-{
-    char buffer[PATH_MAX];
-    const char* tmpDir = getenv("TMPDIR");
-
-    if (!tmpDir)
-        tmpDir = "/tmp";
-
-    if (snprintf(buffer, PATH_MAX, "%s/%sXXXXXX", tmpDir, prefix.utf8().data()) >= PATH_MAX)
-        goto end;
-
-    handle = mkstemp(buffer);
-    if (handle < 0)
-        goto end;
-
-    return String::fromUTF8(buffer);
-
-end:
-    handle = invalidPlatformFileHandle;
-    return String();
-}
-
 bool unloadModule(PlatformModule module)
 {
     // caution, closing handle will make memory vanish and any remaining

Modified: trunk/Source/WebCore/platform/posix/FileSystemPOSIX.cpp (111126 => 111127)


--- trunk/Source/WebCore/platform/posix/FileSystemPOSIX.cpp	2012-03-17 19:54:09 UTC (rev 111126)
+++ trunk/Source/WebCore/platform/posix/FileSystemPOSIX.cpp	2012-03-17 22:56:02 UTC (rev 111127)
@@ -35,6 +35,7 @@
 #include <fcntl.h>
 #include <fnmatch.h>
 #include <libgen.h>
+#include <stdio.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <unistd.h>
@@ -255,4 +256,28 @@
 }
 #endif
 
+#if !PLATFORM(MAC)
+String openTemporaryFile(const String& prefix, PlatformFileHandle& handle)
+{
+    char buffer[PATH_MAX];
+    const char* tmpDir = getenv("TMPDIR");
+
+    if (!tmpDir)
+        tmpDir = "/tmp";
+
+    if (snprintf(buffer, PATH_MAX, "%s/%sXXXXXX", tmpDir, prefix.utf8().data()) >= PATH_MAX)
+        goto end;
+
+    handle = mkstemp(buffer);
+    if (handle < 0)
+        goto end;
+
+    return String::fromUTF8(buffer);
+
+end:
+    handle = invalidPlatformFileHandle;
+    return String();
+}
+#endif
+
 } // namespace WebCore
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to