Reviewed by Adam
authorbeidson <beidson@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Aug 2006 22:57:07 +0000 (22:57 +0000)
committerbeidson <beidson@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Aug 2006 22:57:07 +0000 (22:57 +0000)
        Changed some time()-related code to be more platform independent

        * loader/icon/IconDatabase.cpp:
        (WebCore::IconDatabase::isIconExpiredForIconURL):
        (WebCore::IconDatabase::getOrCreateIconDataCache):
        (WebCore::IconDatabase::setIconDataForIconURL):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16043 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/loader/icon/IconDatabase.cpp

index ce5ff7799a79ed35d0b737a46c85e24d4cb5ed3c..e94a15704162fe2bbbf1d502c72f3b02da1a9b06 100644 (file)
@@ -1,3 +1,14 @@
+2006-08-25  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Adam
+
+        Changed some time()-related code to be more platform independent
+
+        * loader/icon/IconDatabase.cpp:
+        (WebCore::IconDatabase::isIconExpiredForIconURL):
+        (WebCore::IconDatabase::getOrCreateIconDataCache):
+        (WebCore::IconDatabase::setIconDataForIconURL):
+
 2006-08-25  David Harrison  <harrison@apple.com>
 
         Reviewed by Geoff.
index f46b836e67881990b10cf72b34d1efa3ebbfd483..6e715b76ceb00231d2d19cafe62abc1f33d902be 100644 (file)
@@ -292,19 +292,19 @@ bool IconDatabase::isIconExpiredForIconURL(const String& iconURL)
     // If we have a IconDataCache, then it definitely has the Timestamp in it
     IconDataCache* icon = m_iconURLToIconDataCacheMap.get(iconURL);
     if (icon) 
-        return time(NULL) - icon->getTimestamp() > iconExpirationTime;
+        return (int)currentTime() - icon->getTimestamp() > iconExpirationTime;
             
     // Otherwise, we'll get the timestamp from the DB and use it
     int stamp;
     if (m_privateBrowsingEnabled) {
         stamp = timeStampForIconURLQuery(m_privateBrowsingDB, iconURL);
         if (stamp)
-            return (time(NULL) - stamp) > iconExpirationTime;
+            return ((int)currentTime() - stamp) > iconExpirationTime;
     }
     
     stamp = timeStampForIconURLQuery(m_mainDB, iconURL);
     if (stamp)
-        return (time(NULL) - stamp) > iconExpirationTime;
+        return ((int)currentTime() - stamp) > iconExpirationTime;
     
     return false;
 }
@@ -533,7 +533,7 @@ IconDataCache* IconDatabase::getOrCreateIconDataCache(const String& iconURL)
         
     // If we can't get a timestamp for this URL, then it is a new icon and we initialize its timestamp now
     if (!timestamp) {
-        icon->setTimestamp(time(NULL));
+        icon->setTimestamp((int)currentTime());
         m_iconDataCachesPendingUpdate.add(icon);
     } else 
         icon->setTimestamp(timestamp);
@@ -559,7 +559,7 @@ void IconDatabase::setIconDataForIconURL(const void* data, int size, const Strin
     icon->setImageData((unsigned char*)data, size);
     
     // Update the timestamp in the IconDataCache to NOW
-    icon->setTimestamp(time(NULL));
+    icon->setTimestamp((int)currentTime());
 
     // Mark the IconDataCache as requiring an update to the database
     m_iconDataCachesPendingUpdate.add(icon);