[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9

eric at webkit.org eric at webkit.org
Thu Feb 4 21:37:16 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 9d561c5e61d94b407bb3afca3e840a05c8301d4d
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Feb 2 22:50:41 2010 +0000

    2010-02-02  Kwang Yul Seo  <skyul at company100.net>
    
            Reviewed by Eric Seidel.
    
            Use WTF::getLocalTime instead of localtime_r in FTPDirectoryDocument
            https://bugs.webkit.org/show_bug.cgi?id=34409
    
            Platform guards for localtime_r are not needed because we already have
            WTF::getLocalTime which does the same thing.
    
            * loader/FTPDirectoryDocument.cpp:
            (WebCore::processFileDateString):
            * loader/FTPDirectoryParser.cpp:
            (WebCore::gmtimeQt):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54256 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 71de6f7..92e6fc3 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2010-02-02  Kwang Yul Seo  <skyul at company100.net>
+
+        Reviewed by Eric Seidel.
+
+        Use WTF::getLocalTime instead of localtime_r in FTPDirectoryDocument
+        https://bugs.webkit.org/show_bug.cgi?id=34409
+
+        Platform guards for localtime_r are not needed because we already have
+        WTF::getLocalTime which does the same thing.
+
+        * loader/FTPDirectoryDocument.cpp:
+        (WebCore::processFileDateString):
+        * loader/FTPDirectoryParser.cpp:
+        (WebCore::gmtimeQt):
+
 2010-02-02  Adam Roben  <aroben at apple.com>
 
         Copy WebCore's bindings generation scripts to the PrivateHeaders
diff --git a/WebCore/loader/FTPDirectoryDocument.cpp b/WebCore/loader/FTPDirectoryDocument.cpp
index 7a71d02..62173f5 100644
--- a/WebCore/loader/FTPDirectoryDocument.cpp
+++ b/WebCore/loader/FTPDirectoryDocument.cpp
@@ -38,14 +38,9 @@
 #include "Settings.h"
 #include "SharedBuffer.h"
 #include "Text.h"
-#include <wtf/StdLibExtras.h>
 
-#if PLATFORM(QT)
-#include <QDateTime>
-// On Windows, use the threadsafe *_r functions provided by pthread.
-#elif OS(WINDOWS) && (USE(PTHREADS) || HAVE(PTHREAD_H))
-#include <pthread.h>
-#endif
+#include <wtf/CurrentTime.h>
+#include <wtf/StdLibExtras.h>
 
 using namespace std;
 
@@ -200,48 +195,6 @@ static bool wasLastDayOfMonth(int year, int month, int day)
     return lastDays[month] == day;
 }
 
-#if PLATFORM(QT)
-
-/*!
- Replacement for localtime_r() which is not available on MinGW.
-
- We use this on all of Qt's platforms for portability.
- */
-struct tm gmtimeQt(const QDateTime &input)
-{
-    tm result;
-
-    const QDate date(input.date());
-    result.tm_year = date.year() - 1900;
-    result.tm_mon = date.month();
-    result.tm_mday = date.day();
-    result.tm_wday = date.dayOfWeek();
-    result.tm_yday = date.dayOfYear();
-
-    const QTime time(input.time());
-    result.tm_sec = time.second();
-    result.tm_min = time.minute();
-    result.tm_hour = time.hour();
-
-    return result;
-}
-
-static struct tm *localTimeQt(const time_t *const timep, struct tm *result)
-{
-    const QDateTime dt(QDateTime::fromTime_t(*timep));
-    *result = WebCore::gmtimeQt(dt.toLocalTime());
-    return result;
-}
-
-#define localtime_r(x, y) localTimeQt(x, y)
-#elif OS(WINDOWS) && !defined(localtime_r)
-#if defined(_MSC_VER) && (_MSC_VER >= 1400) 
-#define localtime_r(x, y) localtime_s((y), (x))
-#else /* !_MSC_VER */ 
-#define localtime_r(x,y) (localtime(x)?(*(y)=*localtime(x),(y)):0)
-#endif
-#endif
-
 static String processFileDateString(const FTPTime& fileTime)
 {
     // FIXME: Need to localize this string?
@@ -267,7 +220,7 @@ static String processFileDateString(const FTPTime& fileTime)
     // If it was today or yesterday, lets just do that - but we have to compare to the current time
     struct tm now;
     time_t now_t = time(NULL);
-    localtime_r(&now_t, &now);
+    getLocalTime(&now_t, &now);
     
     // localtime does "year = current year - 1900", compensate for that for readability and comparison purposes
     now.tm_year += 1900;
diff --git a/WebCore/loader/FTPDirectoryParser.cpp b/WebCore/loader/FTPDirectoryParser.cpp
index 34c19a4..142f2a3 100644
--- a/WebCore/loader/FTPDirectoryParser.cpp
+++ b/WebCore/loader/FTPDirectoryParser.cpp
@@ -38,8 +38,27 @@ using namespace WTF;
 
 namespace WebCore {
 #if PLATFORM(QT) && defined(Q_WS_WIN32)
-// Defined in FTPDirectoryDocument.cpp.
-struct tm gmtimeQt(const QDateTime &input);
+
+// Replacement for gmtime_r() which is not available on MinGW.
+// We use this on Win32 Qt platform for portability.
+struct tm gmtimeQt(const QDateTime& input)
+{
+    tm result;
+
+    QDate date(input.date());
+    result.tm_year = date.year() - 1900;
+    result.tm_mon = date.month();
+    result.tm_mday = date.day();
+    result.tm_wday = date.dayOfWeek();
+    result.tm_yday = date.dayOfYear();
+
+    QTime time(input.time());
+    result.tm_sec = time.second();
+    result.tm_min = time.minute();
+    result.tm_hour = time.hour();
+
+    return result;
+}
 
 static struct tm *gmtimeQt(const time_t *const timep, struct tm *result)
 {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list