2008-05-12 Anders Carlsson <andersca@apple.com>
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 May 2008 22:11:01 +0000 (22:11 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 May 2008 22:11:01 +0000 (22:11 +0000)
        Reviewed by Adam.

        Add user agent to requests when loading/updating the cache.

        * loader/FrameLoader.h:
        * loader/appcache/ApplicationCacheGroup.cpp:
        (WebCore::ApplicationCacheGroup::update):
        (WebCore::ApplicationCacheGroup::startLoadingEntry):

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

WebCore/ChangeLog
WebCore/loader/FrameLoader.h
WebCore/loader/appcache/ApplicationCacheGroup.cpp

index dffe5ec..c7d24e0 100644 (file)
@@ -2,6 +2,17 @@
 
         Reviewed by Adam.
 
+        Add user agent to requests when loading/updating the cache.
+    
+        * loader/FrameLoader.h:
+        * loader/appcache/ApplicationCacheGroup.cpp:
+        (WebCore::ApplicationCacheGroup::update):
+        (WebCore::ApplicationCacheGroup::startLoadingEntry):
+
+2008-05-12  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Adam.
+
         Make it possible to perform synchronous loads from the application cache.
         
         * loader/DocumentLoader.cpp:
index 534be08..72cf890 100644 (file)
@@ -442,6 +442,8 @@ namespace WebCore {
 
         void startIconLoader();
 
+        void applyUserAgent(ResourceRequest& request);
+
     private:
         PassRefPtr<HistoryItem> createHistoryItem(bool useOriginal);
         PassRefPtr<HistoryItem> createHistoryItemTree(Frame* targetFrame, bool clipAtTarget);
@@ -538,8 +540,6 @@ namespace WebCore {
         bool shouldReloadToHandleUnreachableURL(DocumentLoader*);
         void handleUnimplementablePolicy(const ResourceError&);
 
-        void applyUserAgent(ResourceRequest& request);
-
         void scheduleRedirection(ScheduledRedirection*);
         void startRedirectionTimer();
         void stopRedirectionTimer();
index 7f24f0b..4683227 100644 (file)
@@ -286,7 +286,11 @@ void ApplicationCacheGroup::update(Frame* frame)
     ASSERT(!m_manifestResource);
     
     // FIXME: Handle defer loading
-    m_manifestHandle = ResourceHandle::create(m_manifestURL, this, frame, false, true, false);
+    
+    ResourceRequest request(m_manifestURL);
+    m_frame->loader()->applyUserAgent(request);
+    
+    m_manifestHandle = ResourceHandle::create(request, this, m_frame, false, true, false);
 }
  
 void ApplicationCacheGroup::didReceiveResponse(ResourceHandle* handle, const ResourceResponse& response)
@@ -563,7 +567,11 @@ void ApplicationCacheGroup::startLoadingEntry()
     // FIXME: If this is an upgrade attempt, the newest cache should be used as an HTTP cache.
     
     ASSERT(!m_currentHandle);
-    m_currentHandle = ResourceHandle::create(it->first, this, m_frame, false, true, false);
+    
+    ResourceRequest request(it->first);
+    m_frame->loader()->applyUserAgent(request);
+
+    m_currentHandle = ResourceHandle::create(request, this, m_frame, false, true, false);
 }
 
 void ApplicationCacheGroup::addEntry(const String& url, unsigned type)