http://bugs.webkit.org/show_bug.cgi?id=16588
authorhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Jan 2008 15:28:59 +0000 (15:28 +0000)
committerhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Jan 2008 15:28:59 +0000 (15:28 +0000)
Added a (last) Frame argument to ResourceHandle::loadResourceSynchronously.
This allows implementing the synchronous loading correctly for the Qt port where the networking
backend is bound to the page.

Signed-off-by: Lars
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@29352 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/loader/FrameLoader.cpp
WebCore/platform/network/ResourceHandle.h
WebCore/platform/network/cf/ResourceHandleCFNet.cpp
WebCore/platform/network/curl/ResourceHandleCurl.cpp
WebCore/platform/network/mac/ResourceHandleMac.mm
WebCore/platform/network/qt/ResourceHandleQt.cpp

index da4f598..3a2429a 100644 (file)
@@ -1,3 +1,22 @@
+2008-01-10  Simon Hausmann  <hausmann@webkit.org>
+
+        Reviewed by Lars.
+
+        http://bugs.webkit.org/show_bug.cgi?id=16588
+
+        Added a (last) Frame argument to ResourceHandle::loadResourceSynchronously.
+        This allows implementing the synchronous loading correctly for the Qt port where the networking
+        backend is bound to the page.
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::loadResourceSynchronously):
+        * platform/network/ResourceHandle.h:
+        * platform/network/cf/ResourceHandleCFNet.cpp:
+        * platform/network/curl/ResourceHandleCurl.cpp:
+        * platform/network/mac/ResourceHandleMac.mm:
+        * platform/network/qt/ResourceHandleQt.cpp:
+        (WebCore::ResourceHandle::loadResourceSynchronously):
+
 2008-01-10  Kevin Ollivier  <kevino@theolliviers.com>
 
         wx build fix for changes in r29328
index 6df2fae..2d2d1ee 100644 (file)
@@ -3293,7 +3293,7 @@ void FrameLoader::loadResourceSynchronously(const ResourceRequest& request, Reso
     if (error.isNull()) {
         ASSERT(!newRequest.isNull());
         didTellClientAboutLoad(newRequest.url().string());
-        ResourceHandle::loadResourceSynchronously(newRequest, error, response, data);
+        ResourceHandle::loadResourceSynchronously(newRequest, error, response, data, m_frame);
     }
     
     sendRemainingDelegateMessages(identifier, response, data.size(), error);
index 32b3f12..85888e8 100644 (file)
@@ -92,7 +92,7 @@ public:
     // FIXME: should not need the Frame
     static PassRefPtr<ResourceHandle> create(const ResourceRequest&, ResourceHandleClient*, Frame*, bool defersLoading, bool shouldContentSniff, bool mightDownloadFromHandle = false);
 
-    static void loadResourceSynchronously(const ResourceRequest&, ResourceError&, ResourceResponse&, Vector<char>& data);
+    static void loadResourceSynchronously(const ResourceRequest&, ResourceError&, ResourceResponse&, Vector<char>& data, Frame* frame);
     static bool willLoadFromCache(ResourceRequest&);
     
     ~ResourceHandle();
index c352643..04a9e13 100644 (file)
@@ -355,7 +355,7 @@ CFURLConnectionRef ResourceHandle::releaseConnectionForDownload()
     return d->m_connection.releaseRef();
 }
 
-void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, ResourceError& error, ResourceResponse& response, Vector<char>& vector)
+void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, ResourceError& error, ResourceResponse& response, Vector<char>& vector, Frame*)
 {
     ASSERT(!request.isEmpty());
     CFURLResponseRef cfResponse = 0;
index 2c1789e..a2503c9 100644 (file)
@@ -89,7 +89,7 @@ bool ResourceHandle::loadsBlocked()
     return false;
 }
 
-void ResourceHandle::loadResourceSynchronously(const ResourceRequest&, ResourceError&, ResourceResponse&, Vector<char>&)
+void ResourceHandle::loadResourceSynchronously(const ResourceRequest&, ResourceError&, ResourceResponse&, Vector<char>&, Frame*)
 {
     notImplemented();
 }
index e270748..dc83473 100644 (file)
@@ -229,7 +229,7 @@ bool ResourceHandle::willLoadFromCache(ResourceRequest& request)
     return nsURLResponse;
 }
 
-void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, ResourceError& error, ResourceResponse& response, Vector<char>& data)
+void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, ResourceError& error, ResourceResponse& response, Vector<char>& data, Frame*)
 {
     NSError *nsError = nil;
     
index fd9fae7..abbb651 100644 (file)
@@ -169,26 +169,28 @@ PassRefPtr<SharedBuffer> ResourceHandle::bufferedData()
     return 0;
 }
 
-void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, ResourceError& error, ResourceResponse& response, Vector<char>& data)
+void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, ResourceError& error, ResourceResponse& response, Vector<char>& data, Frame* frame)
 {
-#if QT_VERSION < 0x040400
     WebCoreSynchronousLoader syncLoader;
     ResourceHandle handle(request, &syncLoader, true, false, true);
 
+#if QT_VERSION < 0x040400
     if (!QWebNetworkManager::self()->add(&handle, QWebNetworkInterface::defaultInterface(), QWebNetworkManager::SynchronousJob)) {
         // FIXME Create a sane ResourceError
         error = ResourceError(String(), -1, String(), String());
         return;
     }
+#else
+    ResourceHandleInternal *d = handle.getInternal();
+    d->m_frame = static_cast<FrameLoaderClientQt*>(frame->loader()->client())->webFrame();
+    d->m_job = new QNetworkReplyHandler(&handle);
+#endif
 
     syncLoader.waitForCompletion();
     error = syncLoader.resourceError();
     data = syncLoader.data();
     qDebug() << data.size();
     response = syncLoader.resourceResponse();
-#else
-    notImplemented(); // #### implement me
-#endif
 }