2006-11-01 Anders Carlsson <acarlsson@apple.com>
authorandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Nov 2006 19:43:21 +0000 (19:43 +0000)
committerandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Nov 2006 19:43:21 +0000 (19:43 +0000)
        Reviewed by Oliver, Brady.

        * platform/network/ResourceResponse.h:
        (WebCore::ResourceResponse::setLastModifiedDate):
        (WebCore::ResourceResponse::lastModifiedDate):
        Add getters and setters for last modified dadte.

        * platform/network/cf/ResourceResponseCFNet.cpp:
        (WebCore::getResourceResponse):
        Fetch the last modified date. Add correct offset to expired date.

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

WebCore/ChangeLog
WebCore/platform/network/ResourceResponse.h
WebCore/platform/network/cf/ResourceResponseCFNet.cpp

index 8a426a903bd0c0c4889f6d24a34cafe51f865d4f..d6d74de5e4999e4489b65757a34bdff2a318b281 100644 (file)
@@ -1,3 +1,16 @@
+2006-11-01  Anders Carlsson  <acarlsson@apple.com>
+
+        Reviewed by Oliver, Brady.
+
+        * platform/network/ResourceResponse.h:
+        (WebCore::ResourceResponse::setLastModifiedDate):
+        (WebCore::ResourceResponse::lastModifiedDate):
+        Add getters and setters for last modified dadte.
+        
+        * platform/network/cf/ResourceResponseCFNet.cpp:
+        (WebCore::getResourceResponse):
+        Fetch the last modified date. Add correct offset to expired date.
+
 2006-11-01  David Kilzer  <ddkilzer@kilzer.net>
 
         Reviewed by Mitz.
index d9993f7320154e6c9892ebf4f8d814bf528399a0..693126952c27140dad9299ee95650f2848578e86 100644 (file)
@@ -71,6 +71,9 @@ public:
     void setExpirationDate(time_t expirationDate) { m_expirationDate = expirationDate; }
     time_t expirationDate() const { return m_expirationDate; }
 
+    void setLastModifiedDate(time_t lastModifiedDate) { m_lastModifiedDate = lastModifiedDate; }
+    time_t lastModifiedDate() const { return m_lastModifiedDate; }
+
  private:
     KURL m_url;
     String m_mimeType;
@@ -81,6 +84,7 @@ public:
     String m_httpStatusText;
     HTTPHeaderMap m_httpHeaderFields;
     time_t m_expirationDate;
+    time_t m_lastModifiedDate;
 };
 
 } // namespace WebCore
index 080834e6abce1925100bc614aeed7e54c7e7703e..06a36f3fb80c632d24804c8515e39671107ee8f5 100644 (file)
@@ -45,7 +45,10 @@ namespace WebCore {
        response = ResourceResponse(CFURLResponseGetURL(cfResponse), CFURLResponseGetMIMEType(cfResponse), CFURLResponseGetExpectedContentLength(cfResponse), CFURLResponseGetTextEncodingName(cfResponse), /* suggestedFilename */ "");
 
        CFAbsoluteTime expiration = CFURLResponseGetExpirationTime(cfResponse);
-       response.setExpirationDate(expiration > MAX_TIME_T ? MAX_TIME_T : (time_t)expiration);
+       response.setExpirationDate(expiration + kCFAbsoluteTimeIntervalSince1970 > MAX_TIME_T ? MAX_TIME_T : (time_t)expiration);
+
+       CFAbsoluteTime lastModified = CFURLResponseGetLastModifiedDate(cfResponse);
+       response.setLastModifiedDate(expiration + kCFAbsoluteTimeIntervalSince1970 > MAX_TIME_T ? MAX_TIME_T : (time_t)lastModified);
 
        CFHTTPMessageRef httpResponse = CFURLResponseGetHTTPResponse(cfResponse);
        if (httpResponse) {