2008-02-25 MorganL <morganl.webkit@yahoo.com>
authormrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Feb 2008 02:21:00 +0000 (02:21 +0000)
committermrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Feb 2008 02:21:00 +0000 (02:21 +0000)
        Reviewed by Darin Adler.

        Eliminate some #ifdefs from headers in platform/network.
        http://bugs.webkit.org/show_bug.cgi?id=11786

        * WebCore.base.exp:
        * WebCore.order:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * dom/XMLTokenizer.cpp:
        * loader/ResourceLoader.h:
        * platform/network/AuthenticationChallenge.cpp: Removed.
        * platform/network/AuthenticationChallenge.h: Removed.
        * platform/network/AuthenticationChallengeBase.cpp: Copied from platform/network/AuthenticationChallenge.cpp.
        (WebCore::AuthenticationChallengeBase::AuthenticationChallengeBase):
        (WebCore::AuthenticationChallengeBase::previousFailureCount):
        (WebCore::AuthenticationChallengeBase::proposedCredential):
        (WebCore::AuthenticationChallengeBase::protectionSpace):
        (WebCore::AuthenticationChallengeBase::failureResponse):
        (WebCore::AuthenticationChallengeBase::error):
        (WebCore::AuthenticationChallengeBase::isNull):
        (WebCore::AuthenticationChallengeBase::nullify):
        (WebCore::AuthenticationChallengeBase::compare):
        * platform/network/AuthenticationChallengeBase.h: Copied from platform/network/AuthenticationChallenge.h.
        (WebCore::AuthenticationChallengeBase::platformCompare):
        (WebCore::operator==):
        (WebCore::operator!=):
        * platform/network/ResourceError.cpp: Removed.
        * platform/network/ResourceError.h: Removed.
        * platform/network/ResourceErrorBase.cpp: Copied from platform/network/ResourceError.cpp.
        (WebCore::ResourceErrorBase::lazyInit):
        (WebCore::ResourceErrorBase::compare):
        * platform/network/ResourceErrorBase.h: Copied from platform/network/ResourceError.h.
        (WebCore::ResourceErrorBase::isNull):
        (WebCore::ResourceErrorBase::domain):
        (WebCore::ResourceErrorBase::errorCode):
        (WebCore::ResourceErrorBase::failingURL):
        (WebCore::ResourceErrorBase::localizedDescription):
        (WebCore::ResourceErrorBase::ResourceErrorBase):
        (WebCore::ResourceErrorBase::platformLazyInit):
        (WebCore::ResourceErrorBase::platformCompare):
        (WebCore::operator==):
        * platform/network/ResourceResponseBase.cpp:
        (WebCore::ResourceResponseBase::isHTTP):
        (WebCore::ResourceResponseBase::url):
        (WebCore::ResourceResponseBase::setUrl):
        (WebCore::ResourceResponseBase::mimeType):
        (WebCore::ResourceResponseBase::setMimeType):
        (WebCore::ResourceResponseBase::expectedContentLength):
        (WebCore::ResourceResponseBase::setExpectedContentLength):
        (WebCore::ResourceResponseBase::textEncodingName):
        (WebCore::ResourceResponseBase::setTextEncodingName):
        (WebCore::ResourceResponseBase::suggestedFilename):
        (WebCore::ResourceResponseBase::setSuggestedFilename):
        (WebCore::ResourceResponseBase::httpStatusCode):
        (WebCore::ResourceResponseBase::setHTTPStatusCode):
        (WebCore::ResourceResponseBase::httpStatusText):
        (WebCore::ResourceResponseBase::setHTTPStatusText):
        (WebCore::ResourceResponseBase::httpHeaderField):
        (WebCore::ResourceResponseBase::setHTTPHeaderField):
        (WebCore::ResourceResponseBase::httpHeaderFields):
        (WebCore::ResourceResponseBase::isAttachment):
        (WebCore::ResourceResponseBase::setExpirationDate):
        (WebCore::ResourceResponseBase::expirationDate):
        (WebCore::ResourceResponseBase::setLastModifiedDate):
        (WebCore::ResourceResponseBase::lastModifiedDate):
        (WebCore::ResourceResponseBase::lazyInit):
        (WebCore::ResourceResponseBase::compare):
        * platform/network/ResourceResponseBase.h:
        (WebCore::ResourceResponseBase::ResourceResponseBase):
        (WebCore::ResourceResponseBase::platformLazyInit):
        (WebCore::ResourceResponseBase::platformCompare):
        (WebCore::operator==):
        * platform/network/cf/AuthenticationCF.cpp:
        (WebCore::AuthenticationChallenge::AuthenticationChallenge):
        (WebCore::AuthenticationChallenge::platformCompare):
        * platform/network/cf/AuthenticationChallenge.h: Added.
        (WebCore::AuthenticationChallenge::AuthenticationChallenge):
        (WebCore::AuthenticationChallenge::sourceHandle):
        (WebCore::AuthenticationChallenge::cfURLAuthChallengeRef):
        * platform/network/cf/ResourceError.h: Added.
        (WebCore::ResourceError::ResourceError):
        * platform/network/cf/ResourceErrorCF.cpp:
        (WebCore::ResourceError::ResourceError):
        (WebCore::ResourceError::platformLazyInit):
        (WebCore::ResourceError::platformCompare):
        (WebCore::ResourceError::operator CFStreamError):
        * platform/network/cf/ResourceResponse.h:
        (WebCore::ResourceResponse::ResourceResponse):
        * platform/network/cf/ResourceResponseCFNet.cpp:
        (WebCore::ResourceResponse::platformLazyInit):
        * platform/network/curl/AuthenticationChallenge.h: Added.
        (WebCore::AuthenticationChallenge::AuthenticationChallenge):
        * platform/network/curl/ResourceError.h: Added.
        (WebCore::ResourceError::ResourceError):
        * platform/network/curl/ResourceResponse.h:
        (WebCore::ResourceResponse::ResourceResponse):
        * platform/network/mac/AuthenticationChallenge.h: Added.
        (WebCore::AuthenticationChallenge::AuthenticationChallenge):
        (WebCore::AuthenticationChallenge::sender):
        (WebCore::AuthenticationChallenge::nsURLAuthenticationChallenge):
        * platform/network/mac/AuthenticationMac.mm:
        (WebCore::AuthenticationChallenge::AuthenticationChallenge):
        (WebCore::AuthenticationChallenge::platformCompare):
        * platform/network/mac/ResourceError.h: Added.
        (WebCore::ResourceError::ResourceError):
        * platform/network/mac/ResourceErrorMac.mm:
        (WebCore::ResourceError::platformLazyInit):
        (WebCore::ResourceError::platformCompare):
        * platform/network/mac/ResourceResponse.h:
        (WebCore::ResourceResponse::ResourceResponse):
        * platform/network/mac/ResourceResponseMac.mm:
        (WebCore::ResourceResponse::platformLazyInit):
        (WebCore::ResourceResponse::platformCompare):
        * platform/network/qt/AuthenticationChallenge.h: Added.
        (WebCore::AuthenticationChallenge::AuthenticationChallenge):
        * platform/network/qt/ResourceError.h: Added.
        (WebCore::ResourceError::ResourceError):
        * platform/network/qt/ResourceResponse.h:
        (WebCore::ResourceResponse::ResourceResponse):
        * xml/XSLTProcessor.cpp:

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

33 files changed:
WebCore/ChangeLog
WebCore/WebCore.base.exp
WebCore/WebCore.order
WebCore/WebCore.vcproj/WebCore.vcproj
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/dom/XMLTokenizer.cpp
WebCore/loader/ResourceLoader.h
WebCore/platform/network/AuthenticationChallengeBase.cpp [moved from WebCore/platform/network/AuthenticationChallenge.cpp with 63% similarity]
WebCore/platform/network/AuthenticationChallengeBase.h [new file with mode: 0644]
WebCore/platform/network/ResourceError.h [deleted file]
WebCore/platform/network/ResourceErrorBase.cpp [new file with mode: 0644]
WebCore/platform/network/ResourceErrorBase.h [new file with mode: 0644]
WebCore/platform/network/ResourceResponseBase.cpp
WebCore/platform/network/ResourceResponseBase.h
WebCore/platform/network/cf/AuthenticationCF.cpp
WebCore/platform/network/cf/AuthenticationChallenge.h [new file with mode: 0644]
WebCore/platform/network/cf/ResourceError.h [new file with mode: 0644]
WebCore/platform/network/cf/ResourceErrorCF.cpp
WebCore/platform/network/cf/ResourceResponse.h
WebCore/platform/network/cf/ResourceResponseCFNet.cpp
WebCore/platform/network/curl/AuthenticationChallenge.h [new file with mode: 0644]
WebCore/platform/network/curl/ResourceError.h [moved from WebCore/platform/network/ResourceError.cpp with 76% similarity]
WebCore/platform/network/curl/ResourceResponse.h
WebCore/platform/network/mac/AuthenticationChallenge.h [moved from WebCore/platform/network/AuthenticationChallenge.h with 59% similarity]
WebCore/platform/network/mac/AuthenticationMac.mm
WebCore/platform/network/mac/ResourceError.h [new file with mode: 0644]
WebCore/platform/network/mac/ResourceErrorMac.mm
WebCore/platform/network/mac/ResourceResponse.h
WebCore/platform/network/mac/ResourceResponseMac.mm
WebCore/platform/network/qt/AuthenticationChallenge.h [new file with mode: 0644]
WebCore/platform/network/qt/ResourceError.h [new file with mode: 0644]
WebCore/platform/network/qt/ResourceResponse.h
WebCore/xml/XSLTProcessor.cpp

index f5f63eb8765662cfdb60414bd90e93572f2e17da..8c5b26ccd47f578392a857ec8ffe185dffefa817 100644 (file)
@@ -1,3 +1,127 @@
+2008-02-25  MorganL  <morganl.webkit@yahoo.com>
+
+        Reviewed by Darin Adler.
+
+        Eliminate some #ifdefs from headers in platform/network.
+        http://bugs.webkit.org/show_bug.cgi?id=11786
+
+        * WebCore.base.exp:
+        * WebCore.order:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * dom/XMLTokenizer.cpp:
+        * loader/ResourceLoader.h:
+        * platform/network/AuthenticationChallenge.cpp: Removed.
+        * platform/network/AuthenticationChallenge.h: Removed.
+        * platform/network/AuthenticationChallengeBase.cpp: Copied from platform/network/AuthenticationChallenge.cpp.
+        (WebCore::AuthenticationChallengeBase::AuthenticationChallengeBase):
+        (WebCore::AuthenticationChallengeBase::previousFailureCount):
+        (WebCore::AuthenticationChallengeBase::proposedCredential):
+        (WebCore::AuthenticationChallengeBase::protectionSpace):
+        (WebCore::AuthenticationChallengeBase::failureResponse):
+        (WebCore::AuthenticationChallengeBase::error):
+        (WebCore::AuthenticationChallengeBase::isNull):
+        (WebCore::AuthenticationChallengeBase::nullify):
+        (WebCore::AuthenticationChallengeBase::compare):
+        * platform/network/AuthenticationChallengeBase.h: Copied from platform/network/AuthenticationChallenge.h.
+        (WebCore::AuthenticationChallengeBase::platformCompare):
+        (WebCore::operator==):
+        (WebCore::operator!=):
+        * platform/network/ResourceError.cpp: Removed.
+        * platform/network/ResourceError.h: Removed.
+        * platform/network/ResourceErrorBase.cpp: Copied from platform/network/ResourceError.cpp.
+        (WebCore::ResourceErrorBase::lazyInit):
+        (WebCore::ResourceErrorBase::compare):
+        * platform/network/ResourceErrorBase.h: Copied from platform/network/ResourceError.h.
+        (WebCore::ResourceErrorBase::isNull):
+        (WebCore::ResourceErrorBase::domain):
+        (WebCore::ResourceErrorBase::errorCode):
+        (WebCore::ResourceErrorBase::failingURL):
+        (WebCore::ResourceErrorBase::localizedDescription):
+        (WebCore::ResourceErrorBase::ResourceErrorBase):
+        (WebCore::ResourceErrorBase::platformLazyInit):
+        (WebCore::ResourceErrorBase::platformCompare):
+        (WebCore::operator==):
+        * platform/network/ResourceResponseBase.cpp:
+        (WebCore::ResourceResponseBase::isHTTP):
+        (WebCore::ResourceResponseBase::url):
+        (WebCore::ResourceResponseBase::setUrl):
+        (WebCore::ResourceResponseBase::mimeType):
+        (WebCore::ResourceResponseBase::setMimeType):
+        (WebCore::ResourceResponseBase::expectedContentLength):
+        (WebCore::ResourceResponseBase::setExpectedContentLength):
+        (WebCore::ResourceResponseBase::textEncodingName):
+        (WebCore::ResourceResponseBase::setTextEncodingName):
+        (WebCore::ResourceResponseBase::suggestedFilename):
+        (WebCore::ResourceResponseBase::setSuggestedFilename):
+        (WebCore::ResourceResponseBase::httpStatusCode):
+        (WebCore::ResourceResponseBase::setHTTPStatusCode):
+        (WebCore::ResourceResponseBase::httpStatusText):
+        (WebCore::ResourceResponseBase::setHTTPStatusText):
+        (WebCore::ResourceResponseBase::httpHeaderField):
+        (WebCore::ResourceResponseBase::setHTTPHeaderField):
+        (WebCore::ResourceResponseBase::httpHeaderFields):
+        (WebCore::ResourceResponseBase::isAttachment):
+        (WebCore::ResourceResponseBase::setExpirationDate):
+        (WebCore::ResourceResponseBase::expirationDate):
+        (WebCore::ResourceResponseBase::setLastModifiedDate):
+        (WebCore::ResourceResponseBase::lastModifiedDate):
+        (WebCore::ResourceResponseBase::lazyInit):
+        (WebCore::ResourceResponseBase::compare):
+        * platform/network/ResourceResponseBase.h:
+        (WebCore::ResourceResponseBase::ResourceResponseBase):
+        (WebCore::ResourceResponseBase::platformLazyInit):
+        (WebCore::ResourceResponseBase::platformCompare):
+        (WebCore::operator==):
+        * platform/network/cf/AuthenticationCF.cpp:
+        (WebCore::AuthenticationChallenge::AuthenticationChallenge):
+        (WebCore::AuthenticationChallenge::platformCompare):
+        * platform/network/cf/AuthenticationChallenge.h: Added.
+        (WebCore::AuthenticationChallenge::AuthenticationChallenge):
+        (WebCore::AuthenticationChallenge::sourceHandle):
+        (WebCore::AuthenticationChallenge::cfURLAuthChallengeRef):
+        * platform/network/cf/ResourceError.h: Added.
+        (WebCore::ResourceError::ResourceError):
+        * platform/network/cf/ResourceErrorCF.cpp:
+        (WebCore::ResourceError::ResourceError):
+        (WebCore::ResourceError::platformLazyInit):
+        (WebCore::ResourceError::platformCompare):
+        (WebCore::ResourceError::operator CFStreamError):
+        * platform/network/cf/ResourceResponse.h:
+        (WebCore::ResourceResponse::ResourceResponse):
+        * platform/network/cf/ResourceResponseCFNet.cpp:
+        (WebCore::ResourceResponse::platformLazyInit):
+        * platform/network/curl/AuthenticationChallenge.h: Added.
+        (WebCore::AuthenticationChallenge::AuthenticationChallenge):
+        * platform/network/curl/ResourceError.h: Added.
+        (WebCore::ResourceError::ResourceError):
+        * platform/network/curl/ResourceResponse.h:
+        (WebCore::ResourceResponse::ResourceResponse):
+        * platform/network/mac/AuthenticationChallenge.h: Added.
+        (WebCore::AuthenticationChallenge::AuthenticationChallenge):
+        (WebCore::AuthenticationChallenge::sender):
+        (WebCore::AuthenticationChallenge::nsURLAuthenticationChallenge):
+        * platform/network/mac/AuthenticationMac.mm:
+        (WebCore::AuthenticationChallenge::AuthenticationChallenge):
+        (WebCore::AuthenticationChallenge::platformCompare):
+        * platform/network/mac/ResourceError.h: Added.
+        (WebCore::ResourceError::ResourceError):
+        * platform/network/mac/ResourceErrorMac.mm:
+        (WebCore::ResourceError::platformLazyInit):
+        (WebCore::ResourceError::platformCompare):
+        * platform/network/mac/ResourceResponse.h:
+        (WebCore::ResourceResponse::ResourceResponse):
+        * platform/network/mac/ResourceResponseMac.mm:
+        (WebCore::ResourceResponse::platformLazyInit):
+        (WebCore::ResourceResponse::platformCompare):
+        * platform/network/qt/AuthenticationChallenge.h: Added.
+        (WebCore::AuthenticationChallenge::AuthenticationChallenge):
+        * platform/network/qt/ResourceError.h: Added.
+        (WebCore::ResourceError::ResourceError):
+        * platform/network/qt/ResourceResponse.h:
+        (WebCore::ResourceResponse::ResourceResponse):
+        * xml/XSLTProcessor.cpp:
+
 2008-02-25  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by Darin.
index 6ab15b6e4c386a0916c654391a05162f85bed1e8..10582e4d309a0070038f10bdc9f967b2a8c54799 100644 (file)
@@ -244,7 +244,7 @@ __ZN7WebCore12iconDatabaseEv
 __ZN7WebCore13HitTestResultC1ERKS0_
 __ZN7WebCore13HitTestResultD1Ev
 __ZN7WebCore13KeyboardEventC1ERKNS_12AtomicStringEbbPNS_9DOMWindowERKNS_6StringEjbbbbb
-__ZN7WebCore13ResourceError19unpackPlatformErrorEv
+__ZNK7WebCore17ResourceErrorBase8lazyInitEv
 __ZN7WebCore13toDeviceSpaceERKNS_9FloatRectEP8NSWindow
 __ZN7WebCore14CachedResource5derefEPNS_20CachedResourceClientE
 __ZN7WebCore14DocumentLoader12setCommittedEb
index 5c3483bd3795386529eb57d529f537b89b0e649d..8cd809fa354ed11f737145918c2778a512b0fc70 100644 (file)
@@ -5223,7 +5223,7 @@ __ZNK7WebCore9DOMWindow4nameEv
 __ZN7WebCore18MainResourceLoader9didCancelERKNS_13ResourceErrorE
 __ZN7WebCore11FrameLoader25receivedMainResourceErrorERKNS_13ResourceErrorEb
 __ZN7WebCore11FrameLoader4stopEv
-__ZN7WebCore13ResourceError19unpackPlatformErrorEv
+__ZN7WebCore17ResourceErrorBase8lazyInitEv
 __ZN7WebCore11FrameLoader13didNotOpenURLERKNS_4KURLE
 __ZN7WebCore11FrameLoader31invalidateCurrentItemCachedPageEv
 __ZN7WebCore14DocumentLoader17mainReceivedErrorERKNS_13ResourceErrorEb
index 023a06df3131003c12c0120f1d3a1b17f1bab71b..092f603b43dc00a35717a3d704009f7ad1ffff8d 100644 (file)
                                Name="network"\r
                                >\r
                                <File\r
-                                       RelativePath="..\platform\network\AuthenticationChallenge.cpp"\r
+                                       RelativePath="..\platform\network\AuthenticationChallengeBase.cpp"\r
                                        >\r
                                </File>\r
                                <File\r
-                                       RelativePath="..\platform\network\AuthenticationChallenge.h"\r
+                                       RelativePath="..\platform\network\AuthenticationChallengeBase.h"\r
                                        >\r
                                </File>\r
                                <File\r
                                        >\r
                                </File>\r
                                <File\r
-                                       RelativePath="..\platform\network\ResourceError.h"\r
+                                       RelativePath="..\platform\network\ResourceErrorBase.h"\r
+                                       >\r
+                               </File>\r
+                               <File\r
+                                       RelativePath="..\platform\network\ResourceErrorBase.cpp"\r
                                        >\r
                                </File>\r
                                <File\r
                                <Filter\r
                                        Name="cf"\r
                                        >\r
+                                       <File\r
+                                               RelativePath="..\platform\network\cf\AuthenticationChallenge.h"\r
+                                               >\r
+                                       </File>\r
                                        <File\r
                                                RelativePath="..\platform\network\cf\AuthenticationCF.cpp"\r
                                                >\r
                                                RelativePath="..\platform\network\cf\FormDataStreamCFNet.h"\r
                                                >\r
                                        </File>\r
+                                       <File\r
+                                               RelativePath="..\platform\network\cf\ResourceError.h"\r
+                                               >\r
+                                       </File>\r
                                        <File\r
                                                RelativePath="..\platform\network\cf\ResourceErrorCF.cpp"\r
                                                >\r
index 4f6a6182ce926f18fdfafb887c9ce237555c8dfd..66d2a822b4d0c48f78ea424d986fa414497ded07 100644 (file)
                514C76530CE9234E007EF3CD /* ResourceRequestMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 514C76490CE9234E007EF3CD /* ResourceRequestMac.mm */; };
                514C76540CE9234E007EF3CD /* ResourceResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 514C764A0CE9234E007EF3CD /* ResourceResponse.h */; settings = {ATTRIBUTES = (Private, ); }; };
                514C76550CE9234F007EF3CD /* ResourceResponseMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 514C764B0CE9234E007EF3CD /* ResourceResponseMac.mm */; };
-               514C766B0CE923A1007EF3CD /* AuthenticationChallenge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 514C76560CE923A1007EF3CD /* AuthenticationChallenge.cpp */; };
-               514C766C0CE923A1007EF3CD /* AuthenticationChallenge.h in Headers */ = {isa = PBXBuildFile; fileRef = 514C76570CE923A1007EF3CD /* AuthenticationChallenge.h */; settings = {ATTRIBUTES = (Private, ); }; };
                514C766D0CE923A1007EF3CD /* Credential.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 514C76580CE923A1007EF3CD /* Credential.cpp */; };
                514C766E0CE923A1007EF3CD /* Credential.h in Headers */ = {isa = PBXBuildFile; fileRef = 514C76590CE923A1007EF3CD /* Credential.h */; settings = {ATTRIBUTES = (Private, ); }; };
                514C766F0CE923A1007EF3CD /* FormData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 514C765A0CE923A1007EF3CD /* FormData.cpp */; };
                514C76730CE923A1007EF3CD /* HTTPParsers.h in Headers */ = {isa = PBXBuildFile; fileRef = 514C765E0CE923A1007EF3CD /* HTTPParsers.h */; };
                514C76740CE923A1007EF3CD /* ProtectionSpace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 514C765F0CE923A1007EF3CD /* ProtectionSpace.cpp */; };
                514C76750CE923A1007EF3CD /* ProtectionSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = 514C76600CE923A1007EF3CD /* ProtectionSpace.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               514C76760CE923A1007EF3CD /* ResourceError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 514C76610CE923A1007EF3CD /* ResourceError.cpp */; };
-               514C76770CE923A1007EF3CD /* ResourceError.h in Headers */ = {isa = PBXBuildFile; fileRef = 514C76620CE923A1007EF3CD /* ResourceError.h */; settings = {ATTRIBUTES = (Private, ); }; };
                514C76780CE923A1007EF3CD /* ResourceHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 514C76630CE923A1007EF3CD /* ResourceHandle.cpp */; };
                514C76790CE923A1007EF3CD /* ResourceHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = 514C76640CE923A1007EF3CD /* ResourceHandle.h */; settings = {ATTRIBUTES = (Private, ); }; };
                514C767A0CE923A1007EF3CD /* ResourceHandleClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 514C76650CE923A1007EF3CD /* ResourceHandleClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
                93442CA00D2B336000338FF9 /* HTMLTableRowsCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93442C9F0D2B336000338FF9 /* HTMLTableRowsCollection.cpp */; };
                934D9BA50B8C116B007B42A9 /* WebCoreNSStringExtras.mm in Sources */ = {isa = PBXBuildFile; fileRef = 934D9BA40B8C116B007B42A9 /* WebCoreNSStringExtras.mm */; };
                934D9BA70B8C1175007B42A9 /* WebCoreNSStringExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 934D9BA60B8C1175007B42A9 /* WebCoreNSStringExtras.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               934F71380D5A6EFF00018D69 /* AuthenticationChallengeBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 934F71370D5A6EFF00018D69 /* AuthenticationChallengeBase.cpp */; };
+               934F713A0D5A6F1000018D69 /* AuthenticationChallengeBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 934F71390D5A6F1000018D69 /* AuthenticationChallengeBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               934F713C0D5A6F1900018D69 /* ResourceErrorBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 934F713B0D5A6F1900018D69 /* ResourceErrorBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               934F713E0D5A6F2800018D69 /* ResourceErrorBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 934F713D0D5A6F2800018D69 /* ResourceErrorBase.cpp */; };
+               934F71420D5A6F4400018D69 /* ResourceError.h in Headers */ = {isa = PBXBuildFile; fileRef = 934F71410D5A6F4400018D69 /* ResourceError.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               934F71440D5A6F5300018D69 /* AuthenticationChallenge.h in Headers */ = {isa = PBXBuildFile; fileRef = 934F71430D5A6F5300018D69 /* AuthenticationChallenge.h */; settings = {ATTRIBUTES = (Private, ); }; };
                934FE9E50B5CA539003E4A73 /* FileChooser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 934FE9E40B5CA539003E4A73 /* FileChooser.cpp */; };
                9352071909BD3BA500F2038D /* StaticConstructors.h in Headers */ = {isa = PBXBuildFile; fileRef = 9352071709BD3BA500F2038D /* StaticConstructors.h */; };
                935207BE09BD410A00F2038D /* LocalizedStrings.h in Headers */ = {isa = PBXBuildFile; fileRef = 935207BD09BD410A00F2038D /* LocalizedStrings.h */; };
                514C76490CE9234E007EF3CD /* ResourceRequestMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ResourceRequestMac.mm; sourceTree = "<group>"; };
                514C764A0CE9234E007EF3CD /* ResourceResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceResponse.h; sourceTree = "<group>"; };
                514C764B0CE9234E007EF3CD /* ResourceResponseMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ResourceResponseMac.mm; sourceTree = "<group>"; };
-               514C76560CE923A1007EF3CD /* AuthenticationChallenge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AuthenticationChallenge.cpp; sourceTree = "<group>"; };
-               514C76570CE923A1007EF3CD /* AuthenticationChallenge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthenticationChallenge.h; sourceTree = "<group>"; };
                514C76580CE923A1007EF3CD /* Credential.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Credential.cpp; sourceTree = "<group>"; };
                514C76590CE923A1007EF3CD /* Credential.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Credential.h; sourceTree = "<group>"; };
                514C765A0CE923A1007EF3CD /* FormData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FormData.cpp; sourceTree = "<group>"; };
                514C765E0CE923A1007EF3CD /* HTTPParsers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPParsers.h; sourceTree = "<group>"; };
                514C765F0CE923A1007EF3CD /* ProtectionSpace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProtectionSpace.cpp; sourceTree = "<group>"; };
                514C76600CE923A1007EF3CD /* ProtectionSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProtectionSpace.h; sourceTree = "<group>"; };
-               514C76610CE923A1007EF3CD /* ResourceError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceError.cpp; sourceTree = "<group>"; };
-               514C76620CE923A1007EF3CD /* ResourceError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceError.h; sourceTree = "<group>"; };
                514C76630CE923A1007EF3CD /* ResourceHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceHandle.cpp; sourceTree = "<group>"; };
                514C76640CE923A1007EF3CD /* ResourceHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceHandle.h; sourceTree = "<group>"; };
                514C76650CE923A1007EF3CD /* ResourceHandleClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceHandleClient.h; sourceTree = "<group>"; };
                93442C9F0D2B336000338FF9 /* HTMLTableRowsCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLTableRowsCollection.cpp; sourceTree = "<group>"; };
                934D9BA40B8C116B007B42A9 /* WebCoreNSStringExtras.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreNSStringExtras.mm; sourceTree = "<group>"; };
                934D9BA60B8C1175007B42A9 /* WebCoreNSStringExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebCoreNSStringExtras.h; sourceTree = "<group>"; };
+               934F71370D5A6EFF00018D69 /* AuthenticationChallengeBase.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AuthenticationChallengeBase.cpp; sourceTree = "<group>"; };
+               934F71390D5A6F1000018D69 /* AuthenticationChallengeBase.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AuthenticationChallengeBase.h; sourceTree = "<group>"; };
+               934F713B0D5A6F1900018D69 /* ResourceErrorBase.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ResourceErrorBase.h; sourceTree = "<group>"; };
+               934F713D0D5A6F2800018D69 /* ResourceErrorBase.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceErrorBase.cpp; sourceTree = "<group>"; };
+               934F71410D5A6F4400018D69 /* ResourceError.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ResourceError.h; sourceTree = "<group>"; };
+               934F71430D5A6F5300018D69 /* AuthenticationChallenge.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AuthenticationChallenge.h; sourceTree = "<group>"; };
                934FE9E40B5CA539003E4A73 /* FileChooser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileChooser.cpp; sourceTree = "<group>"; };
                9352071709BD3BA500F2038D /* StaticConstructors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StaticConstructors.h; sourceTree = "<group>"; };
                935207BD09BD410A00F2038D /* LocalizedStrings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalizedStrings.h; sourceTree = "<group>"; };
                656B84D70AEA1CE900A095B4 /* network */ = {
                        isa = PBXGroup;
                        children = (
+                               934F713D0D5A6F2800018D69 /* ResourceErrorBase.cpp */,
+                               934F713B0D5A6F1900018D69 /* ResourceErrorBase.h */,
+                               934F71390D5A6F1000018D69 /* AuthenticationChallengeBase.h */,
+                               934F71370D5A6EFF00018D69 /* AuthenticationChallengeBase.cpp */,
                                656B84E70AEA1DAE00A095B4 /* mac */,
-                               514C76560CE923A1007EF3CD /* AuthenticationChallenge.cpp */,
-                               514C76570CE923A1007EF3CD /* AuthenticationChallenge.h */,
                                514C76580CE923A1007EF3CD /* Credential.cpp */,
                                514C76590CE923A1007EF3CD /* Credential.h */,
                                514C765A0CE923A1007EF3CD /* FormData.cpp */,
                                514C765E0CE923A1007EF3CD /* HTTPParsers.h */,
                                514C765F0CE923A1007EF3CD /* ProtectionSpace.cpp */,
                                514C76600CE923A1007EF3CD /* ProtectionSpace.h */,
-                               514C76610CE923A1007EF3CD /* ResourceError.cpp */,
-                               514C76620CE923A1007EF3CD /* ResourceError.h */,
                                514C76630CE923A1007EF3CD /* ResourceHandle.cpp */,
                                514C76640CE923A1007EF3CD /* ResourceHandle.h */,
                                514C76650CE923A1007EF3CD /* ResourceHandleClient.h */,
                656B84E70AEA1DAE00A095B4 /* mac */ = {
                        isa = PBXGroup;
                        children = (
+                               934F71430D5A6F5300018D69 /* AuthenticationChallenge.h */,
+                               934F71410D5A6F4400018D69 /* ResourceError.h */,
                                514C76420CE9234E007EF3CD /* AuthenticationMac.h */,
                                514C76430CE9234E007EF3CD /* AuthenticationMac.mm */,
                                514C76440CE9234E007EF3CD /* FormDataStreamMac.h */,
                                B2C3DA200D006C1D00EF6F26 /* AtomicStringImpl.h in Headers */,
                                A8C4A80D09D563270003AC8D /* Attr.h in Headers */,
                                A8C4A80B09D563270003AC8D /* Attribute.h in Headers */,
-                               514C766C0CE923A1007EF3CD /* AuthenticationChallenge.h in Headers */,
                                514C764C0CE9234E007EF3CD /* AuthenticationMac.h in Headers */,
                                A8CFF04E0A154F09000A4234 /* AutoTableLayout.h in Headers */,
                                51E1ECB30C91C55600DC255B /* AutodrainedPool.h in Headers */,
                                93799EF90BF2743600D0F230 /* RenderWordBreak.h in Headers */,
                                93309E0A099E64920056E581 /* ReplaceSelectionCommand.h in Headers */,
                                BCB16C2F0979C3BD00467741 /* Request.h in Headers */,
-                               514C76770CE923A1007EF3CD /* ResourceError.h in Headers */,
                                514C76790CE923A1007EF3CD /* ResourceHandle.h in Headers */,
                                514C767A0CE923A1007EF3CD /* ResourceHandleClient.h in Headers */,
                                514C767B0CE923A1007EF3CD /* ResourceHandleInternal.h in Headers */,
                                51A9267D0D53F0570063ECC2 /* OriginQuotaManager.h in Headers */,
                                51A9267F0D53F0570063ECC2 /* OriginUsageRecord.h in Headers */,
                                5DCF836D0D59159800953BC6 /* PluginInfoStore.h in Headers */,
+                               934F713A0D5A6F1000018D69 /* AuthenticationChallengeBase.h in Headers */,
+                               934F713C0D5A6F1900018D69 /* ResourceErrorBase.h in Headers */,
+                               934F71420D5A6F4400018D69 /* ResourceError.h in Headers */,
+                               934F71440D5A6F5300018D69 /* AuthenticationChallenge.h in Headers */,
                                C0294DF40D5A6FD800CC7D6B /* UserStyleSheetLoader.h in Headers */,
                                E1DE1C080D5CE4CF0034C38F /* MessageQueue.h in Headers */,
                                37F818FD0D657606005E1F05 /* WebCoreURLResponse.h in Headers */,
                0867D690FE84028FC02AAC07 /* Project object */ = {
                        isa = PBXProject;
                        buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
-                       compatibilityVersion = "Xcode 2.4";
                        hasScannedForEncodings = 1;
                        knownRegions = (
                                English,
                        mainGroup = 0867D691FE84028FC02AAC07 /* WebKit */;
                        productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
                        projectDirPath = "";
-                       projectRoot = "";
                        targets = (
                                93F198A508245E59001E9ABC /* WebCore */,
                                DD041FBE09D9DDBE0010AF2A /* Derived Sources */,
                                B2C3DA1E0D006C1D00EF6F26 /* AtomicString.cpp in Sources */,
                                A8C4A80E09D563270003AC8D /* Attr.cpp in Sources */,
                                A8C4A80C09D563270003AC8D /* Attribute.cpp in Sources */,
-                               514C766B0CE923A1007EF3CD /* AuthenticationChallenge.cpp in Sources */,
                                514C764D0CE9234E007EF3CD /* AuthenticationMac.mm in Sources */,
                                A8CFF0500A154F09000A4234 /* AutoTableLayout.cpp in Sources */,
                                51E1ECAF0C91C54600DC255B /* AutodrainedPool.mm in Sources */,
                                93799EF80BF2743600D0F230 /* RenderWordBreak.cpp in Sources */,
                                93309E09099E64920056E581 /* ReplaceSelectionCommand.cpp in Sources */,
                                BCB16C2E0979C3BD00467741 /* Request.cpp in Sources */,
-                               514C76760CE923A1007EF3CD /* ResourceError.cpp in Sources */,
                                514C76500CE9234E007EF3CD /* ResourceErrorMac.mm in Sources */,
                                514C76780CE923A1007EF3CD /* ResourceHandle.cpp in Sources */,
                                514C76510CE9234E007EF3CD /* ResourceHandleMac.mm in Sources */,
                                BCE7B1930D4E86960075A539 /* JSHistoryCustom.cpp in Sources */,
                                51A9267C0D53F0570063ECC2 /* OriginQuotaManager.cpp in Sources */,
                                51A9267E0D53F0570063ECC2 /* OriginUsageRecord.cpp in Sources */,
+                               934F71380D5A6EFF00018D69 /* AuthenticationChallengeBase.cpp in Sources */,
+                               934F713E0D5A6F2800018D69 /* ResourceErrorBase.cpp in Sources */,
                                C0294DF30D5A6FD800CC7D6B /* UserStyleSheetLoader.cpp in Sources */,
                                37F818FE0D657606005E1F05 /* WebCoreURLResponse.mm in Sources */,
                                BCC573360D695BBE006EF517 /* DOMProgressEvent.mm in Sources */,
index de9df0f2192a804079840760631502751315d61e..fe7c95a79368458b99ef8f0f9ec72b70240587a0 100644 (file)
@@ -42,6 +42,7 @@
 #include "HTMLStyleElement.h"
 #include "HTMLTokenizer.h"
 #include "ProcessingInstruction.h"
+#include "ResourceError.h"
 #include "ResourceHandle.h"
 #include "ResourceRequest.h"
 #include "ResourceResponse.h"
index 3f1784f669f846a2c87d7c371fe446599419a151..48d4f50f2c6e6fad12b8a190ee1a8d19bb1c88e4 100644 (file)
@@ -32,7 +32,6 @@
 #include "ResourceHandleClient.h"
 #include "ResourceRequest.h"
 #include "ResourceResponse.h"
-#include "ResourceLoader.h"
 #include <wtf/RefCounted.h>
 #include "AuthenticationChallenge.h"
 #include "KURL.h"
similarity index 63%
rename from WebCore/platform/network/AuthenticationChallenge.cpp
rename to WebCore/platform/network/AuthenticationChallengeBase.cpp
index f7275f3f872dd08955dbc69dd1f5ae8cce70391a..df80441be3bc1489feed504c74fa785397e940f9 100644 (file)
 
 namespace WebCore {
 
-AuthenticationChallenge::AuthenticationChallenge()
+AuthenticationChallengeBase::AuthenticationChallengeBase()
     : m_isNull(true)
     , m_previousFailureCount(0)
 {
 }
 
-AuthenticationChallenge::AuthenticationChallenge(const ProtectionSpace& protectionSpace, const Credential& proposedCredential, 
-                                                       unsigned previousFailureCount, const ResourceResponse& response, const ResourceError& error)
+AuthenticationChallengeBase::AuthenticationChallengeBase(const ProtectionSpace& protectionSpace,
+                                                         const Credential& proposedCredential,
+                                                         unsigned previousFailureCount,
+                                                         const ResourceResponse& response,
+                                                         const ResourceError& error)
     : m_isNull(false)
     , m_protectionSpace(protectionSpace)
     , m_proposedCredential(proposedCredential)
@@ -46,62 +49,49 @@ AuthenticationChallenge::AuthenticationChallenge(const ProtectionSpace& protecti
 {
 }
 
-unsigned AuthenticationChallenge::previousFailureCount() const 
+unsigned AuthenticationChallengeBase::previousFailureCount() const 
 { 
     return m_previousFailureCount; 
 }
 
-const Credential& AuthenticationChallenge::proposedCredential() const 
+const Credential& AuthenticationChallengeBase::proposedCredential() const 
 { 
     return m_proposedCredential; 
 }
 
-const ProtectionSpace& AuthenticationChallenge::protectionSpace() const 
+const ProtectionSpace& AuthenticationChallengeBase::protectionSpace() const 
 { 
     return m_protectionSpace; 
 }
 
-const ResourceResponse& AuthenticationChallenge::failureResponse() const 
+const ResourceResponse& AuthenticationChallengeBase::failureResponse() const 
 { 
     return m_failureResponse; 
 }
 
-const ResourceError& AuthenticationChallenge::error() const 
+const ResourceError& AuthenticationChallengeBase::error() const 
 { 
     return m_error; 
 }
 
-bool AuthenticationChallenge::isNull() const
+bool AuthenticationChallengeBase::isNull() const
 {
     return m_isNull;
 }
 
-void AuthenticationChallenge::nullify()
+void AuthenticationChallengeBase::nullify()
 {
     m_isNull = true;
 }
 
-bool operator==(const AuthenticationChallenge& a, const AuthenticationChallenge& b)
+bool AuthenticationChallengeBase::compare(const AuthenticationChallenge& a, const AuthenticationChallenge& b)
 {
-    if (a.isNull() != b.isNull())
-        return false;
-    if (a.isNull())
+    if (a.isNull() && b.isNull())
         return true;
-        
-#if PLATFORM(MAC)
-    if (a.sender() != b.sender())
-        return false;
-        
-    if (a.nsURLAuthenticationChallenge() != b.nsURLAuthenticationChallenge())
-        return false;
-#elif USE(CFNETWORK)
-    if (a.sourceHandle() != b.sourceHandle())
-        return false;
 
-    if (a.cfURLAuthChallengeRef() != b.cfURLAuthChallengeRef())
+    if (a.isNull() || b.isNull())
         return false;
-#endif
-
+        
     if (a.protectionSpace() != b.protectionSpace())
         return false;
         
@@ -117,14 +107,7 @@ bool operator==(const AuthenticationChallenge& a, const AuthenticationChallenge&
     if (a.error() != b.error())
         return false;
         
-    return true;
-}
-
-bool operator!=(const AuthenticationChallenge& a, const AuthenticationChallenge& b)
-{
-    return !(a == b);
+    return AuthenticationChallenge::platformCompare(a, b);
 }
 
 }
-
-
diff --git a/WebCore/platform/network/AuthenticationChallengeBase.h b/WebCore/platform/network/AuthenticationChallengeBase.h
new file mode 100644 (file)
index 0000000..c8d0f05
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2007 Apple 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. 
+ */
+#ifndef AuthenticationChallengeBase_h
+#define AuthenticationChallengeBase_h
+
+#include "Credential.h"
+#include "ProtectionSpace.h"
+#include "ResourceResponse.h"
+#include "ResourceError.h"
+
+namespace WebCore {
+
+class AuthenticationChallenge;
+
+class AuthenticationChallengeBase {
+public:
+    AuthenticationChallengeBase();
+    AuthenticationChallengeBase(const ProtectionSpace& protectionSpace, const Credential& proposedCredential, unsigned previousFailureCount, const ResourceResponse& response, const ResourceError& error);
+
+    unsigned previousFailureCount() const;
+    const Credential& proposedCredential() const;
+    const ProtectionSpace& protectionSpace() const;
+    const ResourceResponse& failureResponse() const;
+    const ResourceError& error() const;
+    
+    bool isNull() const;
+    void nullify();
+
+    static bool compare(const AuthenticationChallenge& a, const AuthenticationChallenge& b);
+
+protected:
+    // The AuthenticationChallenge subclass may "shadow" this method to compare platform specific fields
+    static bool platformCompare(const ResourceError& a, const ResourceError& b) { return true; }
+
+    bool m_isNull;
+    ProtectionSpace m_protectionSpace;
+    Credential m_proposedCredential;
+    unsigned m_previousFailureCount;
+    ResourceResponse m_failureResponse;
+    ResourceError m_error;
+};
+
+inline bool operator==(const AuthenticationChallenge& a, const AuthenticationChallenge& b) { return AuthenticationChallengeBase::compare(a, b); }
+inline bool operator!=(const AuthenticationChallenge& a, const AuthenticationChallenge& b) { return !(a == b); }
+
+}
+
+#endif
diff --git a/WebCore/platform/network/ResourceError.h b/WebCore/platform/network/ResourceError.h
deleted file mode 100644 (file)
index 165dccd..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-// -*- mode: c++; c-basic-offset: 4 -*-
-/*
- * Copyright (C) 2006 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. 
- */
-
-#ifndef ResourceError_h
-#define ResourceError_h
-
-#include "PlatformString.h"
-
-#if PLATFORM(CF)
-#include <wtf/RetainPtr.h>
-#endif
-
-#ifdef __OBJC__
-@class NSError;
-#else
-class NSError;
-#endif
-
-#if USE(CFNETWORK)
-#include <CoreFoundation/CFStream.h>
-#endif
-
-namespace WebCore {
-
-    class ResourceError {
-    public:
-        ResourceError()
-            : m_errorCode(0)
-#if PLATFORM(CF)
-            , m_dataIsUpToDate(true)
-#endif
-            , m_isNull(true)
-        {
-        }
-
-        ResourceError(const String& domain, int errorCode, const String& failingURL, const String& localizedDescription)
-            : m_domain(domain)
-            , m_errorCode(errorCode)
-            , m_failingURL(failingURL)
-            , m_localizedDescription(localizedDescription)
-#if PLATFORM(CF)
-            , m_dataIsUpToDate(true)
-#endif
-            , m_isNull(false)
-        {
-        }
-
-#if PLATFORM(CF)
-#if PLATFORM(MAC)
-        ResourceError(NSError* error)
-#else
-        ResourceError(CFStreamError error);
-        ResourceError(CFErrorRef error)
-#endif
-            : m_dataIsUpToDate(false)
-            , m_platformError(error)
-            , m_isNull(!error)
-        {
-        }
-#endif
-
-#if 0
-        static const String CocoaErrorDomain;
-        static const String POSIXDomain;
-        static const String OSStatusDomain;
-        static const String MachDomain;
-        static const String WebKitDomain;
-#endif
-
-        bool isNull() const { return m_isNull; }
-
-        const String& domain() const { unpackPlatformErrorIfNeeded(); return m_domain; }
-        int errorCode() const { unpackPlatformErrorIfNeeded(); return m_errorCode; }
-        const String& failingURL() const { unpackPlatformErrorIfNeeded(); return m_failingURL; }
-        const String& localizedDescription() const { unpackPlatformErrorIfNeeded(); return m_localizedDescription; }
-
-#if PLATFORM(CF)
-#if PLATFORM(MAC)
-        operator NSError*() const;
-#else
-        operator CFErrorRef() const;
-        operator CFStreamError() const;
-#endif
-#endif
-
-    private:
-        void unpackPlatformErrorIfNeeded() const
-        {
-#if PLATFORM(CF)
-            if (!m_dataIsUpToDate)
-                const_cast<ResourceError*>(this)->unpackPlatformError();
-#endif
-        }
-
-#if PLATFORM(CF)
-        void unpackPlatformError();
-#endif
-
-        String m_domain;
-        int m_errorCode;
-        String m_failingURL;
-        String m_localizedDescription;
-#if PLATFORM(CF)
-        bool m_dataIsUpToDate;
-#endif
-#if PLATFORM(MAC)
-        mutable RetainPtr<NSError> m_platformError;
-#elif PLATFORM(CF)
-        mutable RetainPtr<CFErrorRef> m_platformError;
-#endif
-        bool m_isNull;
-};
-
-inline bool operator==(const ResourceError& a, const ResourceError& b)
-{
-    if (a.isNull() && b.isNull())
-        return true;
-    if (a.isNull() || b.isNull())
-        return false;
-    if (a.domain() != b.domain())
-        return false;
-    if (a.errorCode() != b.errorCode())
-        return false;
-    if (a.failingURL() != b.failingURL())
-        return false;
-    if (a.localizedDescription() != b.localizedDescription())
-        return false;
-#if PLATFORM(CF)
-#if PLATFORM(MAC)
-    if ((NSError *)a != (NSError *)b)
-        return false;
-#else
-    if ((CFErrorRef)a != (CFErrorRef)b)
-        return false;
-#endif
-#endif
-    return true;
-}
-
-inline bool operator!=(const ResourceError& a, const ResourceError& b) { return !(a == b); }
-
-} // namespace WebCore
-
-#endif // ResourceError_h_
diff --git a/WebCore/platform/network/ResourceErrorBase.cpp b/WebCore/platform/network/ResourceErrorBase.cpp
new file mode 100644 (file)
index 0000000..5dfc890
--- /dev/null
@@ -0,0 +1,60 @@
+// -*- mode: c++; c-basic-offset: 4 -*-
+/*
+ * Copyright (C) 2006 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 "ResourceError.h"
+
+namespace WebCore {
+
+void ResourceErrorBase::lazyInit() const
+{
+    const_cast<ResourceError*>(static_cast<const ResourceError*>(this))->platformLazyInit();
+}
+
+bool ResourceErrorBase::compare(const ResourceError& a, const ResourceError& b)
+{
+    if (a.isNull() && b.isNull())
+        return true;
+
+    if (a.isNull() || b.isNull())
+        return false;
+
+    if (a.domain() != b.domain())
+        return false;
+
+    if (a.errorCode() != b.errorCode())
+        return false;
+
+    if (a.failingURL() != b.failingURL())
+        return false;
+
+    if (a.localizedDescription() != b.localizedDescription())
+        return false;
+
+    return platformCompare(a, b);
+}
+
+}
diff --git a/WebCore/platform/network/ResourceErrorBase.h b/WebCore/platform/network/ResourceErrorBase.h
new file mode 100644 (file)
index 0000000..ccdf36a
--- /dev/null
@@ -0,0 +1,83 @@
+// -*- mode: c++; c-basic-offset: 4 -*-
+/*
+ * Copyright (C) 2006 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. 
+ */
+
+#ifndef ResourceErrorBase_h
+#define ResourceErrorBase_h
+
+#include "PlatformString.h"
+
+namespace WebCore {
+
+class ResourceError;
+
+class ResourceErrorBase {
+public:
+    bool isNull() const { return m_isNull; }
+
+    const String& domain() const { lazyInit(); return m_domain; }
+    int errorCode() const { lazyInit(); return m_errorCode; }
+    const String& failingURL() const { lazyInit(); return m_failingURL; }
+    const String& localizedDescription() const { lazyInit(); return m_localizedDescription; }
+
+    static bool compare(const ResourceError& a, const ResourceError& b);
+
+protected:
+    ResourceErrorBase()
+        : m_errorCode(0)
+        , m_isNull(true)
+    {
+    }
+
+    ResourceErrorBase(const String& domain, int errorCode, const String& failingURL, const String& localizedDescription)
+        : m_domain(domain)
+        , m_errorCode(errorCode)
+        , m_failingURL(failingURL)
+        , m_localizedDescription(localizedDescription)
+        , m_isNull(false)
+    {
+    }
+
+    void lazyInit() const;
+
+    // The ResourceError subclass may "shadow" this method to lazily initialize platform specific fields
+    void platformLazyInit() {}
+
+    // The ResourceError subclass may "shadow" this method to compare platform specific fields
+    static bool platformCompare(const ResourceError& a, const ResourceError& b) { return true; }
+
+    String m_domain;
+    int m_errorCode;
+    String m_failingURL;
+    String m_localizedDescription;
+    bool m_isNull;
+};
+
+inline bool operator==(const ResourceError& a, const ResourceError& b) { return ResourceErrorBase::compare(a, b); }
+inline bool operator!=(const ResourceError& a, const ResourceError& b) { return !(a == b); }
+
+} // namespace WebCore
+
+#endif // ResourceErrorBase_h_
index 06cc5ce99a7cd2b7501a2907bf4a7e783ff046f6..0c41847e42741237c38cf0b7d3942cb31508806a 100644 (file)
 
 namespace WebCore {
 
-inline const ResourceResponse& ResourceResponseBase::asResourceResponse() const
-{
-    return *static_cast<const ResourceResponse*>(this);
-}
-
 bool ResourceResponseBase::isHTTP() const
 {
-    updateResourceResponse();
+    lazyInit();
 
     String protocol = m_url.protocol();
 
@@ -46,14 +41,14 @@ bool ResourceResponseBase::isHTTP() const
 
 const KURL& ResourceResponseBase::url() const
 {
-    updateResourceResponse();
+    lazyInit();
     
     return m_url; 
 }
 
 void ResourceResponseBase::setUrl(const KURL& url)
 {
-    updateResourceResponse();
+    lazyInit();
     m_isNull = false;
     
     m_url = url; 
@@ -61,14 +56,14 @@ void ResourceResponseBase::setUrl(const KURL& url)
 
 const String& ResourceResponseBase::mimeType() const
 {
-    updateResourceResponse();
+    lazyInit();
 
     return m_mimeType; 
 }
 
 void ResourceResponseBase::setMimeType(const String& mimeType)
 {
-    updateResourceResponse();
+    lazyInit();
     m_isNull = false;
     
     m_mimeType = mimeType; 
@@ -76,14 +71,14 @@ void ResourceResponseBase::setMimeType(const String& mimeType)
 
 long long ResourceResponseBase::expectedContentLength() const 
 {
-    updateResourceResponse();
+    lazyInit();
 
     return m_expectedContentLength;
 }
 
 void ResourceResponseBase::setExpectedContentLength(long long expectedContentLength)
 {
-    updateResourceResponse();
+    lazyInit();
     m_isNull = false;
     
     m_expectedContentLength = expectedContentLength; 
@@ -91,14 +86,14 @@ void ResourceResponseBase::setExpectedContentLength(long long expectedContentLen
 
 const String& ResourceResponseBase::textEncodingName() const
 {
-    updateResourceResponse();
+    lazyInit();
 
     return m_textEncodingName;
 }
 
 void ResourceResponseBase::setTextEncodingName(const String& encodingName)
 {
-    updateResourceResponse();
+    lazyInit();
     m_isNull = false;
     
     m_textEncodingName = encodingName; 
@@ -107,14 +102,14 @@ void ResourceResponseBase::setTextEncodingName(const String& encodingName)
 // FIXME should compute this on the fly
 const String& ResourceResponseBase::suggestedFilename() const
 {
-    updateResourceResponse();
+    lazyInit();
 
     return m_suggestedFilename;
 }
 
 void ResourceResponseBase::setSuggestedFilename(const String& suggestedName)
 {
-    updateResourceResponse();
+    lazyInit();
     m_isNull = false;
     
     m_suggestedFilename = suggestedName; 
@@ -122,56 +117,56 @@ void ResourceResponseBase::setSuggestedFilename(const String& suggestedName)
 
 int ResourceResponseBase::httpStatusCode() const
 {
-    updateResourceResponse();
+    lazyInit();
 
     return m_httpStatusCode;
 }
 
 void ResourceResponseBase::setHTTPStatusCode(int statusCode)
 {
-    updateResourceResponse();
+    lazyInit();
 
     m_httpStatusCode = statusCode;
 }
 
 const String& ResourceResponseBase::httpStatusText() const 
 {
-    updateResourceResponse();
+    lazyInit();
 
     return m_httpStatusText; 
 }
 
 void ResourceResponseBase::setHTTPStatusText(const String& statusText) 
 {
-    updateResourceResponse();
+    lazyInit();
 
     m_httpStatusText = statusText; 
 }
 
 String ResourceResponseBase::httpHeaderField(const String& name) const
 {
-    updateResourceResponse();
+    lazyInit();
 
     return m_httpHeaderFields.get(name); 
 }
 
 void ResourceResponseBase::setHTTPHeaderField(const String& name, const String& value)
 {
-    updateResourceResponse();
+    lazyInit();
 
     m_httpHeaderFields.set(name, value);
 }
 
 const HTTPHeaderMap& ResourceResponseBase::httpHeaderFields() const
 {
-    updateResourceResponse();
+    lazyInit();
 
     return m_httpHeaderFields; 
 }
 
 bool ResourceResponseBase::isAttachment() const
 {
-    updateResourceResponse();
+    lazyInit();
 
     String value = m_httpHeaderFields.get("Content-Disposition");
     int loc = value.find(';');
@@ -183,43 +178,38 @@ bool ResourceResponseBase::isAttachment() const
 
 void ResourceResponseBase::setExpirationDate(time_t expirationDate)
 {
-    updateResourceResponse();
+    lazyInit();
 
     m_expirationDate = expirationDate;
 }
 
 time_t ResourceResponseBase::expirationDate() const
 {
-    updateResourceResponse();
+    lazyInit();
 
     return m_expirationDate; 
 }
 
 void ResourceResponseBase::setLastModifiedDate(time_t lastModifiedDate) 
 {
-    updateResourceResponse();
+    lazyInit();
 
     m_lastModifiedDate = lastModifiedDate;
 }
 
 time_t ResourceResponseBase::lastModifiedDate() const
 {
-    updateResourceResponse();
+    lazyInit();
 
     return m_lastModifiedDate;
 }
 
-void ResourceResponseBase::updateResourceResponse() const
+void ResourceResponseBase::lazyInit() const
 {
-    if (m_isUpToDate)
-        return;
-
-    const_cast<ResourceResponse&>(asResourceResponse()).doUpdateResourceResponse();
-
-    m_isUpToDate = true;
+    const_cast<ResourceResponse*>(static_cast<const ResourceResponse*>(this))->platformLazyInit();
 }
 
-bool operator==(const ResourceResponse& a, const ResourceResponse& b)
+bool ResourceResponseBase::compare(const ResourceResponse& a, const ResourceResponse& b)
 {
     if (a.isNull() != b.isNull())
         return false;  
@@ -241,11 +231,7 @@ bool operator==(const ResourceResponse& a, const ResourceResponse& b)
         return false;
     if (a.expirationDate() != b.expirationDate())
         return false;
-#if PLATFORM(MAC)
-    if (a.nsURLResponse() != b.nsURLResponse())
-        return false;
-#endif
-    return true;
- }
+    return ResourceResponse::platformCompare(a, b);
+}
 
 }
index 50b6c438db022c6b8e56b887f04c8214d62b7a76..503156a90c7bb8b7336ca24270595ee48858c972 100644 (file)
@@ -77,21 +77,16 @@ class ResourceResponseBase {
     void setLastModifiedDate(time_t);
     time_t lastModifiedDate() const;
 
-    inline const ResourceResponse& asResourceResponse() const;
+    static bool compare(const ResourceResponse& a, const ResourceResponse& b);
 
- protected:
-    // Used when response is initialized from a platform representation
-    ResourceResponseBase(bool isNull)
-        : m_isUpToDate(false)
-        , m_isNull(isNull)
-    {
-    }
+    const ResourceResponse& asResourceResponse() const;
 
+ protected:
     ResourceResponseBase()  
         : m_expectedContentLength(0)
         , m_httpStatusCode(0)
         , m_expirationDate(0)
-        , m_isUpToDate(true)
+        , m_lastModifiedDate(0)
         , m_isNull(true)
     {
     }
@@ -104,29 +99,34 @@ class ResourceResponseBase {
         , m_suggestedFilename(filename)
         , m_httpStatusCode(0)
         , m_expirationDate(0)
-        , m_isUpToDate(true)
+        , m_lastModifiedDate(0)
         , m_isNull(false)
     {
     }
 
-    void updateResourceResponse() const;
+    void lazyInit() const;
+
+    // The ResourceResponse subclass may "shadow" this method to lazily initialize platform specific fields
+    void platformLazyInit() {}
+
+    // The ResourceResponse subclass may "shadow" this method to compare platform specific fields
+    static bool platformCompare(const ResourceResponse& a, const ResourceResponse& b) { return true; }
 
     KURL m_url;
     String m_mimeType;
     long long m_expectedContentLength;
     String m_textEncodingName;
     String m_suggestedFilename;
-    mutable int m_httpStatusCode;
+    int m_httpStatusCode;
     String m_httpStatusText;
     HTTPHeaderMap m_httpHeaderFields;
     time_t m_expirationDate;
     time_t m_lastModifiedDate;
-    mutable bool m_isUpToDate;
     bool m_isNull;
 
 };
 
-bool operator==(const ResourceResponse& a, const ResourceResponse& b);
+inline bool operator==(const ResourceResponse& a, const ResourceResponse& b) { return ResourceResponseBase::compare(a, b); }
 inline bool operator!=(const ResourceResponse& a, const ResourceResponse& b) { return !(a == b); }
 
 } // namespace WebCore
index 72a6c9a7206f46991e64265950e668b5528a95c3..bb05a390440516a2356b1be095d748ff0d37d778 100644 (file)
 
 namespace WebCore {
 
-AuthenticationChallenge::AuthenticationChallenge(CFURLAuthChallengeRef cfChallenge, ResourceHandle* sourceHandle)
-    : m_isNull(false)
-    , m_protectionSpace(core(CFURLAuthChallengeGetProtectionSpace(cfChallenge)))
-    , m_proposedCredential(core(CFURLAuthChallengeGetProposedCredential(cfChallenge)))
-    , m_previousFailureCount(CFURLAuthChallengeGetPreviousFailureCount(cfChallenge))
-    , m_failureResponse((CFURLResponseRef)CFURLAuthChallengeGetFailureResponse(cfChallenge))
-    , m_error(CFURLAuthChallengeGetError(cfChallenge))
+AuthenticationChallenge::AuthenticationChallenge(const ProtectionSpace& protectionSpace,
+                                                 const Credential& proposedCredential,
+                                                 unsigned previousFailureCount,
+                                                 const ResourceResponse& response,
+                                                 const ResourceError& error)
+    : AuthenticationChallengeBase(protectionSpace,
+                                  proposedCredential,
+                                  previousFailureCount,
+                                  response,
+                                  error)
+{
+}
+
+AuthenticationChallenge::AuthenticationChallenge(CFURLAuthChallengeRef cfChallenge,
+                                                 ResourceHandle* sourceHandle)
+    : AuthenticationChallengeBase(core(CFURLAuthChallengeGetProtectionSpace(cfChallenge)),
+                                  core(CFURLAuthChallengeGetProposedCredential(cfChallenge)),
+                                  CFURLAuthChallengeGetPreviousFailureCount(cfChallenge),
+                                  (CFURLResponseRef)CFURLAuthChallengeGetFailureResponse(cfChallenge),
+                                  CFURLAuthChallengeGetError(cfChallenge))
     , m_sourceHandle(sourceHandle)
     , m_cfChallenge(cfChallenge)
 {
 }
 
+bool AuthenticationChallenge::platformCompare(const AuthenticationChallenge& a, const AuthenticationChallenge& b)
+{
+    if (a.sourceHandle() != b.sourceHandle())
+        return false;
+
+    if (a.cfURLAuthChallengeRef() != b.cfURLAuthChallengeRef())
+        return false;
+        
+    return true;
+}
+
 CFURLAuthChallengeRef createCF(const AuthenticationChallenge& coreChallenge)
 {  
     CFURLProtectionSpaceRef protectionSpace = createCF(coreChallenge.protectionSpace());
diff --git a/WebCore/platform/network/cf/AuthenticationChallenge.h b/WebCore/platform/network/cf/AuthenticationChallenge.h
new file mode 100644 (file)
index 0000000..9697d7e
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2007 Apple 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. 
+ */
+#ifndef AuthenticationChallenge_h
+#define AuthenticationChallenge_h
+
+#include "AuthenticationChallengeBase.h"
+#include "ResourceHandle.h"
+#include <wtf/RefPtr.h>
+
+typedef struct _CFURLAuthChallenge* CFURLAuthChallengeRef;
+
+namespace WebCore {
+
+class ResourceHandle;
+
+class AuthenticationChallenge : public AuthenticationChallengeBase {
+public:
+    AuthenticationChallenge() {}
+    AuthenticationChallenge(const ProtectionSpace& protectionSpace, const Credential& proposedCredential, unsigned previousFailureCount, const ResourceResponse& response, const ResourceError& error);
+    AuthenticationChallenge(CFURLAuthChallengeRef, ResourceHandle* sourceHandle);
+
+    ResourceHandle* sourceHandle() const { return m_sourceHandle.get(); }
+    CFURLAuthChallengeRef cfURLAuthChallengeRef() const { return m_cfChallenge.get(); }
+
+private:
+    friend class AuthenticationChallengeBase;
+    static bool platformCompare(const AuthenticationChallenge& a, const AuthenticationChallenge& b);
+
+    RefPtr<ResourceHandle> m_sourceHandle;
+    RetainPtr<CFURLAuthChallengeRef> m_cfChallenge;
+};
+
+}
+
+#endif
diff --git a/WebCore/platform/network/cf/ResourceError.h b/WebCore/platform/network/cf/ResourceError.h
new file mode 100644 (file)
index 0000000..1cde47e
--- /dev/null
@@ -0,0 +1,74 @@
+// -*- mode: c++; c-basic-offset: 4 -*-
+/*
+ * Copyright (C) 2006 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. 
+ */
+
+#ifndef ResourceError_h
+#define ResourceError_h
+
+#include "ResourceErrorBase.h"
+
+#include <wtf/RetainPtr.h>
+#include <CoreFoundation/CFStream.h>
+
+namespace WebCore {
+
+class ResourceError : public ResourceErrorBase {
+public:
+    ResourceError()
+        : m_dataIsUpToDate(true)
+    {
+    }
+
+    ResourceError(const String& domain, int errorCode, const String& failingURL, const String& localizedDescription)
+        : ResourceErrorBase(domain, errorCode, failingURL, localizedDescription)
+        , m_dataIsUpToDate(true)
+    {
+    }
+
+    ResourceError(CFStreamError error);
+
+    ResourceError(CFErrorRef error)
+        : m_dataIsUpToDate(false)
+        , m_platformError(error)
+    {
+        m_isNull = !error;
+    }
+
+    operator CFErrorRef() const;
+    operator CFStreamError() const;
+
+private:
+    friend class ResourceErrorBase;
+
+    void platformLazyInit();
+    static bool platformCompare(const ResourceError& a, const ResourceError& b);
+
+    bool m_dataIsUpToDate;
+    mutable RetainPtr<CFErrorRef> m_platformError;
+};
+
+} // namespace WebCore
+
+#endif // ResourceError_h_
index 5bcc091b98ffab677d70356d22167393ba0e6ad9..8e82cd5bd4024817720a5fca846a82fdf9d2afb5 100644 (file)
@@ -45,10 +45,11 @@ const CFStringRef failingURLKey = CFSTR("NSErrorFailingURLKey");
 
 // FIXME: Once <rdar://problem/5050841> is fixed we can remove this constructor.
 ResourceError::ResourceError(CFStreamError error)
-    : m_errorCode(error.error)
-    , m_isNull(false)
-    , m_dataIsUpToDate(true)
+    : m_dataIsUpToDate(true)
 {
+    m_isNull = false;
+    m_errorCode = error.error;
+
     switch(error.domain) {
     case kCFStreamErrorDomainCustom:
         m_domain ="NSCustomErrorDomain";
@@ -62,8 +63,11 @@ ResourceError::ResourceError(CFStreamError error)
     }
 }
 
-void ResourceError::unpackPlatformError()
+void ResourceError::platformLazyInit()
 {
+    if (m_dataIsUpToDate)
+        return;
+
     if (!m_platformError)
         return;
 
@@ -102,6 +106,11 @@ void ResourceError::unpackPlatformError()
     m_dataIsUpToDate = true;
 }
 
+bool ResourceError::platformCompare(const ResourceError& a, const ResourceError& b)
+{
+    return (CFErrorRef)a == (CFErrorRef)b;
+}
+
 ResourceError::operator CFErrorRef() const
 {
     if (m_isNull) {
@@ -133,7 +142,7 @@ ResourceError::operator CFErrorRef() const
 
 ResourceError::operator CFStreamError() const
 {
-    unpackPlatformErrorIfNeeded();
+    lazyInit();
 
     CFStreamError result;
     result.error = m_errorCode;
index c930dfc0839c56f8f03abbb9057001812974234d..182eab803071a19a13ac470bdd3118307cde38b2 100644 (file)
@@ -36,13 +36,16 @@ namespace WebCore {
 class ResourceResponse : public ResourceResponseBase {
 public:
     ResourceResponse()
-        : ResourceResponseBase()
+        : m_isUpToDate(true)
     {
     }
 
     ResourceResponse(CFURLResponseRef cfResponse)
-        : ResourceResponseBase(!cfResponse)
-        , m_cfResponse(cfResponse) { }
+        : m_cfResponse(cfResponse)
+        , m_isUpToDate(false)
+    {
+        m_isNull = !cfResponse;
+    }
 
     ResourceResponse(const KURL& url, const String& mimeType, long long expectedLength, const String& textEncodingName, const String& filename)
         : ResourceResponseBase(url, mimeType, expectedLength, textEncodingName, filename)
@@ -54,10 +57,11 @@ public:
 private:
     friend class ResourceResponseBase;
 
-    void doUpdateResourceResponse();
+    void platformLazyInit();
+    static bool platformCompare(const ResourceResponse& a, const ResourceResponse& b);
 
     RetainPtr<CFURLResponseRef> m_cfResponse;
-
+    bool m_isUpToDate;
 };
 
 } // namespace WebCore
index d643f8eb510702624366281aec4642333a4088c2..16b99659dc5b56b197a42fc3ace8148a67315c56 100644 (file)
@@ -62,10 +62,16 @@ static time_t toTimeT(CFAbsoluteTime time)
     return min(max(minTimeAsDouble, time + kCFAbsoluteTimeIntervalSince1970), maxTimeAsDouble);
 }
 
-void ResourceResponse::doUpdateResourceResponse()
+void ResourceResponse::platformLazyInit()
 {
-    if (!m_cfResponse.get())
+    if (m_isUpToDate)
         return;
+    m_isUpToDate = true;
+
+    if (m_isNull) {
+        ASSERT(!m_cfResponse.get());
+        return;
+    }
 
     // FIXME: We may need to do MIME type sniffing here (unless that is done in CFURLResponseGetMIMEType).
 
diff --git a/WebCore/platform/network/curl/AuthenticationChallenge.h b/WebCore/platform/network/curl/AuthenticationChallenge.h
new file mode 100644 (file)
index 0000000..753ac6f
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2007 Apple 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. 
+ */
+#ifndef AuthenticationChallenge_h
+#define AuthenticationChallenge_h
+
+#include "AuthenticationChallengeBase.h"
+
+namespace WebCore {
+
+class AuthenticationChallenge : public AuthenticationChallengeBase {
+public:
+    AuthenticationChallenge()
+    {
+    }
+
+    AuthenticationChallenge(const ProtectionSpace& protectionSpace, const Credential& proposedCredential, unsigned previousFailureCount, const ResourceResponse& response, const ResourceError& error)
+        : AuthenticationChallengeBase(protectionSpace, proposedCredential, previousFailureCount, response, error)
+    {
+    }
+};
+
+}
+
+#endif
similarity index 76%
rename from WebCore/platform/network/ResourceError.cpp
rename to WebCore/platform/network/curl/ResourceError.h
index fd0674ca88734fc233654c1cd70c22ab05b9b141..0a8eb647d4734a76c3471325e11b392fa9f31bfc 100644 (file)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#include "config.h"
-#include "ResourceError.h"
+#ifndef ResourceError_h
+#define ResourceError_h
 
+#include "ResourceErrorBase.h"
+
+namespace WebCore {
+
+class ResourceError : public ResourceErrorBase
+{
+public:
+    ResourceError()
+    {
+    }
+
+    ResourceError(const String& domain, int errorCode, const String& failingURL, const String& localizedDescription)
+        : ResourceErrorBase(domain, errorCode, failingURL, localizedDescription)
+    {
+    }
+};
+
+}
+
+#endif // ResourceError_h_
index ca364b617dda57ed95b8a5ef8c5bfe528493477f..086eae8ae8241fc58a0a61a419423ed52186baa7 100644 (file)
@@ -34,8 +34,7 @@ namespace WebCore {
 class ResourceResponse : public ResourceResponseBase {
 public:
     ResourceResponse()
-        : ResourceResponseBase(false),
-          m_responseFired(false)
+        : m_responseFired(false)
     {
     }
 
@@ -49,14 +48,7 @@ public:
     bool responseFired() { return m_responseFired; }
 
 private:
-    friend class ResourceResponseBase;
-
-    void doUpdateResourceResponse()
-    {
-    }
-
     bool m_responseFired;
-
 };
 
 } // namespace WebCore
similarity index 59%
rename from WebCore/platform/network/AuthenticationChallenge.h
rename to WebCore/platform/network/mac/AuthenticationChallenge.h
index 3e46ea4227fc97280e398ae746c1c51e6b931e49..e8f3a2d1634e3070f8112e3622dbad791dec75d1 100644 (file)
 #ifndef AuthenticationChallenge_h
 #define AuthenticationChallenge_h
 
-#include "Credential.h"
-#include "ProtectionSpace.h"
-#include "ResourceResponse.h"
-#include "ResourceError.h"
+#include "AuthenticationChallengeBase.h"
 
-#include <wtf/RefPtr.h>
-
-
-#if PLATFORM(MAC)
 #include <wtf/RetainPtr.h>
 #ifndef __OBJC__
 typedef struct objc_object *id;
@@ -41,64 +34,26 @@ class NSURLAuthenticationChallenge;
 #else
 @class NSURLAuthenticationChallenge;
 #endif
-#endif
-
-#if USE(CFNETWORK)
-typedef struct _CFURLAuthChallenge* CFURLAuthChallengeRef;
-#endif
-
 
 namespace WebCore {
 
-class ResourceHandle;
-
-class AuthenticationChallenge {
-
+class AuthenticationChallenge : public AuthenticationChallengeBase {
 public:
-    AuthenticationChallenge();
+    AuthenticationChallenge() {}
     AuthenticationChallenge(const ProtectionSpace& protectionSpace, const Credential& proposedCredential, unsigned previousFailureCount, const ResourceResponse& response, const ResourceError& error);
-#if PLATFORM(MAC)
     AuthenticationChallenge(NSURLAuthenticationChallenge *);
-#elif USE(CFNETWORK)
-    AuthenticationChallenge(CFURLAuthChallengeRef, ResourceHandle* sourceHandle);
-#endif
 
-    unsigned previousFailureCount() const;
-    const Credential& proposedCredential() const;
-    const ProtectionSpace& protectionSpace() const;
-    const ResourceResponse& failureResponse() const;
-    const ResourceError& error() const;
-    
-    bool isNull() const;
-    void nullify();
-    
-#if PLATFORM(MAC)
     id sender() const { return m_sender.get(); }
     NSURLAuthenticationChallenge *nsURLAuthenticationChallenge() const { return m_macChallenge.get(); }
-#elif USE(CFNETWORK)
-    ResourceHandle* sourceHandle() const { return m_sourceHandle.get(); }
-    CFURLAuthChallengeRef cfURLAuthChallengeRef() const { return m_cfChallenge.get(); }
-#endif
+
 private:
-    bool m_isNull;
-    ProtectionSpace m_protectionSpace;
-    Credential m_proposedCredential;
-    unsigned m_previousFailureCount;
-    ResourceResponse m_failureResponse;
-    ResourceError m_error;
+    friend class AuthenticationChallengeBase;
+    static bool platformCompare(const AuthenticationChallenge& a, const AuthenticationChallenge& b);
 
-#if PLATFORM(MAC)
     RetainPtr<id> m_sender;
     RetainPtr<NSURLAuthenticationChallenge *> m_macChallenge;
-#elif USE(CFNETWORK)
-    RefPtr<ResourceHandle> m_sourceHandle;
-    RetainPtr<CFURLAuthChallengeRef> m_cfChallenge;
-#endif
-
 };
 
-bool operator==(const AuthenticationChallenge&, const AuthenticationChallenge&);
-bool operator!=(const AuthenticationChallenge&, const AuthenticationChallenge&);
 }
-#endif
 
+#endif
index 1555cac0bf1e32bbcd69610ca219e8f493d2e4f8..54e7681cc9481209f56bdbae00c83d1fd8ba64ea 100644 (file)
 namespace WebCore {
 
 
+AuthenticationChallenge::AuthenticationChallenge(const ProtectionSpace& protectionSpace,
+                                                 const Credential& proposedCredential,
+                                                 unsigned previousFailureCount,
+                                                 const ResourceResponse& response,
+                                                 const ResourceError& error)
+    : AuthenticationChallengeBase(protectionSpace,
+                                  proposedCredential,
+                                  previousFailureCount,
+                                  response,
+                                  error)
+{
+}
+
 AuthenticationChallenge::AuthenticationChallenge(NSURLAuthenticationChallenge *macChallenge)
-    : m_isNull(false)
-    , m_protectionSpace(core([macChallenge protectionSpace]))
-    , m_proposedCredential(core([macChallenge proposedCredential]))
-    , m_previousFailureCount([macChallenge previousFailureCount])
-    , m_failureResponse([macChallenge failureResponse])
-    , m_error([macChallenge error])
+    : AuthenticationChallengeBase(core([macChallenge protectionSpace]),
+                                  core([macChallenge proposedCredential]),
+                                  [macChallenge previousFailureCount],
+                                  [macChallenge failureResponse],
+                                  [macChallenge error])
     , m_sender([macChallenge sender])
     , m_macChallenge(macChallenge)
 {
 }
 
+bool AuthenticationChallenge::platformCompare(const AuthenticationChallenge& a, const AuthenticationChallenge& b)
+{
+    if (a.sender() != b.sender())
+        return false;
+        
+    if (a.nsURLAuthenticationChallenge() != b.nsURLAuthenticationChallenge())
+        return false;
+
+    return true;
+}
 
 NSURLAuthenticationChallenge *mac(const AuthenticationChallenge& coreChallenge)
 {
diff --git a/WebCore/platform/network/mac/ResourceError.h b/WebCore/platform/network/mac/ResourceError.h
new file mode 100644 (file)
index 0000000..5e4a553
--- /dev/null
@@ -0,0 +1,75 @@
+// -*- mode: c++; c-basic-offset: 4 -*-
+/*
+ * Copyright (C) 2006 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. 
+ */
+
+#ifndef ResourceError_h
+#define ResourceError_h
+
+#include "ResourceErrorBase.h"
+#include <wtf/RetainPtr.h>
+
+#ifdef __OBJC__
+@class NSError;
+#else
+class NSError;
+#endif
+
+namespace WebCore {
+
+    class ResourceError : public ResourceErrorBase {
+    public:
+        ResourceError()
+            : m_dataIsUpToDate(true)
+        {
+        }
+
+        ResourceError(const String& domain, int errorCode, const String& failingURL, const String& localizedDescription)
+            : ResourceErrorBase(domain, errorCode, failingURL, localizedDescription)
+            , m_dataIsUpToDate(true)
+        {
+        }
+
+        ResourceError(NSError* error)
+            : m_dataIsUpToDate(false)
+            , m_platformError(error)
+        {
+            m_isNull = !error;
+        }
+
+        operator NSError*() const;
+
+    private:
+        friend class ResourceErrorBase;
+
+        void platformLazyInit();
+        static bool platformCompare(const ResourceError& a, const ResourceError& b);
+
+        bool m_dataIsUpToDate;
+        mutable RetainPtr<NSError> m_platformError;
+};
+
+} // namespace WebCore
+
+#endif // ResourceError_h_
index 881441ba65a614925075d45236dabfc07632d038..92f4d40fd1bc067961364dced69018d498afcb46 100644 (file)
 
 namespace WebCore {
 
-void ResourceError::unpackPlatformError()
+void ResourceError::platformLazyInit()
 {
+    if (m_dataIsUpToDate)
+        return;
+
     m_domain = [m_platformError.get() domain];
     m_errorCode = [m_platformError.get() code];
 
@@ -50,6 +53,11 @@ void ResourceError::unpackPlatformError()
     m_dataIsUpToDate = true;
 }
 
+bool ResourceError::platformCompare(const ResourceError& a, const ResourceError& b)
+{
+    return (NSError*)a == (NSError*)b;
+}
+
 ResourceError::operator NSError*() const
 {
     if (m_isNull) {
index be4f8dcaa5d4640e92e5d92658258aba16daa448..81ce9818b1e7775973178e60cfac5babc4827e4f 100644 (file)
@@ -41,13 +41,16 @@ namespace WebCore {
 class ResourceResponse : public ResourceResponseBase {
 public:
     ResourceResponse()
-        : ResourceResponseBase()
+        : m_isUpToDate(true)
     {
     }
 
     ResourceResponse(NSURLResponse* nsResponse)
-        : ResourceResponseBase(!nsResponse)
-        , m_nsResponse(nsResponse) { }
+        : m_nsResponse(nsResponse)
+        , m_isUpToDate(false)
+    {
+        m_isNull = !nsResponse;
+    }
     
     ResourceResponse(const KURL& url, const String& mimeType, long long expectedLength, const String& textEncodingName, const String& filename)
         : ResourceResponseBase(url, mimeType, expectedLength, textEncodingName, filename)
@@ -59,10 +62,11 @@ public:
 private:
     friend class ResourceResponseBase;
 
-    void doUpdateResourceResponse();
+    void platformLazyInit();
+    static bool platformCompare(const ResourceResponse& a, const ResourceResponse& b);
 
     RetainPtr<NSURLResponse> m_nsResponse;
-
+    bool m_isUpToDate;
 };
 
 } // namespace WebCore
index 68b145e5ddd6ee1dddf6df836fe4ddbdf8019f54..0af5b323ef338125659a2deaeaa581601610b421 100644 (file)
@@ -57,8 +57,12 @@ NSURLResponse *ResourceResponse::nsURLResponse() const
     return m_nsResponse.get();
 }
 
-void ResourceResponse::doUpdateResourceResponse()
+void ResourceResponse::platformLazyInit()
 {
+    if (m_isUpToDate)
+        return;
+    m_isUpToDate = true;
+
     if (m_isNull) {
         ASSERT(!m_nsResponse);
         return;
@@ -104,4 +108,9 @@ void ResourceResponse::doUpdateResourceResponse()
     }
 }
 
+bool ResourceResponse::platformCompare(const ResourceResponse& a, const ResourceResponse& b)
+{
+    return a.nsURLResponse() == b.nsURLResponse();
+}
+
 }
diff --git a/WebCore/platform/network/qt/AuthenticationChallenge.h b/WebCore/platform/network/qt/AuthenticationChallenge.h
new file mode 100644 (file)
index 0000000..753ac6f
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2007 Apple 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. 
+ */
+#ifndef AuthenticationChallenge_h
+#define AuthenticationChallenge_h
+
+#include "AuthenticationChallengeBase.h"
+
+namespace WebCore {
+
+class AuthenticationChallenge : public AuthenticationChallengeBase {
+public:
+    AuthenticationChallenge()
+    {
+    }
+
+    AuthenticationChallenge(const ProtectionSpace& protectionSpace, const Credential& proposedCredential, unsigned previousFailureCount, const ResourceResponse& response, const ResourceError& error)
+        : AuthenticationChallengeBase(protectionSpace, proposedCredential, previousFailureCount, response, error)
+    {
+    }
+};
+
+}
+
+#endif
diff --git a/WebCore/platform/network/qt/ResourceError.h b/WebCore/platform/network/qt/ResourceError.h
new file mode 100644 (file)
index 0000000..0a8eb64
--- /dev/null
@@ -0,0 +1,49 @@
+// -*- mode: c++; c-basic-offset: 4 -*-
+/*
+ * Copyright (C) 2006 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. 
+ */
+
+#ifndef ResourceError_h
+#define ResourceError_h
+
+#include "ResourceErrorBase.h"
+
+namespace WebCore {
+
+class ResourceError : public ResourceErrorBase
+{
+public:
+    ResourceError()
+    {
+    }
+
+    ResourceError(const String& domain, int errorCode, const String& failingURL, const String& localizedDescription)
+        : ResourceErrorBase(domain, errorCode, failingURL, localizedDescription)
+    {
+    }
+};
+
+}
+
+#endif // ResourceError_h_
index fb658c9326724148ebb89444141a26b6c713d410..36b67ea9f33b553e8dc3100c5c0a97847bd1953b 100644 (file)
 
 #include "ResourceResponseBase.h"
 
-#include "NotImplemented.h"
-
 namespace WebCore {
 
 class ResourceResponse : public ResourceResponseBase {
 public:
     ResourceResponse()
-        : ResourceResponseBase(false)
     {
     }
 
@@ -44,15 +41,6 @@ public:
         : ResourceResponseBase(url, mimeType, expectedLength, textEncodingName, filename)
     {
     }
-
-private:
-    friend class ResourceResponseBase;
-
-    void doUpdateResourceResponse()
-    {
-        notImplemented();
-    }
-
 };
 
 } // namespace WebCore
index 504b5d35ee4aeb85e2b7a8aefdcbb0f2e864a6c8..b8ce7f3964306071139642ec5305637192223e87 100644 (file)
@@ -37,6 +37,7 @@
 #include "HTMLDocument.h"
 #include "HTMLTokenizer.h"
 #include "Page.h"
+#include "ResourceError.h"
 #include "ResourceHandle.h"
 #include "ResourceRequest.h"
 #include "ResourceResponse.h"