[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

levin at chromium.org levin at chromium.org
Wed Apr 7 23:26:04 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 9932b1aabfae8d9a88b9e0a15ccabcd6ecc14968
Author: levin at chromium.org <levin at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Nov 9 02:33:04 2009 +0000

    JavaScriptCore: Hopefully, the last build fix.
    
    Reviewed by NOBODY (chromium build fix).
    
    Create better separation in DateMath about the JSC
    and non-JSC portions. Also, only expose the non-JSC
    version in the exports.
    
    * JavaScriptCore.exp:
    * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
    * wtf/DateMath.cpp:
    (WTF::parseDateFromNullTerminatedCharacters):
    (JSC::getUTCOffset):
    (JSC::gregorianDateTimeToMS):
    (JSC::msToGregorianDateTime):
    (JSC::parseDateFromNullTerminatedCharacters):
    * wtf/DateMath.h:
    (JSC::gmtoffset):
    
    JavaScriptGlue: Added the use jsc define for files that use
    this config file and DateMath.h. This should
    be able to go away when DateMath is properly
    split into wtf and jsc portions which is this bug:
    https://bugs.webkit.org/show_bug.cgi?id=31246
    
    Reviewed by NOBODY (chromium build fix).
    
    * config.h:
    
    WebCore: * platform/network/HTTPParsers.cpp:
    (WebCore::parseDate): Changed this to not
    use a date parser that needs ExecState passed.
    
    Reviewed by NOBODY (chromium build fix).
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50633 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 03163ab..cb3d4a1 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,6 +1,27 @@
 2009-11-08  David Levin  <levin at chromium.org>
 
         Reviewed by NOBODY (chromium build fix).
+        
+        Hopefully, the last build fix.
+
+        Create better separation in DateMath about the JSC
+        and non-JSC portions. Also, only expose the non-JSC
+        version in the exports.
+
+        * JavaScriptCore.exp:
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+        * wtf/DateMath.cpp:
+        (WTF::parseDateFromNullTerminatedCharacters):
+        (JSC::getUTCOffset):
+        (JSC::gregorianDateTimeToMS):
+        (JSC::msToGregorianDateTime):
+        (JSC::parseDateFromNullTerminatedCharacters):
+        * wtf/DateMath.h:
+        (JSC::gmtoffset):
+
+2009-11-08  David Levin  <levin at chromium.org>
+
+        Reviewed by NOBODY (chromium build fix).
 
         For the change in DateMath.
 
diff --git a/JavaScriptCore/JavaScriptCore.exp b/JavaScriptCore/JavaScriptCore.exp
index b0fada1..b36d261 100644
--- a/JavaScriptCore/JavaScriptCore.exp
+++ b/JavaScriptCore/JavaScriptCore.exp
@@ -178,7 +178,6 @@ __ZN3JSC23setUpStaticFunctionSlotEPNS_9ExecStateEPKNS_9HashEntryEPNS_8JSObjectER
 __ZN3JSC24createStackOverflowErrorEPNS_9ExecStateE
 __ZN3JSC25evaluateInGlobalCallFrameERKNS_7UStringERNS_7JSValueEPNS_14JSGlobalObjectE
 __ZN3JSC35createInterruptedExecutionExceptionEPNS_12JSGlobalDataE
-__ZN3JSC37parseDateFromNullTerminatedCharactersEPKcPNS_9ExecStateE
 __ZN3JSC3NaNE
 __ZN3JSC4Heap11objectCountEv
 __ZN3JSC4Heap14primaryHeapEndEv
@@ -332,6 +331,7 @@ __ZN3WTF23waitForThreadCompletionEjPPv
 __ZN3WTF27releaseFastMallocFreeMemoryEv
 __ZN3WTF28setMainThreadCallbacksPausedEb
 __ZN3WTF36lockAtomicallyInitializedStaticMutexEv
+__ZN3WTF37parseDateFromNullTerminatedCharactersEPKc
 __ZN3WTF38unlockAtomicallyInitializedStaticMutexEv
 __ZN3WTF5Mutex4lockEv
 __ZN3WTF5Mutex6unlockEv
diff --git a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
index 4f1ed24..192ced6 100644
--- a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
+++ b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
@@ -203,7 +203,7 @@ EXPORTS
     ?objectCount at Heap@JSC@@QAEIXZ
     ?objectProtoFuncToString at JSC@@YI?AVJSValue at 1@PAVExecState at 1@PAVJSObject at 1@V21 at ABVArgList@1@@Z
     ?parse at Parser@JSC@@AAEXPAVJSGlobalData at 2@PAHPAVUString at 2@@Z
-    ?parseDateFromNullTerminatedCharacters at JSC@@YANPBDPAVExecState at 1@@Z
+    ?parseDateFromNullTerminatedCharacters at WTF@@YANPBD at Z
     ?primaryHeapBegin at Heap@JSC@@QAE?AV?$CollectorHeapIterator@$0A@@2 at XZ
     ?primaryHeapEnd at Heap@JSC@@QAE?AV?$CollectorHeapIterator@$0A@@2 at XZ
     ?profiler at Profiler@JSC@@SAPAV12 at XZ
diff --git a/JavaScriptCore/wtf/DateMath.cpp b/JavaScriptCore/wtf/DateMath.cpp
index 46bc152..354de25 100644
--- a/JavaScriptCore/wtf/DateMath.cpp
+++ b/JavaScriptCore/wtf/DateMath.cpp
@@ -82,7 +82,7 @@ extern "C" struct tm * localtime(const time_t *timer);
 
 using namespace WTF;
 
-namespace JSC {
+namespace WTF {
 
 /* Constants */
 
@@ -379,21 +379,6 @@ static int32_t calculateUTCOffset()
     return static_cast<int32_t>(utcOffset * 1000);
 }
 
-#if USE(JSC)
-/*
- * Get the difference in milliseconds between this time zone and UTC (GMT)
- * NOT including DST.
- */
-double getUTCOffset(ExecState* exec)
-{
-    double utcOffset = exec->globalData().cachedUTCOffset;
-    if (!isnan(utcOffset))
-        return utcOffset;
-    exec->globalData().cachedUTCOffset = calculateUTCOffset();
-    return exec->globalData().cachedUTCOffset;
-}
-#endif
-
 /*
  * Get the DST offset for the time passed in.  Takes
  * seconds (not milliseconds) and cannot handle dates before 1970
@@ -449,46 +434,6 @@ static double getDSTOffset(double ms, double utcOffset)
     return getDSTOffsetSimple(ms / msPerSecond, utcOffset);
 }
 
-double gregorianDateTimeToMS(ExecState* exec, const GregorianDateTime& t, double milliSeconds, bool inputIsUTC)
-{
-    int day = dateToDayInYear(t.year + 1900, t.month, t.monthDay);
-    double ms = timeToMS(t.hour, t.minute, t.second, milliSeconds);
-    double result = (day * msPerDay) + ms;
-
-    if (!inputIsUTC) { // convert to UTC
-        double utcOffset = getUTCOffset(exec);
-        result -= utcOffset;
-        result -= getDSTOffset(result, utcOffset);
-    }
-
-    return result;
-}
-
-// input is UTC
-void msToGregorianDateTime(ExecState* exec, double ms, bool outputIsUTC, GregorianDateTime& tm)
-{
-    double dstOff = 0.0;
-    double utcOff = 0.0;
-    if (!outputIsUTC) {
-        utcOff = getUTCOffset(exec);
-        dstOff = getDSTOffset(ms, utcOff);
-        ms += dstOff + utcOff;
-    }
-
-    const int year = msToYear(ms);
-    tm.second   =  msToSeconds(ms);
-    tm.minute   =  msToMinutes(ms);
-    tm.hour     =  msToHours(ms);
-    tm.weekDay  =  msToWeekDay(ms);
-    tm.yearDay  =  dayInYear(ms, year);
-    tm.monthDay =  dayInMonthFromDayInYear(tm.yearDay, isLeapYear(year));
-    tm.month    =  monthFromDayInYear(tm.yearDay, isLeapYear(year));
-    tm.year     =  year - 1900;
-    tm.isDST    =  dstOff != 0.0;
-    tm.utcOffset = static_cast<long>((dstOff + utcOff) / msPerSecond);
-    tm.timeZone = NULL;
-}
-
 void initializeDates()
 {
 #ifndef NDEBUG
@@ -578,8 +523,11 @@ static bool parseLong(const char* string, char** stopPosition, int base, long* r
 }
 
 // Odd case where 'exec' is allowed to be 0, to accomodate a caller in WebCore.
-double parseDateFromNullTerminatedCharacters(const char* dateString, ExecState* exec)
+double parseDateFromNullTerminatedCharacters(const char* dateString, bool& haveTZ, int& offset)
 {
+    haveTZ = false;
+    offset = 0;
+
     // This parses a date in the form:
     //     Tuesday, 09-Nov-99 23:12:40 GMT
     // or
@@ -780,9 +728,6 @@ double parseDateFromNullTerminatedCharacters(const char* dateString, ExecState*
         }
     }
 
-    bool haveTZ = false;
-    int offset = 0;
-
     // Don't fail if the time zone is missing. 
     // Some websites omit the time zone (4275206).
     if (*dateString) {
@@ -846,20 +791,20 @@ double parseDateFromNullTerminatedCharacters(const char* dateString, ExecState*
             year += 1900;
     }
     
-    double ms = ymdhmsToSeconds(year, month + 1, day, hour, minute, second) * msPerSecond;
+    return ymdhmsToSeconds(year, month + 1, day, hour, minute, second) * msPerSecond;
+}
+
+double parseDateFromNullTerminatedCharacters(const char* dateString)
+{
+    bool haveTZ;
+    int offset;
+    double ms = parseDateFromNullTerminatedCharacters(dateString, haveTZ, offset);
     // fall back to local timezone
     if (!haveTZ) {
-        if (exec) {
-            double utcOffset = getUTCOffset(exec);
-            double dstOffset = getDSTOffset(ms, utcOffset);
-            offset = static_cast<int>((utcOffset + dstOffset) / msPerMinute);
-        } else {
-            double utcOffset = calculateUTCOffset();
-            double dstOffset = getDSTOffset(ms, utcOffset);
-            offset = static_cast<int>((utcOffset + dstOffset) / msPerMinute);
-        }
+        double utcOffset = calculateUTCOffset();
+        double dstOffset = getDSTOffset(ms, utcOffset);
+        offset = static_cast<int>((utcOffset + dstOffset) / msPerMinute);
     }
-
     return ms - (offset * msPerMinute);
 }
 
@@ -871,6 +816,77 @@ double timeClip(double t)
         return NaN;
     return trunc(t);
 }
+} // namespace WTF
+
+#if USE(JSC)
+namespace JSC {
+/*
+ * Get the difference in milliseconds between this time zone and UTC (GMT)
+ * NOT including DST.
+ */
+double getUTCOffset(ExecState* exec)
+{
+    double utcOffset = exec->globalData().cachedUTCOffset;
+    if (!isnan(utcOffset))
+        return utcOffset;
+    exec->globalData().cachedUTCOffset = calculateUTCOffset();
+    return exec->globalData().cachedUTCOffset;
+}
+
+double gregorianDateTimeToMS(ExecState* exec, const GregorianDateTime& t, double milliSeconds, bool inputIsUTC)
+{
+    int day = dateToDayInYear(t.year + 1900, t.month, t.monthDay);
+    double ms = timeToMS(t.hour, t.minute, t.second, milliSeconds);
+    double result = (day * msPerDay) + ms;
+
+    if (!inputIsUTC) { // convert to UTC
+        double utcOffset = getUTCOffset(exec);
+        result -= utcOffset;
+        result -= getDSTOffset(result, utcOffset);
+    }
+
+    return result;
+}
+
+// input is UTC
+void msToGregorianDateTime(ExecState* exec, double ms, bool outputIsUTC, GregorianDateTime& tm)
+{
+    double dstOff = 0.0;
+    double utcOff = 0.0;
+    if (!outputIsUTC) {
+        utcOff = getUTCOffset(exec);
+        dstOff = getDSTOffset(ms, utcOff);
+        ms += dstOff + utcOff;
+    }
+
+    const int year = msToYear(ms);
+    tm.second   =  msToSeconds(ms);
+    tm.minute   =  msToMinutes(ms);
+    tm.hour     =  msToHours(ms);
+    tm.weekDay  =  msToWeekDay(ms);
+    tm.yearDay  =  dayInYear(ms, year);
+    tm.monthDay =  dayInMonthFromDayInYear(tm.yearDay, isLeapYear(year));
+    tm.month    =  monthFromDayInYear(tm.yearDay, isLeapYear(year));
+    tm.year     =  year - 1900;
+    tm.isDST    =  dstOff != 0.0;
+    tm.utcOffset = static_cast<long>((dstOff + utcOff) / msPerSecond);
+    tm.timeZone = NULL;
+}
 
+double parseDateFromNullTerminatedCharacters(const char* dateString, ExecState* exec)
+{
+    ASSERT(exec);
+    bool haveTZ;
+    int offset;
+    double ms = WTF::parseDateFromNullTerminatedCharacters(dateString, haveTZ, offset);
+    // fall back to local timezone
+    if (!haveTZ) {
+        double utcOffset = getUTCOffset(exec);
+        double dstOffset = getDSTOffset(ms, utcOffset);
+        offset = static_cast<int>((utcOffset + dstOffset) / msPerMinute);
+    }
+    return ms - (offset * msPerMinute);
+}
 
 } // namespace JSC
+#endif // USE(JSC)
diff --git a/JavaScriptCore/wtf/DateMath.h b/JavaScriptCore/wtf/DateMath.h
index 4735968..485ca9f 100644
--- a/JavaScriptCore/wtf/DateMath.h
+++ b/JavaScriptCore/wtf/DateMath.h
@@ -49,19 +49,12 @@
 #include <wtf/Noncopyable.h>
 #include <wtf/UnusedParam.h>
 
-namespace JSC {
-
-class ExecState;
-struct GregorianDateTime;
-
+namespace WTF {
 void initializeDates();
-void msToGregorianDateTime(ExecState*, double, bool outputIsUTC, GregorianDateTime&);
-double gregorianDateTimeToMS(ExecState*, const GregorianDateTime&, double, bool inputIsUTC);
-double getUTCOffset(ExecState*);
 int equivalentYearForDST(int year);
 
 // Not really math related, but this is currently the only shared place to put these.  
-double parseDateFromNullTerminatedCharacters(const char* dateString, ExecState* exec); // exec may be 0
+double parseDateFromNullTerminatedCharacters(const char* dateString);
 double timeClip(double);
 
 inline double jsCurrentTime()
@@ -82,8 +75,20 @@ const double msPerMinute = 60.0 * 1000.0;
 const double msPerHour = 60.0 * 60.0 * 1000.0;
 const double msPerDay = 24.0 * 60.0 * 60.0 * 1000.0;
 
-// Intentionally overridding the default tm of the system
-// Tee members of tm differ on various operating systems.
+} // namespace WTF
+
+#if USE(JSC)
+namespace JSC {
+class ExecState;
+struct GregorianDateTime;
+
+void msToGregorianDateTime(ExecState*, double, bool outputIsUTC, GregorianDateTime&);
+double gregorianDateTimeToMS(ExecState*, const GregorianDateTime&, double, bool inputIsUTC);
+double getUTCOffset(ExecState*);
+double parseDateFromNullTerminatedCharacters(const char* dateString, ExecState*);
+
+// Intentionally overridding the default tm of the system.
+// The members of tm differ on various operating systems.
 struct GregorianDateTime : Noncopyable {
     GregorianDateTime()
         : second(0)
@@ -194,7 +199,7 @@ static inline int gmtoffset(const GregorianDateTime& t)
 {
     return t.utcOffset;
 }
-
 } // namespace JSC
+#endif // USE(JSC)
 
 #endif // DateMath_h
diff --git a/JavaScriptGlue/ChangeLog b/JavaScriptGlue/ChangeLog
index 0a39e59..04759ab 100644
--- a/JavaScriptGlue/ChangeLog
+++ b/JavaScriptGlue/ChangeLog
@@ -1,3 +1,15 @@
+2009-11-08  David Levin  <levin at chromium.org>
+
+        Reviewed by NOBODY (chromium build fix).
+
+        Added the use jsc define for files that use
+        this config file and DateMath.h. This should
+        be able to go away when DateMath is properly
+        split into wtf and jsc portions which is this bug:
+        https://bugs.webkit.org/show_bug.cgi?id=31246
+
+        * config.h:
+
 2009-11-06  Geoffrey Garen  <ggaren at apple.com>
 
         Reviewed by Oliver Hunt.
diff --git a/JavaScriptGlue/config.h b/JavaScriptGlue/config.h
index fdbd4ae..88bbb9a 100644
--- a/JavaScriptGlue/config.h
+++ b/JavaScriptGlue/config.h
@@ -4,4 +4,17 @@
 
 #include <wtf/Platform.h>
 
+#if PLATFORM(CHROMIUM)
+#if !defined(WTF_USE_V8)
+#define WTF_USE_V8 1
+#endif
+#endif /* PLATFORM(CHROMIUM) */
+
+#if !defined(WTF_USE_V8)
+#define WTF_USE_V8 0
+#endif /* !defined(WTF_USE_V8) */
+
+/* Using V8 implies not using JSC and vice versa */
+#define WTF_USE_JSC !WTF_USE_V8
+
 #define JS_EXPORTDATA
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 622126e..9e5550f 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -59,6 +59,14 @@
 
 2009-11-08  David Levin  <levin at chromium.org>
 
+        Reviewed by NOBODY (chromium build fix).
+
+        * platform/network/HTTPParsers.cpp:
+        (WebCore::parseDate): Changed this to not
+        use a date parser that needs ExecState passed.
+        
+2009-11-08  David Levin  <levin at chromium.org>
+
         Unreviewed build fix for chromium.
 
         * platform/graphics/skia/GraphicsContextSkia.cpp:
diff --git a/WebCore/platform/network/HTTPParsers.cpp b/WebCore/platform/network/HTTPParsers.cpp
index ea7d17e..9202660 100644
--- a/WebCore/platform/network/HTTPParsers.cpp
+++ b/WebCore/platform/network/HTTPParsers.cpp
@@ -35,7 +35,6 @@
 #include "PlatformString.h"
 #include <wtf/DateMath.h>
 
-using namespace JSC;
 using namespace WTF;
 
 namespace WebCore {
@@ -117,7 +116,7 @@ bool parseHTTPRefresh(const String& refresh, bool fromHttpEquivMeta, double& del
 
 double parseDate(const String& value)
 {
-    return parseDateFromNullTerminatedCharacters(value.utf8().data(), 0);
+    return parseDateFromNullTerminatedCharacters(value.utf8().data());
 }
 
 String filenameFromHTTPContentDisposition(const String& value)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list