Commit 8aab0aee authored by mjs's avatar mjs

Reviewed by Eric.

        - move TransferJob from kwq to platform, separate platform from non-platform bits

        * ForwardingHeaders/kio/job.h: Removed.
        * ForwardingHeaders/kio/jobclasses.h: Removed.
        * WebCore.xcodeproj/project.pbxproj:
        * bridge/mac/MacFrame.mm:
        * dom/xml_tokenizer.cpp:
        * khtml/xsl/xslt_processorimpl.cpp:
        * kwq/KWQKJobClasses.h: Removed.
        * kwq/KWQKJobClasses.mm: Removed.
        * kwq/KWQLoader.mm:
        * kwq/KWQResourceLoader.mm:
        * kwq/TransferJobClient.h: Removed.
        * loader/Cache.cpp:
        * loader/loader.cpp:
        * page/Frame.cpp:
        * platform/TransferJob.cpp: Added.
        (WebCore::TransferJob::TransferJob):
        (WebCore::TransferJob::queryMetaData):
        (WebCore::TransferJob::addMetaData):
        * platform/TransferJob.h: Added.
        * platform/TransferJobClient.h: Added.
        * platform/mac/TransferJobMac.mm: Added.
        (WebCore::TransferJobInternal::~TransferJobInternal):
        (WebCore::TransferJob::retrieveCharset):
        (WebCore::TransferJob::cancel):
        * xml/xmlhttprequest.cpp:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@13112 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent c2d5cea7
2006-03-03 Maciej Stachowiak <mjs@apple.com>
Reviewed by Eric.
- move TransferJob from kwq to platform, separate platform from non-platform bits
* ForwardingHeaders/kio/job.h: Removed.
* ForwardingHeaders/kio/jobclasses.h: Removed.
* WebCore.xcodeproj/project.pbxproj:
* bridge/mac/MacFrame.mm:
* dom/xml_tokenizer.cpp:
* khtml/xsl/xslt_processorimpl.cpp:
* kwq/KWQKJobClasses.h: Removed.
* kwq/KWQKJobClasses.mm: Removed.
* kwq/KWQLoader.mm:
* kwq/KWQResourceLoader.mm:
* kwq/TransferJobClient.h: Removed.
* loader/Cache.cpp:
* loader/loader.cpp:
* page/Frame.cpp:
* platform/TransferJob.cpp: Added.
(WebCore::TransferJob::TransferJob):
(WebCore::TransferJob::queryMetaData):
(WebCore::TransferJob::addMetaData):
* platform/TransferJob.h: Added.
* platform/TransferJobClient.h: Added.
* platform/mac/TransferJobMac.mm: Added.
(WebCore::TransferJobInternal::~TransferJobInternal):
(WebCore::TransferJob::retrieveCharset):
(WebCore::TransferJob::cancel):
* xml/xmlhttprequest.cpp:
2006-03-03 Maciej Stachowiak <mjs@apple.com>
Reviewed by Eric.
......@@ -12,6 +44,7 @@
(GraphicsContext::drawText):
(GraphicsContext::drawLineForText):
>>>>>>> .r13111
2006-03-02 Maciej Stachowiak <mjs@apple.com>
Rubber stamped by Eric.
......
......@@ -18,6 +18,11 @@
651B4D8509AC83370029F1EF /* QStringList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 651B4D8309AC83370029F1EF /* QStringList.cpp */; };
651B4D8609AC83370029F1EF /* QStringList.h in Headers */ = {isa = PBXBuildFile; fileRef = 651B4D8409AC83370029F1EF /* QStringList.h */; };
651B4D8F09AC859F0029F1EF /* QStringListMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 651B4D8E09AC859F0029F1EF /* QStringListMac.mm */; };
6545F67009B82FED0013006F /* TransferJob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6545F66C09B82FED0013006F /* TransferJob.cpp */; };
6545F67109B82FED0013006F /* TransferJob.h in Headers */ = {isa = PBXBuildFile; fileRef = 6545F66D09B82FED0013006F /* TransferJob.h */; };
6545F67209B82FED0013006F /* TransferJobClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 6545F66E09B82FED0013006F /* TransferJobClient.h */; };
6545F67309B82FED0013006F /* TransferJobInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 6545F66F09B82FED0013006F /* TransferJobInternal.h */; };
6545F67609B830180013006F /* TransferJobMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6545F67509B830180013006F /* TransferJobMac.mm */; };
654EC611097778F500DAB52C /* WebCoreFrameBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 654EC60F097778F500DAB52C /* WebCoreFrameBridge.h */; settings = {ATTRIBUTES = (Private, ); }; };
654EC612097778F500DAB52C /* WebCoreFrameBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = 654EC610097778F500DAB52C /* WebCoreFrameBridge.mm */; };
6550B69D099DF0270090D781 /* CDATASectionImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6550B693099DF0270090D781 /* CDATASectionImpl.cpp */; };
......@@ -182,7 +187,6 @@
935C477109AC4D7300A6AAB4 /* MouseEventMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 935C476F09AC4D7300A6AAB4 /* MouseEventMac.mm */; };
935C477309AC4D7700A6AAB4 /* WheelEventMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 935C477209AC4D7700A6AAB4 /* WheelEventMac.mm */; };
935C477509AC4D8E00A6AAB4 /* GapRects.h in Headers */ = {isa = PBXBuildFile; fileRef = 935C477409AC4D8D00A6AAB4 /* GapRects.h */; };
935EB36209B2D7DB00F3AF5B /* TransferJobClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 935EB36109B2D7DB00F3AF5B /* TransferJobClient.h */; };
936B424E09A436CD00BAA820 /* KSVGCSSParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0F6F6089701F100BA5114 /* KSVGCSSParser.cpp */; };
937A36A7097E2E3200E4EE2F /* UserAgentStyleSheets.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 937A36A6097E2E3200E4EE2F /* UserAgentStyleSheets.cpp */; };
937D809A09A063330092A01E /* PageMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 937D809909A063330092A01E /* PageMac.h */; };
......@@ -249,7 +253,6 @@
93F1994F08245E59001E9ABC /* KWQKHTMLSettings.h in Headers */ = {isa = PBXBuildFile; fileRef = F587863A02DE3A1401EA4122 /* KWQKHTMLSettings.h */; };
93F1995008245E59001E9ABC /* KWQKIOGlobal.h in Headers */ = {isa = PBXBuildFile; fileRef = F587864902DE3A9A01EA4122 /* KWQKIOGlobal.h */; };
93F1995408245E59001E9ABC /* KWQKJavaAppletWidget.h in Headers */ = {isa = PBXBuildFile; fileRef = F587864502DE3A7701EA4122 /* KWQKJavaAppletWidget.h */; };
93F1995608245E59001E9ABC /* KWQKJobClasses.h in Headers */ = {isa = PBXBuildFile; fileRef = F587864B02DE3A9A01EA4122 /* KWQKJobClasses.h */; };
93F1995B08245E59001E9ABC /* KWQKLocale.h in Headers */ = {isa = PBXBuildFile; fileRef = F58785FA02DE382001EA4122 /* KWQKLocale.h */; };
93F1996308245E59001E9ABC /* KWQKSSLKeyGen.h in Headers */ = {isa = PBXBuildFile; fileRef = F587866202DE3B1101EA4122 /* KWQKSSLKeyGen.h */; };
93F1996B08245E59001E9ABC /* KWQLineEdit.h in Headers */ = {isa = PBXBuildFile; fileRef = F587869802DE3B8601EA4122 /* KWQLineEdit.h */; };
......@@ -334,7 +337,6 @@
93F19A2508245E59001E9ABC /* KWQKCookieJar.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784EF02DE375901EA4122 /* KWQKCookieJar.mm */; };
93F19A2608245E59001E9ABC /* CursorMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784F002DE375901EA4122 /* CursorMac.mm */; };
93F19A2E08245E59001E9ABC /* KWQKJavaAppletWidget.mm in Sources */ = {isa = PBXBuildFile; fileRef = F58784FF02DE375901EA4122 /* KWQKJavaAppletWidget.mm */; };
93F19A3008245E59001E9ABC /* KWQKJobClasses.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587850102DE375901EA4122 /* KWQKJobClasses.mm */; };
93F19A3108245E59001E9ABC /* KWQLoader.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587850302DE375901EA4122 /* KWQLoader.mm */; };
93F19A3208245E59001E9ABC /* KWQKLocale.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587850402DE375901EA4122 /* KWQKLocale.mm */; };
93F19A3A08245E59001E9ABC /* KWQLineEdit.mm in Sources */ = {isa = PBXBuildFile; fileRef = F587851202DE375901EA4122 /* KWQLineEdit.mm */; };
......@@ -1129,6 +1131,11 @@
651B4D8309AC83370029F1EF /* QStringList.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = QStringList.cpp; path = platform/QStringList.cpp; sourceTree = "<group>"; };
651B4D8409AC83370029F1EF /* QStringList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = QStringList.h; path = platform/QStringList.h; sourceTree = "<group>"; };
651B4D8E09AC859F0029F1EF /* QStringListMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = QStringListMac.mm; sourceTree = "<group>"; };
6545F66C09B82FED0013006F /* TransferJob.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = TransferJob.cpp; path = platform/TransferJob.cpp; sourceTree = "<group>"; };
6545F66D09B82FED0013006F /* TransferJob.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = TransferJob.h; path = platform/TransferJob.h; sourceTree = "<group>"; };
6545F66E09B82FED0013006F /* TransferJobClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = TransferJobClient.h; path = platform/TransferJobClient.h; sourceTree = "<group>"; };
6545F66F09B82FED0013006F /* TransferJobInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = TransferJobInternal.h; path = platform/TransferJobInternal.h; sourceTree = "<group>"; };
6545F67509B830180013006F /* TransferJobMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = TransferJobMac.mm; sourceTree = "<group>"; };
654EC60F097778F500DAB52C /* WebCoreFrameBridge.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebCoreFrameBridge.h; sourceTree = "<group>"; };
654EC610097778F500DAB52C /* WebCoreFrameBridge.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreFrameBridge.mm; sourceTree = "<group>"; };
6550B693099DF0270090D781 /* CDATASectionImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CDATASectionImpl.cpp; sourceTree = "<group>"; };
......@@ -1314,7 +1321,6 @@
935C476F09AC4D7300A6AAB4 /* MouseEventMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MouseEventMac.mm; sourceTree = "<group>"; };
935C477209AC4D7700A6AAB4 /* WheelEventMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WheelEventMac.mm; sourceTree = "<group>"; };
935C477409AC4D8D00A6AAB4 /* GapRects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GapRects.h; sourceTree = "<group>"; };
935EB36109B2D7DB00F3AF5B /* TransferJobClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TransferJobClient.h; sourceTree = "<group>"; };
937A36A6097E2E3200E4EE2F /* UserAgentStyleSheets.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserAgentStyleSheets.cpp; sourceTree = "<group>"; };
937D809909A063330092A01E /* PageMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageMac.h; sourceTree = "<group>"; };
9380F47109A11AB4001FDB34 /* Widget.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Widget.cpp; path = platform/Widget.cpp; sourceTree = "<group>"; };
......@@ -2216,7 +2222,6 @@
F58784EF02DE375901EA4122 /* KWQKCookieJar.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQKCookieJar.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F58784F002DE375901EA4122 /* CursorMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CursorMac.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F58784FF02DE375901EA4122 /* KWQKJavaAppletWidget.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQKJavaAppletWidget.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587850102DE375901EA4122 /* KWQKJobClasses.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQKJobClasses.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587850302DE375901EA4122 /* KWQLoader.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQLoader.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587850402DE375901EA4122 /* KWQKLocale.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQKLocale.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587851202DE375901EA4122 /* KWQLineEdit.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQLineEdit.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
......@@ -2254,7 +2259,6 @@
F587863A02DE3A1401EA4122 /* KWQKHTMLSettings.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQKHTMLSettings.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587864502DE3A7701EA4122 /* KWQKJavaAppletWidget.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQKJavaAppletWidget.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587864902DE3A9A01EA4122 /* KWQKIOGlobal.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQKIOGlobal.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587864B02DE3A9A01EA4122 /* KWQKJobClasses.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQKJobClasses.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587866202DE3B1101EA4122 /* KWQKSSLKeyGen.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQKSSLKeyGen.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587868002DE3B8601EA4122 /* KWQCollection.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQCollection.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587868202DE3B8601EA4122 /* KWQComboBox.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQComboBox.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
......@@ -2379,6 +2383,7 @@
6582A14809999D6C00BEEB6D /* mac */ = {
isa = PBXGroup;
children = (
6545F67509B830180013006F /* TransferJobMac.mm */,
6582A14909999D6C00BEEB6D /* ColorMac.mm */,
F58784F002DE375901EA4122 /* CursorMac.mm */,
65F5386809B2BFDA00F3DC4A /* ExtraCFEncodings.h */,
......@@ -3414,6 +3419,10 @@
657BD74C09AFDC54005A2056 /* TextEncoding.h */,
93309EA1099EB78C0056E581 /* Timer.cpp */,
9305B24C098F1B6B00C28855 /* Timer.h */,
6545F66C09B82FED0013006F /* TransferJob.cpp */,
6545F66D09B82FED0013006F /* TransferJob.h */,
6545F66E09B82FED0013006F /* TransferJobClient.h */,
6545F66F09B82FED0013006F /* TransferJobInternal.h */,
935C476A09AC4D4F00A6AAB4 /* WheelEvent.h */,
9380F47109A11AB4001FDB34 /* Widget.cpp */,
9380F47209A11AB4001FDB34 /* Widget.h */,
......@@ -3825,11 +3834,8 @@
isa = PBXGroup;
children = (
F587864902DE3A9A01EA4122 /* KWQKIOGlobal.h */,
F587864B02DE3A9A01EA4122 /* KWQKJobClasses.h */,
F587850102DE375901EA4122 /* KWQKJobClasses.mm */,
F587866202DE3B1101EA4122 /* KWQKSSLKeyGen.h */,
84B2B24F056BF15F00D2B771 /* KWQKSSLKeyGen.mm */,
935EB36109B2D7DB00F3AF5B /* TransferJobClient.h */,
);
name = kio;
sourceTree = "<group>";
......@@ -3934,7 +3940,6 @@
93F1994F08245E59001E9ABC /* KWQKHTMLSettings.h in Headers */,
93F1995008245E59001E9ABC /* KWQKIOGlobal.h in Headers */,
93F1995408245E59001E9ABC /* KWQKJavaAppletWidget.h in Headers */,
93F1995608245E59001E9ABC /* KWQKJobClasses.h in Headers */,
93F1995B08245E59001E9ABC /* KWQKLocale.h in Headers */,
93F1996308245E59001E9ABC /* KWQKSSLKeyGen.h in Headers */,
93F1996B08245E59001E9ABC /* KWQLineEdit.h in Headers */,
......@@ -4407,10 +4412,12 @@
BC9B62E409B3DC85006131EB /* KWQFontMetrics.h in Headers */,
65F537D909B2B20F00F3DC4A /* CharsetNames.h in Headers */,
65F5386909B2BFDA00F3DC4A /* ExtraCFEncodings.h in Headers */,
935EB36209B2D7DB00F3AF5B /* TransferJobClient.h in Headers */,
A82398A609B3ACDB00B60641 /* PlugInInfoStore.h in Headers */,
A8239E0109B3CF8A00B60641 /* Logging.h in Headers */,
C6D74AD509AA282E000B0A52 /* ModifySelectionListLevelCommand.h in Headers */,
6545F67109B82FED0013006F /* TransferJob.h in Headers */,
6545F67209B82FED0013006F /* TransferJobClient.h in Headers */,
6545F67309B82FED0013006F /* TransferJobInternal.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -5053,7 +5060,6 @@
93F19A2508245E59001E9ABC /* KWQKCookieJar.mm in Sources */,
93F19A2608245E59001E9ABC /* CursorMac.mm in Sources */,
93F19A2E08245E59001E9ABC /* KWQKJavaAppletWidget.mm in Sources */,
93F19A3008245E59001E9ABC /* KWQKJobClasses.mm in Sources */,
93F19A3108245E59001E9ABC /* KWQLoader.mm in Sources */,
93F19A3208245E59001E9ABC /* KWQKLocale.mm in Sources */,
93F19A3A08245E59001E9ABC /* KWQLineEdit.mm in Sources */,
......@@ -5528,6 +5534,8 @@
A8239E0009B3CF8A00B60641 /* Logging.cpp in Sources */,
C6D74AE409AA290A000B0A52 /* ModifySelectionListLevelCommand.cpp in Sources */,
A823A75C09B6E53900B60641 /* GraphicsContext.cpp in Sources */,
6545F67009B82FED0013006F /* TransferJob.cpp in Sources */,
6545F67609B830180013006F /* TransferJobMac.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......
......@@ -43,7 +43,7 @@
#import "KWQEditCommand.h"
#import "KWQExceptions.h"
#import "KWQFormData.h"
#import "KWQKJobClasses.h"
#import "TransferJob.h"
#import "Logging.h"
#import "KWQPageState.h"
#import "KWQRegExp.h"
......
......@@ -46,7 +46,7 @@
#include <libxml/parser.h>
#include <libxml/parserInternals.h>
#include <kio/job.h>
#include "TransferJob.h"
#if SVG_SUPPORT
#include "SVGNames.h"
......
......@@ -38,7 +38,7 @@
#include "Frame.h"
#include "KWQLoader.h"
#include <kio/job.h>
#include "TransferJob.h"
#include <libxslt/xsltutils.h>
#include <libxslt/documents.h>
......
......@@ -33,7 +33,7 @@
#import "FoundationExtras.h"
#import "KWQExceptions.h"
#import "KWQFormData.h"
#import "KWQKJobClasses.h"
#import "TransferJob.h"
#import "Logging.h"
#import "KWQResourceLoader.h"
#import "MacFrame.h"
......
......@@ -26,7 +26,7 @@
#include "config.h"
#import "KWQResourceLoader.h"
#import "KWQKJobClasses.h"
#import "TransferJob.h"
#import "KURL.h"
#import "loader.h"
#import <kxmlcore/Assertions.h>
......
......@@ -35,8 +35,8 @@
#include "DocLoader.h"
#include "DocumentImpl.h"
#include "loader.h"
#include <kio/job.h>
#include <kio/jobclasses.h>
#include "TransferJob.h"
#include "TransferJob.h"
#include <kxmlcore/Assertions.h>
#include "Image.h"
......
......@@ -36,8 +36,8 @@
#include "KWQLoader.h"
#include "Request.h"
#include "html_documentimpl.h"
#include <kio/job.h>
#include <kio/jobclasses.h>
#include "TransferJob.h"
#include "TransferJob.h"
#include <kxmlcore/Assertions.h>
#include <kxmlcore/Vector.h>
......
......@@ -77,7 +77,7 @@
#include "xmlhttprequest.h"
#include <assert.h>
#include <kio/global.h>
#include <kio/job.h>
#include "TransferJob.h"
#include <klocale.h>
#include <kxmlcore/Assertions.h>
#include <qptrlist.h>
......
/*
* Copyright (C) 2004 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "TransferJob.h"
#include "TransferJobInternal.h"
#include "KURL.h"
#include "KWQLoader.h"
#include "Logging.h"
#include "formdata.h"
#include "String.h"
namespace WebCore {
TransferJob::TransferJob(TransferJobClient* client, const String& method, const KURL& url)
: d(new TransferJobInternal(client, method, url))
{
}
TransferJob::TransferJob(TransferJobClient* client, const String& method, const KURL& url, const FormData& postData)
: d(new TransferJobInternal(client, method, url, postData))
{
}
bool TransferJob::isErrorPage() const
{
return d->status != 0;
}
int TransferJob::error() const
{
return d->status;
}
void TransferJob::setError(int e)
{
d->status = e;
}
QString TransferJob::errorText() const
{
LOG(NotYetImplemented, "not yet implemented");
return QString::null;
}
QString TransferJob::queryMetaData(const QString &key) const
{
if (key == "HTTP-Headers") {
assembleResponseHeaders();
return d->responseHeaders;
}
if (key == "charset")
// this will put it in the regular metadata dictionary
retrieveCharset();
return d->metaData.get(key).qstring();
}
void TransferJob::addMetaData(const QString &key, const QString &value)
{
d->metaData.set(key, value);
}
void TransferJob::addMetaData(const HashMap<String, String>& keysAndValues)
{
HashMap<String, String>::const_iterator end = keysAndValues.end();
for (HashMap<String, String>::const_iterator it = keysAndValues.begin(); it != end; ++it)
d->metaData.set(it->first, it->second);
}
void TransferJob::kill()
{
delete this;
}
KURL TransferJob::url() const
{
return d->URL;
}
FormData TransferJob::postData() const
{
return d->postData;
}
String TransferJob::method() const
{
return d->method;
}
TransferJobClient* TransferJob::client() const
{
return d->client;
}
} // namespace WebCore
......@@ -23,8 +23,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef JOBCLASSES_H_
#define JOBCLASSES_H_
#ifndef TransferJob_H_
#define TransferJob_H_
#include "PlatformString.h"
#include "TransferJobClient.h" // for PlatformResponse
......@@ -43,7 +43,7 @@ class KURL;
namespace WebCore {
class FormData;
class TransferJobPrivate;
class TransferJobInternal;
class DocLoader;
class TransferJob {
......@@ -58,7 +58,7 @@ public:
void setError(int);
QString errorText() const;
bool isErrorPage() const;
QString queryMetaData(const QString& key) const;
QString queryMetaData(const QString&) const;
void addMetaData(const QString& key, const QString& value);
void addMetaData(const HashMap<String, String>&);
void kill();
......@@ -81,9 +81,9 @@ private:
void assembleResponseHeaders() const;
void retrieveCharset() const;
TransferJobPrivate* d;
TransferJobInternal* d;
};
}
#endif
#endif // TransferJob_H_
......@@ -24,7 +24,9 @@
*/
#import "config.h"
#import "KWQKJobClasses.h"
#import "TransferJob.h"
#import "TransferJobInternal.h"
#import "FoundationExtras.h"
#import "KURL.h"
......@@ -40,72 +42,11 @@
#import "KWQLoader.h"
namespace WebCore {
// The allocations and releases in TransferJobPrivate are
// definitely Cocoa-exception-free (either simple Foundation
// classes or our own KWQResourceLoader which avoides doing work
// in dealloc.
class TransferJobPrivate
{
public:
TransferJobPrivate(TransferJobClient* c, const String& method, const KURL& u)
: client(c)
, status(0)
, metaData(KWQRetainNSRelease([[NSMutableDictionary alloc] initWithCapacity:17]))
, URL(u)
, loader(nil)
, method(method)
, response(nil)
, assembledResponseHeaders(true)
, retrievedCharset(true)
{
}
TransferJobPrivate(TransferJobClient* c, const String& method, const KURL& u, const FormData& p)
: client(c)
, status(0)
, metaData(KWQRetainNSRelease([[NSMutableDictionary alloc] initWithCapacity:17]))
, URL(u)
, loader(nil)
, method(method)
, postData(p)
, response(nil)
, assembledResponseHeaders(true)
, retrievedCharset(true)
{
}
~TransferJobPrivate()
{
KWQRelease(response);
KWQRelease(metaData);
KWQRelease(loader);
}
TransferJobClient* client;
int status;
NSMutableDictionary* metaData;
KURL URL;
KWQResourceLoader* loader;
String method;
FormData postData;
NSURLResponse* response;
bool assembledResponseHeaders;
bool retrievedCharset;
QString responseHeaders;
};
TransferJob::TransferJob(TransferJobClient* client, const String& method, const KURL& url)
: d(new TransferJobPrivate(client, method, url))
{
}
TransferJob::TransferJob(TransferJobClient* client, const String& method, const KURL& url, const FormData& postData)
: d(new TransferJobPrivate(client, method, url, postData))
TransferJobInternal::~TransferJobInternal()
{
KWQRelease(response);
KWQRelease(loader);
}
TransferJob::~TransferJob()
......@@ -117,7 +58,6 @@ TransferJob::~TransferJob()
delete d;
}
bool TransferJob::start(DocLoader* docLoader)
{
MacFrame *frame = Mac(docLoader->frame());
......@@ -156,27 +96,6 @@ bool TransferJob::start(DocLoader* docLoader)
return true;
}
bool TransferJob::isErrorPage() const
{
return d->status != 0;
}
int TransferJob::error() const
{
return d->status;
}
void TransferJob::setError(int e)
{
d->status = e;
}
QString TransferJob::errorText() const
{
LOG(NotYetImplemented, "not yet implemented");
return QString::null;
}
void TransferJob::assembleResponseHeaders() const
{
if (!d->assembledResponseHeaders) {
......@@ -193,46 +112,12 @@ void TransferJob::retrieveCharset() const
{
if (!d->retrievedCharset) {
NSString *charset = [d->response textEncodingName];
if (charset) {
[d->metaData setObject:charset forKey:@"charset"];
}
if (charset)
d->metaData.set("charset", charset);
d->retrievedCharset = true;
}
}
QString TransferJob::queryMetaData(const QString &key) const
{
if (key == "HTTP-Headers") {
assembleResponseHeaders();
return d->responseHeaders;
}
if (key == "charset") {
// this will put it in the regular metadata dictionary
retrieveCharset();
}
NSString *value = [d->metaData objectForKey:key.getNSString()];
return value ? QString::fromNSString(value) : QString::null;
}
void TransferJob::addMetaData(const QString &key, const QString &value)
{
[d->metaData setObject:value.getNSString() forKey:key.getNSString()];
}
void TransferJob::addMetaData(const HashMap<String, String>& keysAndValues)
{
HashMap<String, String>::const_iterator end = keysAndValues.end();
for (HashMap<String, String>::const_iterator it = keysAndValues.begin(); it != end; ++it)
[d->metaData setObject:it->second forKey:it->first];
}
void TransferJob::kill()
{
delete this;
}
void TransferJob::setLoader(KWQResourceLoader *loader)
{
KWQRetain(loader);
......@@ -240,26 +125,6 @@ void TransferJob::setLoader(KWQResourceLoader *loader)
d->loader = loader;
}
void TransferJob::cancel()
{
[d->loader jobCanceledLoad];
}
KURL TransferJob::url() const
{
return d->URL;
}
FormData TransferJob::postData() const
{
return d->postData;
}
String TransferJob::method() const
{
return d->method;
}
void TransferJob::receivedResponse(NSURLResponse* response)
{
d->assembledResponseHeaders = false;
......@@ -270,9 +135,9 @@ void TransferJob::receivedResponse(NSURLResponse* response)
d->client->receivedResponse(this, response);
}
TransferJobClient* TransferJob::client() const
void TransferJob::cancel()
{
return d->client;
[d->loader jobCanceledLoad];
}
} // namespace KIO
} // namespace WebCore
......@@ -32,7 +32,7 @@
#include "formdata.h"
#include "html_documentimpl.h"
#include "kjs_binding.h"
#include <kio/job.h>
#include "TransferJob.h"
#include <kjs/protect.h>
#include <qregexp.h>
#include "TextEncoding.h"
......