summaryrefslogtreecommitdiff
path: root/src/3rdparty/webkit/WebCore/platform/network/qt/ResourceHandleQt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/WebCore/platform/network/qt/ResourceHandleQt.cpp')
-rw-r--r--src/3rdparty/webkit/WebCore/platform/network/qt/ResourceHandleQt.cpp48
1 files changed, 11 insertions, 37 deletions
diff --git a/src/3rdparty/webkit/WebCore/platform/network/qt/ResourceHandleQt.cpp b/src/3rdparty/webkit/WebCore/platform/network/qt/ResourceHandleQt.cpp
index b3844bf94b..f006c08add 100644
--- a/src/3rdparty/webkit/WebCore/platform/network/qt/ResourceHandleQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/network/qt/ResourceHandleQt.cpp
@@ -28,33 +28,29 @@
*/
#include "config.h"
-
-#include "Frame.h"
-#include "DocLoader.h"
#include "ResourceHandle.h"
-#include "ResourceHandleClient.h"
-#include "ResourceHandleInternal.h"
-#include "qwebpage_p.h"
-#include "qwebframe_p.h"
+
#include "ChromeClientQt.h"
+#include "DocLoader.h"
+#include "Frame.h"
#include "FrameLoaderClientQt.h"
+#include "NotImplemented.h"
#include "Page.h"
#include "QNetworkReplyHandler.h"
+#include "ResourceHandleClient.h"
+#include "ResourceHandleInternal.h"
+#include "SharedBuffer.h"
-#include "NotImplemented.h"
+// FIXME: WebCore including these headers from WebKit is a massive layering violation.
+#include "qwebframe_p.h"
+#include "qwebpage_p.h"
-#if QT_VERSION >= 0x040500
#include <QAbstractNetworkCache>
-#endif
#include <QCoreApplication>
#include <QUrl>
-#if QT_VERSION >= 0x040400
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
-#else
-#include "qwebnetworkinterface_p.h"
-#endif
namespace WebCore {
@@ -141,23 +137,15 @@ bool ResourceHandle::start(Frame* frame)
}
getInternal()->m_frame = static_cast<FrameLoaderClientQt*>(frame->loader()->client())->webFrame();
-#if QT_VERSION < 0x040400
- return QWebNetworkManager::self()->add(this, getInternal()->m_frame->page()->d->networkInterface);
-#else
ResourceHandleInternal *d = getInternal();
d->m_job = new QNetworkReplyHandler(this, QNetworkReplyHandler::LoadMode(d->m_defersLoading));
return true;
-#endif
}
void ResourceHandle::cancel()
{
-#if QT_VERSION < 0x040400
- QWebNetworkManager::self()->cancel(this);
-#else
if (d->m_job)
d->m_job->abort();
-#endif
}
bool ResourceHandle::loadsBlocked()
@@ -170,7 +158,6 @@ bool ResourceHandle::willLoadFromCache(ResourceRequest& request, Frame* frame)
if (!frame)
return false;
-#if QT_VERSION >= 0x040500
QNetworkAccessManager* manager = QWebFramePrivate::kit(frame)->page()->networkAccessManager();
QAbstractNetworkCache* cache = manager->cache();
@@ -184,9 +171,6 @@ bool ResourceHandle::willLoadFromCache(ResourceRequest& request, Frame* frame)
}
return false;
-#else
- return false;
-#endif
}
bool ResourceHandle::supportsBufferedData()
@@ -203,15 +187,8 @@ PassRefPtr<SharedBuffer> ResourceHandle::bufferedData()
void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, StoredCredentials /*storedCredentials*/, ResourceError& error, ResourceResponse& response, Vector<char>& data, Frame* frame)
{
WebCoreSynchronousLoader syncLoader;
- ResourceHandle handle(request, &syncLoader, true, false, true);
+ ResourceHandle handle(request, &syncLoader, true, false);
-#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();
if (!(d->m_user.isEmpty() || d->m_pass.isEmpty())) {
// If credentials were specified for this request, add them to the url,
@@ -223,7 +200,6 @@ void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, S
}
d->m_frame = static_cast<FrameLoaderClientQt*>(frame->loader()->client())->webFrame();
d->m_job = new QNetworkReplyHandler(&handle, QNetworkReplyHandler::LoadNormal);
-#endif
syncLoader.waitForCompletion();
error = syncLoader.resourceError();
@@ -236,10 +212,8 @@ void ResourceHandle::setDefersLoading(bool defers)
{
d->m_defersLoading = defers;
-#if QT_VERSION >= 0x040400
if (d->m_job)
d->m_job->setLoadMode(QNetworkReplyHandler::LoadMode(defers));
-#endif
}
} // namespace WebCore