Changeset 73614 in webkit
- Timestamp:
- Dec 9, 2010 8:55:19 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r73613 r73614 1 2010-12-09 Brady Eidson <beidson@apple.com> 2 3 Reviewed by Maciej Stachowiak. 4 5 <rdar://problem/7660733> and https://bugs.webkit.org/show_bug.cgi?id=50191 6 WebKit2 Authentication Support 7 8 * WebCore.exp.in: 9 1 10 2010-12-09 Peter Beverloo <peter@lvp-media.com> 2 11 -
trunk/WebCore/WebCore.exp.in
r73535 r73614 138 138 __ZN3WTF6StringC1EP8NSString 139 139 __ZN3WTF6StringC1EPK10__CFString 140 __ZN7WebCore10CredentialC1ERKN3WTF6StringES4_NS_21CredentialPersistenceE 140 141 __ZN7WebCore10CredentialC1Ev 141 142 __ZN7WebCore10JSDocument6s_infoE … … 372 373 __ZN7WebCore15GraphicsContextD1Ev 373 374 __ZN7WebCore15JSDOMWindowBase18commonJSGlobalDataEv 375 __ZN7WebCore15ProtectionSpaceC1ERKN3WTF6StringEiNS_25ProtectionSpaceServerTypeES4_NS_35ProtectionSpaceAuthenticationSchemeE 374 376 __ZN7WebCore15ProtectionSpaceC1Ev 375 377 __ZN7WebCore15ScrollAlignment17alignCenterAlwaysE … … 508 510 __ZN7WebCore22createFragmentFromTextEPNS_5RangeERKN3WTF6StringE 509 511 __ZN7WebCore22externalRepresentationEPNS_5FrameEj 512 __ZN7WebCore23AuthenticationChallengeC1ERKNS_15ProtectionSpaceERKNS_10CredentialEjRKNS_16ResourceResponseERKNS_13ResourceErrorE 510 513 __ZN7WebCore23ReplaceSelectionCommandC1EPNS_8DocumentEN3WTF10PassRefPtrINS_16DocumentFragmentEEEbbbbbNS_10EditActionE 511 514 __ZN7WebCore23createFragmentFromNodesEPNS_8DocumentERKN3WTF6VectorIPNS_4NodeELm0EEE … … 915 918 __ZNK3JSC8Bindings10RootObject12globalObjectEv 916 919 __ZNK3WTF6String14createCFStringEv 920 __ZNK7WebCore10Credential11persistenceEv 921 __ZNK7WebCore10Credential4userEv 922 __ZNK7WebCore10Credential8passwordEv 917 923 __ZNK7WebCore10FloatPointcv8_NSPointEv 918 924 __ZNK7WebCore10PluginData16supportsMimeTypeERKN3WTF6StringE … … 1014 1020 __ZNK7WebCore15GraphicsContext16paintingDisabledEv 1015 1021 __ZNK7WebCore15ProgressTracker17estimatedProgressEv 1022 __ZNK7WebCore15ProtectionSpace10serverTypeEv 1023 __ZNK7WebCore15ProtectionSpace26receivesCredentialSecurelyEv 1024 __ZNK7WebCore15ProtectionSpace4hostEv 1025 __ZNK7WebCore15ProtectionSpace4portEv 1026 __ZNK7WebCore15ProtectionSpace5realmEv 1027 __ZNK7WebCore15ProtectionSpace7isProxyEv 1016 1028 __ZNK7WebCore15ResourceRequest12nsURLRequestEv 1017 1029 __ZNK7WebCore15VisiblePosition14characterAfterEv … … 1059 1071 __ZNK7WebCore23FrameLoaderStateMachine23committingFirstRealLoadEv 1060 1072 __ZNK7WebCore26NetscapePlugInStreamLoader6isDoneEv 1073 __ZNK7WebCore27AuthenticationChallengeBase15failureResponseEv 1074 __ZNK7WebCore27AuthenticationChallengeBase15protectionSpaceEv 1075 __ZNK7WebCore27AuthenticationChallengeBase18proposedCredentialEv 1076 __ZNK7WebCore27AuthenticationChallengeBase20previousFailureCountEv 1077 __ZNK7WebCore27AuthenticationChallengeBase5errorEv 1061 1078 __ZNK7WebCore27AuthenticationChallengeBase6isNullEv 1062 1079 __ZNK7WebCore4Font10floatWidthERKNS_7TextRunEPN3WTF7HashSetIPKNS_14SimpleFontDataENS4_7PtrHashIS8_EENS4_10HashTraitsIS8_EEEEPNS_13GlyphOverflowE -
trunk/WebKit2/ChangeLog
r73591 r73614 1 2010-12-09 Brady Eidson <beidson@apple.com> 2 3 Reviewed by Maciej Stachowiak. 4 5 <rdar://problem/7660733> and https://bugs.webkit.org/show_bug.cgi?id=50191 6 WebKit2 Authentication Support 7 8 Implement authentication-related coders: 9 * Shared/WebCoreArgumentCoders.h: 10 11 Allow the ResourceResponse coders to handle null responses: 12 * Shared/mac/WebCoreArgumentCodersMac.mm: 13 (CoreIPC::encodeResourceResponse): 14 (CoreIPC::decodeResourceResponse): 15 16 Add new API and Impl casts for ProtectionSpace and Credential enums: 17 * UIProcess/API/C/WKAPICast.h: 18 (WebKit::toAPI): 19 (WebKit::toCredentialPersistence): 20 21 Move the DecisionListener to be accessed off the challenge itself, and fill in other 22 necessary API: 23 * UIProcess/API/C/WKAuthenticationChallenge.cpp: 24 (WKAuthenticationChallengeGetDecisionListener): 25 (WKAuthenticationChallengeGetProtectionSpace): 26 (WKAuthenticationChallengeGetProposedCredential): 27 (WKAuthenticationChallengeGetPreviousFailureCount): 28 * UIProcess/API/C/WKAuthenticationChallenge.h: 29 * UIProcess/Authentication/AuthenticationChallengeProxy.cpp: 30 (WebKit::AuthenticationChallengeProxy::~AuthenticationChallengeProxy): 31 (WebKit::AuthenticationChallengeProxy::proposedCredential): 32 (WebKit::AuthenticationChallengeProxy::protectionSpace): 33 * UIProcess/Authentication/AuthenticationChallengeProxy.h: 34 (WebKit::AuthenticationChallengeProxy::previousFailureCount): 35 36 Fill in some credential API: 37 * UIProcess/API/C/WKCredential.cpp: 38 (WKCredentialCreate): 39 (WKCredentialCopyUser): 40 * UIProcess/API/C/WKCredential.h: 41 * UIProcess/API/C/WKCredentialTypes.h: Added. 42 * UIProcess/Authentication/WebCredential.cpp: 43 (WebKit::WebCredential::WebCredential): 44 (WebKit::WebCredential::user): 45 * UIProcess/Authentication/WebCredential.h: 46 (WebKit::WebCredential::create): 47 48 Fill in some protection space API: 49 * UIProcess/API/C/WKProtectionSpace.cpp: 50 (WKProtectionSpaceCopyHost): 51 (WKProtectionSpaceGetPort): 52 (WKProtectionSpaceCopyRealm): 53 (WKProtectionSpaceGetIsProxy): 54 (WKProtectionSpaceGetServerType): 55 (WKProtectionSpaceGetReceivesCredentialSecurely): 56 (WKProtectionSpaceGetAuthenticationScheme): 57 * UIProcess/API/C/WKProtectionSpace.h: 58 * UIProcess/API/C/WKProtectionSpaceTypes.h: Added. 59 * UIProcess/Authentication/WebProtectionSpace.cpp: 60 (WebKit::WebProtectionSpace::WebProtectionSpace): 61 (WebKit::WebProtectionSpace::host): 62 (WebKit::WebProtectionSpace::port): 63 (WebKit::WebProtectionSpace::realm): 64 (WebKit::WebProtectionSpace::isProxy): 65 (WebKit::WebProtectionSpace::serverType): 66 (WebKit::WebProtectionSpace::receivesCredentialSecurely): 67 (WebKit::WebProtectionSpace::authenticationScheme): 68 * UIProcess/Authentication/WebProtectionSpace.h: 69 70 Change the authentication challenge callback to reflect the new ownership of 71 the DecisionListener: 72 * UIProcess/API/C/WKPage.h: 73 * UIProcess/WebLoaderClient.cpp: 74 (WebKit::WebLoaderClient::didReceiveAuthenticationChallengeInFrame): 75 * UIProcess/WebLoaderClient.h: 76 * UIProcess/WebPageProxy.cpp: 77 (WebKit::WebPageProxy::didReceiveAuthenticationChallenge): 78 79 * WebKit2.pro: 80 * WebKit2.xcodeproj/project.pbxproj: 81 * win/WebKit2.vcproj: 82 * win/WebKit2Generated.make: 83 1 84 2010-12-08 Sam Weinig <sam@webkit.org> 2 85 -
trunk/WebKit2/Shared/WebCoreArgumentCoders.h
r73281 r73614 116 116 static void encode(ArgumentEncoder* encoder, const WebCore::AuthenticationChallenge& challenge) 117 117 { 118 // FIXME: Implement 119 } 120 121 static bool decode(ArgumentDecoder* decoder, WebCore::AuthenticationChallenge& credential) 122 { 123 // FIXME: Implement 118 encoder->encode(CoreIPC::In(challenge.protectionSpace(), challenge.proposedCredential(), challenge.previousFailureCount(), challenge.failureResponse(), challenge.error())); 119 } 120 121 static bool decode(ArgumentDecoder* decoder, WebCore::AuthenticationChallenge& challenge) 122 { 123 WebCore::ProtectionSpace protectionSpace; 124 WebCore::Credential proposedCredential; 125 unsigned previousFailureCount; 126 WebCore::ResourceResponse failureResponse; 127 WebCore::ResourceError error; 128 129 if (!decoder->decode(CoreIPC::Out(protectionSpace, proposedCredential, previousFailureCount, failureResponse, error))) 130 return false; 131 132 challenge = WebCore::AuthenticationChallenge(protectionSpace, proposedCredential, previousFailureCount, failureResponse, error); 133 124 134 return true; 125 135 } … … 127 137 128 138 template<> struct ArgumentCoder<WebCore::ProtectionSpace> { 129 static void encode(ArgumentEncoder* encoder, const WebCore::ProtectionSpace& challenge) 130 { 131 // FIXME: Implement 132 } 133 134 static bool decode(ArgumentDecoder* decoder, WebCore::ProtectionSpace& credential) 135 { 136 // FIXME: Implement 139 static void encode(ArgumentEncoder* encoder, const WebCore::ProtectionSpace& space) 140 { 141 encoder->encode(CoreIPC::In(space.host(), space.port(), static_cast<uint32_t>(space.serverType()), space.realm(), static_cast<uint32_t>(space.authenticationScheme()))); 142 } 143 144 static bool decode(ArgumentDecoder* decoder, WebCore::ProtectionSpace& space) 145 { 146 String host; 147 int port; 148 uint32_t serverType; 149 String realm; 150 uint32_t authenticationScheme; 151 152 if (!decoder->decode(CoreIPC::Out(host, port, serverType, realm, authenticationScheme))) 153 return false; 154 155 space = WebCore::ProtectionSpace(host, port, static_cast<WebCore::ProtectionSpaceServerType>(serverType), realm, static_cast<WebCore::ProtectionSpaceAuthenticationScheme>(authenticationScheme)); 156 137 157 return true; 138 158 } … … 142 162 static void encode(ArgumentEncoder* encoder, const WebCore::Credential& credential) 143 163 { 144 // FIXME: Implement164 encoder->encode(CoreIPC::In(credential.user(), credential.password(), static_cast<uint32_t>(credential.persistence()))); 145 165 } 146 166 147 167 static bool decode(ArgumentDecoder* decoder, WebCore::Credential& credential) 148 168 { 149 // FIXME: Implement 169 String user; 170 String password; 171 int persistence; 172 if (!decoder->decode(CoreIPC::Out(user, password, persistence))) 173 return false; 174 175 credential = WebCore::Credential(user, password, static_cast<WebCore::CredentialPersistence>(persistence)); 150 176 return true; 151 177 } -
trunk/WebKit2/Shared/mac/WebCoreArgumentCodersMac.mm
r71868 r73614 61 61 void encodeResourceResponse(ArgumentEncoder* encoder, const WebCore::ResourceResponse& resourceResponse) 62 62 { 63 bool responseIsPresent = resourceResponse.nsURLResponse(); 64 encoder->encode(responseIsPresent); 65 66 // FIXME: <rdar://problem/8741799> - We can't use NSKeyedArchiver here. 63 67 encodeWithNSKeyedArchiver(encoder, resourceResponse.nsURLResponse()); 64 68 } … … 66 70 bool decodeResourceResponse(ArgumentDecoder* decoder, WebCore::ResourceResponse& resourceResponse) 67 71 { 72 bool responseIsPresent; 73 decoder->decode(responseIsPresent); 74 75 // FIXME: <rdar://problem/8741799> - We can't use NSKeyedArchiver here. 68 76 NSURLResponse *nsURLResponse = decodeWithNSKeyedArchiver(decoder); 69 if ( !nsURLResponse)77 if (responseIsPresent && !nsURLResponse) 70 78 return false; 71 79 72 resourceResponse = WebCore::ResourceResponse(nsURLResponse); 80 if (responseIsPresent) 81 resourceResponse = WebCore::ResourceResponse(nsURLResponse); 82 73 83 return true; 74 84 } -
trunk/WebKit2/UIProcess/API/C/WKAPICast.h
r73412 r73614 30 30 #include "FontSmoothingLevel.h" 31 31 #include "WKContext.h" 32 #include "WKCredentialTypes.h" 32 33 #include "WKPage.h" 33 34 #include "WKPreferencesPrivate.h" 35 #include "WKProtectionSpaceTypes.h" 34 36 #include "WKSharedAPICast.h" 37 #include <WebCore/Credential.h> 38 #include <WebCore/FrameLoaderTypes.h> 39 #include <WebCore/ProtectionSpace.h> 35 40 36 41 namespace WebKit { … … 148 153 } 149 154 155 inline WKProtectionSpaceServerType toAPI(WebCore::ProtectionSpaceServerType type) 156 { 157 switch (type) { 158 case WebCore::ProtectionSpaceServerHTTP: 159 return kWKProtectionSpaceServerTypeHTTP; 160 case WebCore::ProtectionSpaceServerHTTPS: 161 return kWKProtectionSpaceServerTypeHTTPS; 162 case WebCore::ProtectionSpaceServerFTP: 163 return kWKProtectionSpaceServerTypeFTP; 164 case WebCore::ProtectionSpaceServerFTPS: 165 return kWKProtectionSpaceServerTypeFTPS; 166 case WebCore::ProtectionSpaceProxyHTTP: 167 return kWKProtectionSpaceProxyTypeHTTP; 168 case WebCore::ProtectionSpaceProxyHTTPS: 169 return kWKProtectionSpaceProxyTypeHTTPS; 170 case WebCore::ProtectionSpaceProxyFTP: 171 return kWKProtectionSpaceProxyTypeFTP; 172 case WebCore::ProtectionSpaceProxySOCKS: 173 return kWKProtectionSpaceProxyTypeSOCKS; 174 } 175 return kWKProtectionSpaceServerTypeHTTP; 176 } 177 178 inline WKProtectionSpaceAuthenticationScheme toAPI(WebCore::ProtectionSpaceAuthenticationScheme type) 179 { 180 switch (type) { 181 case WebCore::ProtectionSpaceAuthenticationSchemeDefault: 182 return kWKProtectionSpaceAuthenticationSchemeDefault; 183 case WebCore::ProtectionSpaceAuthenticationSchemeHTTPBasic: 184 return kWKProtectionSpaceAuthenticationSchemeHTTPBasic; 185 case WebCore::ProtectionSpaceAuthenticationSchemeHTTPDigest: 186 return kWKProtectionSpaceAuthenticationSchemeHTTPDigest; 187 case WebCore::ProtectionSpaceAuthenticationSchemeHTMLForm: 188 return kWKProtectionSpaceAuthenticationSchemeHTMLForm; 189 case WebCore::ProtectionSpaceAuthenticationSchemeNTLM: 190 return kWKProtectionSpaceAuthenticationSchemeNTLM; 191 case WebCore::ProtectionSpaceAuthenticationSchemeNegotiate: 192 return kWKProtectionSpaceAuthenticationSchemeNegotiate; 193 case WebCore::ProtectionSpaceAuthenticationSchemeClientCertificateRequested: 194 return kWKProtectionSpaceAuthenticationSchemeClientCertificateRequested; 195 case WebCore::ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested: 196 return kWKProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested; 197 default: 198 return kWKProtectionSpaceAuthenticationSchemeUnknown; 199 } 200 } 201 202 inline WebCore::CredentialPersistence toCredentialPersistence(WKCredentialPersistence type) 203 { 204 switch (type) { 205 case kWKCredentialPersistenceNone: 206 return WebCore::CredentialPersistenceNone; 207 case kWKCredentialPersistenceForSession: 208 return WebCore::CredentialPersistenceForSession; 209 case kWKCredentialPersistencePermanent: 210 return WebCore::CredentialPersistencePermanent; 211 default: 212 return WebCore::CredentialPersistenceNone; 213 } 214 } 215 150 216 } // namespace WebKit 151 217 -
trunk/WebKit2/UIProcess/API/C/WKAuthenticationChallenge.cpp
r73281 r73614 27 27 28 28 #include "AuthenticationChallengeProxy.h" 29 #include "WebCredential.h" 30 #include "WebProtectionSpace.h" 29 31 #include "WKAPICast.h" 30 32 … … 35 37 return toAPI(AuthenticationChallengeProxy::APIType); 36 38 } 39 40 WKAuthenticationDecisionListenerRef WKAuthenticationChallengeGetDecisionListener(WKAuthenticationChallengeRef challenge) 41 { 42 return toAPI(toImpl(challenge)->listener()); 43 } 44 45 WKProtectionSpaceRef WKAuthenticationChallengeGetProtectionSpace(WKAuthenticationChallengeRef challenge) 46 { 47 return toAPI(toImpl(challenge)->protectionSpace()); 48 } 49 50 WKCredentialRef WKAuthenticationChallengeGetProposedCredential(WKAuthenticationChallengeRef challenge) 51 { 52 return toAPI(toImpl(challenge)->proposedCredential()); 53 } 54 55 int WKAuthenticationChallengeGetPreviousFailureCount(WKAuthenticationChallengeRef challenge) 56 { 57 return toImpl(challenge)->previousFailureCount(); 58 } -
trunk/WebKit2/UIProcess/API/C/WKAuthenticationChallenge.h
r73281 r73614 35 35 WK_EXPORT WKTypeID WKAuthenticationChallengeGetTypeID(); 36 36 37 WK_EXPORT WKAuthenticationDecisionListenerRef WKAuthenticationChallengeGetDecisionListener(WKAuthenticationChallengeRef); 38 WK_EXPORT WKProtectionSpaceRef WKAuthenticationChallengeGetProtectionSpace(WKAuthenticationChallengeRef); 39 WK_EXPORT WKCredentialRef WKAuthenticationChallengeGetProposedCredential(WKAuthenticationChallengeRef); 40 WK_EXPORT int WKAuthenticationChallengeGetPreviousFailureCount(WKAuthenticationChallengeRef); 41 37 42 #ifdef __cplusplus 38 43 } -
trunk/WebKit2/UIProcess/API/C/WKCredential.cpp
r73281 r73614 27 27 28 28 #include "WebCredential.h" 29 #include "WebString.h" 29 30 #include "WKAPICast.h" 30 31 … … 35 36 return toAPI(WebCredential::APIType); 36 37 } 38 39 WKCredentialRef WKCredentialCreate(WKStringRef username, WKStringRef password, WKCredentialPersistence persistence) 40 { 41 RefPtr<WebCredential> credential = WebCredential::create(toImpl(username), toImpl(password), toCredentialPersistence(persistence)); 42 return toAPI(credential.release().releaseRef()); 43 } 44 45 WKStringRef WKCredentialCopyUser(WKCredentialRef credentialRef) 46 { 47 return toCopiedAPI(toImpl(credentialRef)->user()); 48 } 49 -
trunk/WebKit2/UIProcess/API/C/WKCredential.h
r73281 r73614 28 28 29 29 #include <WebKit2/WKBase.h> 30 #include <WebKit2/WKCredentialTypes.h> 30 31 31 32 #ifdef __cplusplus … … 35 36 WK_EXPORT WKTypeID WKCredentialGetTypeID(); 36 37 38 WK_EXPORT WKCredentialRef WKCredentialCreate(WKStringRef username, WKStringRef password, WKCredentialPersistence); 39 WK_EXPORT WKStringRef WKCredentialCopyUser(WKCredentialRef); 40 37 41 #ifdef __cplusplus 38 42 } -
trunk/WebKit2/UIProcess/API/C/WKPage.h
r73565 r73614 58 58 typedef void (*WKPageDidRunInsecureContentForFrameCallback)(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo); 59 59 typedef bool (*WKPageCanAuthenticateAgainstProtectionSpaceInFrameCallback)(WKPageRef page, WKFrameRef frame, WKProtectionSpaceRef protectionSpace, const void *clientInfo); 60 typedef void (*WKPageDidReceiveAuthenticationChallengeInFrameCallback)(WKPageRef page, WKFrameRef frame, WKAuthenticationChallengeRef authenticationChallenge, WKAuthenticationDecisionListenerRef listener,const void *clientInfo);60 typedef void (*WKPageDidReceiveAuthenticationChallengeInFrameCallback)(WKPageRef page, WKFrameRef frame, WKAuthenticationChallengeRef authenticationChallenge, const void *clientInfo); 61 61 62 62 // Progress Client -
trunk/WebKit2/UIProcess/API/C/WKProtectionSpace.cpp
r73281 r73614 35 35 return toAPI(WebProtectionSpace::APIType); 36 36 } 37 38 WKStringRef WKProtectionSpaceCopyHost(WKProtectionSpaceRef protectionSpaceRef) 39 { 40 return toCopiedAPI(toImpl(protectionSpaceRef)->host()); 41 } 42 43 int WKProtectionSpaceGetPort(WKProtectionSpaceRef protectionSpaceRef) 44 { 45 return toImpl(protectionSpaceRef)->port(); 46 } 47 48 WKStringRef WKProtectionSpaceCopyRealm(WKProtectionSpaceRef protectionSpaceRef) 49 { 50 return toCopiedAPI(toImpl(protectionSpaceRef)->realm()); 51 } 52 53 bool WKProtectionSpaceGetIsProxy(WKProtectionSpaceRef protectionSpaceRef) 54 { 55 return toImpl(protectionSpaceRef)->isProxy(); 56 } 57 58 WKProtectionSpaceServerType WKProtectionSpaceGetServerType(WKProtectionSpaceRef protectionSpaceRef) 59 { 60 return toAPI(toImpl(protectionSpaceRef)->serverType()); 61 } 62 63 bool WKProtectionSpaceGetReceivesCredentialSecurely(WKProtectionSpaceRef protectionSpaceRef) 64 { 65 return toImpl(protectionSpaceRef)->receivesCredentialSecurely(); 66 } 67 68 WKProtectionSpaceAuthenticationScheme WKProtectionSpaceGetAuthenticationScheme(WKProtectionSpaceRef protectionSpaceRef) 69 { 70 return toAPI(toImpl(protectionSpaceRef)->authenticationScheme()); 71 } -
trunk/WebKit2/UIProcess/API/C/WKProtectionSpace.h
r73281 r73614 28 28 29 29 #include <WebKit2/WKBase.h> 30 #include <WebKit2/WKProtectionSpaceTypes.h> 30 31 31 32 #ifdef __cplusplus … … 35 36 WK_EXPORT WKTypeID WKProtectionSpaceGetTypeID(); 36 37 38 WK_EXPORT WKStringRef WKProtectionSpaceCopyHost(WKProtectionSpaceRef); 39 WK_EXPORT int WKProtectionSpaceGetPort(WKProtectionSpaceRef); 40 WK_EXPORT WKStringRef WKProtectionSpaceCopyRealm(WKProtectionSpaceRef); 41 WK_EXPORT bool WKProtectionSpaceGetIsProxy(WKProtectionSpaceRef); 42 WK_EXPORT WKProtectionSpaceServerType WKProtectionSpaceGetServerType(WKProtectionSpaceRef); 43 WK_EXPORT bool WKProtectionSpaceGetReceivesCredentialSecurely(WKProtectionSpaceRef); 44 WK_EXPORT WKProtectionSpaceAuthenticationScheme WKProtectionSpaceGetAuthenticationScheme(WKProtectionSpaceRef); 45 37 46 #ifdef __cplusplus 38 47 } -
trunk/WebKit2/UIProcess/Authentication/AuthenticationChallengeProxy.cpp
r73281 r73614 32 32 #include "WebPageProxy.h" 33 33 #include "WebProcessProxy.h" 34 #include "WebProtectionSpace.h" 34 35 35 36 namespace WebKit { … … 48 49 // If an outstanding AuthenticationChallengeProxy is being destroyed even though it hasn't been responded to yet, 49 50 // we cancel it here so the WebProcess isn't waiting for an answer forever. 50 if (m_challengeID )51 if (m_challengeID && m_page->process()) 51 52 m_page->process()->send(Messages::AuthenticationManager::CancelChallenge(m_challengeID), m_page->pageID()); 52 53 … … 78 79 } 79 80 81 WebCredential* AuthenticationChallengeProxy::proposedCredential() const 82 { 83 if (!m_webCredential) 84 m_webCredential = WebCredential::create(m_coreAuthenticationChallenge.proposedCredential()); 85 86 return m_webCredential.get(); 87 } 88 89 WebProtectionSpace* AuthenticationChallengeProxy::protectionSpace() const 90 { 91 if (!m_webProtectionSpace) 92 m_webProtectionSpace = WebProtectionSpace::create(m_coreAuthenticationChallenge.protectionSpace()); 93 94 return m_webProtectionSpace.get(); 95 } 96 80 97 } // namespace WebKit -
trunk/WebKit2/UIProcess/Authentication/AuthenticationChallengeProxy.h
r73281 r73614 42 42 class WebCredential; 43 43 class WebPageProxy; 44 class WebProtectionSpace; 44 45 45 46 class AuthenticationChallengeProxy : public APIObject { … … 58 59 59 60 AuthenticationDecisionListener* listener() const { return m_listener.get(); } 61 WebCredential* proposedCredential() const; 62 WebProtectionSpace* protectionSpace() const; 63 int previousFailureCount() const { return m_coreAuthenticationChallenge.previousFailureCount(); } 60 64 61 65 private: … … 68 72 RefPtr<WebPageProxy> m_page; 69 73 RefPtr<AuthenticationDecisionListener> m_listener; 74 mutable RefPtr<WebCredential> m_webCredential; 75 mutable RefPtr<WebProtectionSpace> m_webProtectionSpace; 70 76 }; 71 77 -
trunk/WebKit2/UIProcess/Authentication/WebCredential.cpp
r73281 r73614 28 28 namespace WebKit { 29 29 30 WebCredential::WebCredential(const WebCore::Credential& credential) 31 : m_coreCredential(credential) 32 { 33 } 34 30 35 const WebCore::Credential& WebCredential::core() 31 36 { … … 33 38 } 34 39 40 const String& WebCredential::user() const 41 { 42 return m_coreCredential.user(); 43 } 44 35 45 } // namespace WebKit -
trunk/WebKit2/UIProcess/Authentication/WebCredential.h
r73281 r73614 28 28 29 29 #include "APIObject.h" 30 #include "WebString.h" 31 30 32 #include <WebCore/Credential.h> 31 33 #include <wtf/PassRefPtr.h> … … 38 40 static const Type APIType = TypeCredential; 39 41 40 static PassRefPtr<WebCredential> create( )42 static PassRefPtr<WebCredential> create(const WebCore::Credential& credential) 41 43 { 42 return adoptRef(new WebCredential()); 44 return adoptRef(new WebCredential(credential)); 45 } 46 47 static PassRefPtr<WebCredential> create(WebString* username, WebString* password, WebCore::CredentialPersistence persistence) 48 { 49 return adoptRef(new WebCredential(WebCore::Credential(username->string(), password->string(), persistence))); 43 50 } 44 51 45 52 const WebCore::Credential& core(); 46 53 54 const String& user() const; 55 47 56 private: 48 WebCredential( );57 WebCredential(const WebCore::Credential&); 49 58 50 59 virtual Type type() const { return APIType; } -
trunk/WebKit2/UIProcess/Authentication/WebProtectionSpace.cpp
r73281 r73614 26 26 #include "WebProtectionSpace.h" 27 27 28 #include <WebCore/SharedBuffer.h> 29 28 30 namespace WebKit { 29 31 … … 31 33 : m_coreProtectionSpace(coreProtectionSpace) 32 34 { 35 } 33 36 37 const String& WebProtectionSpace::host() const 38 { 39 return m_coreProtectionSpace.host(); 40 } 41 42 int WebProtectionSpace::port() const 43 { 44 return m_coreProtectionSpace.port(); 45 } 46 47 const String& WebProtectionSpace::realm() const 48 { 49 return m_coreProtectionSpace.realm(); 50 } 51 52 bool WebProtectionSpace::isProxy() const 53 { 54 return m_coreProtectionSpace.isProxy(); 55 } 56 57 WebCore::ProtectionSpaceServerType WebProtectionSpace::serverType() const 58 { 59 return m_coreProtectionSpace.serverType(); 60 } 61 62 bool WebProtectionSpace::receivesCredentialSecurely() const 63 { 64 return m_coreProtectionSpace.receivesCredentialSecurely(); 65 } 66 67 WebCore::ProtectionSpaceAuthenticationScheme WebProtectionSpace::authenticationScheme() const 68 { 69 return m_coreProtectionSpace.authenticationScheme(); 34 70 } 35 71 -
trunk/WebKit2/UIProcess/Authentication/WebProtectionSpace.h
r73281 r73614 41 41 return adoptRef(new WebProtectionSpace(protectionSpace)); 42 42 } 43 44 const String& protocol() const; 45 const String& host() const; 46 int port() const; 47 const String& realm() const; 48 bool isProxy() const; 49 WebCore::ProtectionSpaceServerType serverType() const; 50 bool receivesCredentialSecurely() const; 51 WebCore::ProtectionSpaceAuthenticationScheme authenticationScheme() const; 43 52 44 53 private: -
trunk/WebKit2/UIProcess/WebLoaderClient.cpp
r73412 r73614 153 153 } 154 154 155 void WebLoaderClient::didReceiveAuthenticationChallengeInFrame(WebPageProxy* page, WebFrameProxy* frame, AuthenticationChallengeProxy* authenticationChallenge , AuthenticationDecisionListener* listener)155 void WebLoaderClient::didReceiveAuthenticationChallengeInFrame(WebPageProxy* page, WebFrameProxy* frame, AuthenticationChallengeProxy* authenticationChallenge) 156 156 { 157 157 if (!m_client.didReceiveAuthenticationChallengeInFrame) 158 158 return; 159 159 160 m_client.didReceiveAuthenticationChallengeInFrame(toAPI(page), toAPI(frame), toAPI(authenticationChallenge), toAPI(listener),m_client.clientInfo);160 m_client.didReceiveAuthenticationChallengeInFrame(toAPI(page), toAPI(frame), toAPI(authenticationChallenge), m_client.clientInfo); 161 161 } 162 162 -
trunk/WebKit2/UIProcess/WebLoaderClient.h
r73412 r73614 63 63 64 64 bool canAuthenticateAgainstProtectionSpaceInFrame(WebPageProxy*, WebFrameProxy*, WebProtectionSpace*); 65 void didReceiveAuthenticationChallengeInFrame(WebPageProxy*, WebFrameProxy*, AuthenticationChallengeProxy* , AuthenticationDecisionListener*);65 void didReceiveAuthenticationChallengeInFrame(WebPageProxy*, WebFrameProxy*, AuthenticationChallengeProxy*); 66 66 67 67 void didStartProgress(WebPageProxy*); -
trunk/WebKit2/UIProcess/WebPageProxy.cpp
r73533 r73614 1560 1560 RefPtr<AuthenticationChallengeProxy> authenticationChallenge = AuthenticationChallengeProxy::create(coreChallenge, challengeID, this); 1561 1561 1562 m_loaderClient.didReceiveAuthenticationChallengeInFrame(this, frame, authenticationChallenge.get() , authenticationChallenge->listener());1562 m_loaderClient.didReceiveAuthenticationChallengeInFrame(this, frame, authenticationChallenge.get()); 1563 1563 } 1564 1564 -
trunk/WebKit2/WebKit2.pro
r73451 r73614 276 276 UIProcess/API/C/WKContextPrivate.h \ 277 277 UIProcess/API/C/WKCredential.h \ 278 UIProcess/API/C/WKCredentialTypes.h \ 278 279 UIProcess/API/C/WKDownload.h \ 279 280 UIProcess/API/C/WKFrame.h \ … … 288 289 UIProcess/API/C/WKPreferencesPrivate.h \ 289 290 UIProcess/API/C/WKProtectionSpace.h \ 291 UIProcess/API/C/WKProtectionSpaceTypes.h \ 290 292 UIProcess/API/C/WebKit2.h \ 291 293 UIProcess/API/C/qt/WKNativeEvent.h \ -
trunk/WebKit2/WebKit2.xcodeproj/project.pbxproj
r73449 r73614 233 233 51871B5B127CB89D00F76232 /* WebContextMenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51871B59127CB89D00F76232 /* WebContextMenu.cpp */; }; 234 234 51871B5C127CB89D00F76232 /* WebContextMenu.h in Headers */ = {isa = PBXBuildFile; fileRef = 51871B5A127CB89D00F76232 /* WebContextMenu.h */; }; 235 518ACAEA12AEE6BB00B04B83 /* WKProtectionSpaceTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 518ACAE912AEE6BB00B04B83 /* WKProtectionSpaceTypes.h */; settings = {ATTRIBUTES = (Public, ); }; }; 236 518ACF1112B015F800B04B83 /* WKCredentialTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 518ACF1012B015F800B04B83 /* WKCredentialTypes.h */; settings = {ATTRIBUTES = (Public, ); }; }; 235 237 51A555F5128C6C47009ABCEC /* WKContextMenuItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51A555F3128C6C47009ABCEC /* WKContextMenuItem.cpp */; }; 236 238 51A555F6128C6C47009ABCEC /* WKContextMenuItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 51A555F4128C6C47009ABCEC /* WKContextMenuItem.h */; settings = {ATTRIBUTES = (Public, ); }; }; … … 864 866 51871B59127CB89D00F76232 /* WebContextMenu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebContextMenu.cpp; sourceTree = "<group>"; }; 865 867 51871B5A127CB89D00F76232 /* WebContextMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebContextMenu.h; sourceTree = "<group>"; }; 868 518ACAE912AEE6BB00B04B83 /* WKProtectionSpaceTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKProtectionSpaceTypes.h; sourceTree = "<group>"; }; 869 518ACF1012B015F800B04B83 /* WKCredentialTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKCredentialTypes.h; sourceTree = "<group>"; }; 866 870 51A555F3128C6C47009ABCEC /* WKContextMenuItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKContextMenuItem.cpp; sourceTree = "<group>"; }; 867 871 51A555F4128C6C47009ABCEC /* WKContextMenuItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKContextMenuItem.h; sourceTree = "<group>"; }; … … 1905 1909 512F58F112A88A5400629530 /* WKCredential.cpp */, 1906 1910 512F58F212A88A5400629530 /* WKCredential.h */, 1911 518ACF1012B015F800B04B83 /* WKCredentialTypes.h */, 1907 1912 1AB7D78C1288CD9A00CFD08C /* WKDownload.cpp */, 1908 1913 1AB7D78B1288CD9A00CFD08C /* WKDownload.h */, … … 1930 1935 512F58F312A88A5400629530 /* WKProtectionSpace.cpp */, 1931 1936 512F58F412A88A5400629530 /* WKProtectionSpace.h */, 1937 518ACAE912AEE6BB00B04B83 /* WKProtectionSpaceTypes.h */, 1932 1938 ); 1933 1939 path = C; … … 2635 2641 F634445612A885C8000612D8 /* WebSecurityOrigin.h in Headers */, 2636 2642 F634445D12A885E9000612D8 /* WKSecurityOrigin.h in Headers */, 2643 518ACAEA12AEE6BB00B04B83 /* WKProtectionSpaceTypes.h in Headers */, 2644 518ACF1112B015F800B04B83 /* WKCredentialTypes.h in Headers */, 2637 2645 BC2D021712AC41CB00E732A3 /* SameDocumentNavigationType.h in Headers */, 2638 2646 BC2D021912AC426C00E732A3 /* WKPageLoadTypes.h in Headers */, -
trunk/WebKit2/win/WebKit2.vcproj
r73449 r73614 2126 2126 </File> 2127 2127 <File 2128 RelativePath="..\UIProcess\API\C\WKCredentialTypes.h" 2129 > 2130 </File> 2131 <File 2128 2132 RelativePath="..\UIProcess\API\C\WKDownload.cpp" 2129 2133 > … … 2223 2227 <File 2224 2228 RelativePath="..\UIProcess\API\C\WKProtectionSpace.h" 2229 > 2230 </File> 2231 <File 2232 RelativePath="..\UIProcess\API\C\WKProtectionSpaceTypes.h" 2225 2233 > 2226 2234 </File> -
trunk/WebKit2/win/WebKit2Generated.make
r73412 r73614 41 41 xcopy /y /d "..\UIProcess\API\C\WKContextPrivate.h" "$(WEBKITOUTPUTDIR)\include\WebKit2" 42 42 xcopy /y /d "..\UIProcess\API\C\WKCredential.h" "$(WEBKITOUTPUTDIR)\include\WebKit2" 43 xcopy /y /d "..\UIProcess\API\C\WKCredentialTypes.h" "$(WEBKITOUTPUTDIR)\include\WebKit2" 43 44 xcopy /y /d "..\UIProcess\API\C\WKDownload.h" "$(WEBKITOUTPUTDIR)\include\WebKit2" 44 45 xcopy /y /d "..\UIProcess\API\C\WKFormSubmissionListener.h" "$(WEBKITOUTPUTDIR)\include\WebKit2" … … 54 55 xcopy /y /d "..\UIProcess\API\C\WKPreferencesPrivate.h" "$(WEBKITOUTPUTDIR)\include\WebKit2" 55 56 xcopy /y /d "..\UIProcess\API\C\WKProtectionSpace.h" "$(WEBKITOUTPUTDIR)\include\WebKit2" 57 xcopy /y /d "..\UIProcess\API\C\WKProtectionSpaceTypes.h" "$(WEBKITOUTPUTDIR)\include\WebKit2" 56 58 xcopy /y /d "..\UIProcess\API\C\win\WKContextPrivateWin.h" "$(WEBKITOUTPUTDIR)\include\WebKit2" 57 59 xcopy /y /d "..\UIProcess\API\C\win\WKView.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
Note: See TracChangeset
for help on using the changeset viewer.