Changeset 206732 in webkit
- Timestamp:
- Oct 3, 2016 3:42:11 AM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r206731 r206732 1 2016-10-03 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [SOUP] Simplify AuthenticationChallenge 4 https://bugs.webkit.org/show_bug.cgi?id=162784 5 6 Reviewed by Alex Christensen. 7 8 We don't really need to keep references to the SoupSession and SoupMessage in AuthenticationChallenge, the 9 SoupNetworkSession callback already forwards the challenge to the right ResourceHandle. 10 11 * platform/network/soup/AuthenticationChallenge.h: 12 (WebCore::AuthenticationChallenge::authenticationClient): 13 (WebCore::AuthenticationChallenge::soupSession): Deleted. 14 (WebCore::AuthenticationChallenge::soupMessage): Deleted. 15 * platform/network/soup/AuthenticationChallengeSoup.cpp: 16 (WebCore::AuthenticationChallenge::AuthenticationChallenge): 17 (WebCore::AuthenticationChallenge::platformCompare): 18 * platform/network/soup/ResourceHandleSoup.cpp: 19 (WebCore::ResourceHandle::continueDidReceiveAuthenticationChallenge): 20 (WebCore::ResourceHandle::didReceiveAuthenticationChallenge): 21 (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential): 22 (WebCore::ResourceHandle::receivedCredential): 23 (WebCore::ResourceHandle::receivedCancellation): 24 * platform/network/soup/SoupNetworkSession.cpp: 25 (WebCore::authenticateCallback): 26 1 27 2016-10-03 Carlos Garcia Campos <cgarcia@igalia.com> 2 28 -
trunk/Source/WebCore/platform/network/soup/AuthenticationChallenge.h
r165676 r206732 45 45 } 46 46 47 AuthenticationChallenge(Soup Session*, SoupMessage*, SoupAuth*, bool retrying, AuthenticationClient*);47 AuthenticationChallenge(SoupMessage*, SoupAuth*, bool retrying, AuthenticationClient* = nullptr); 48 48 AuthenticationClient* authenticationClient() const { return m_authenticationClient.get(); } 49 SoupSession* soupSession() const { return m_soupSession.get(); }50 SoupMessage* soupMessage() const { return m_soupMessage.get(); }51 49 SoupAuth* soupAuth() const { return m_soupAuth.get(); } 52 50 void setProposedCredential(const Credential& credential) { m_proposedCredential = credential; } … … 56 54 static bool platformCompare(const AuthenticationChallenge&, const AuthenticationChallenge&); 57 55 58 GRefPtr<SoupSession> m_soupSession;59 GRefPtr<SoupMessage> m_soupMessage;60 56 GRefPtr<SoupAuth> m_soupAuth; 61 57 RefPtr<AuthenticationClient> m_authenticationClient; -
trunk/Source/WebCore/platform/network/soup/AuthenticationChallengeSoup.cpp
r166001 r206732 67 67 } 68 68 69 AuthenticationChallenge::AuthenticationChallenge(Soup Session* soupSession, SoupMessage* soupMessage, SoupAuth* soupAuth, bool retrying, AuthenticationClient* client)69 AuthenticationChallenge::AuthenticationChallenge(SoupMessage* soupMessage, SoupAuth* soupAuth, bool retrying, AuthenticationClient* client) 70 70 : AuthenticationChallengeBase(protectionSpaceFromSoupAuthAndMessage(soupAuth, soupMessage), 71 71 Credential(), // proposedCredentials … … 73 73 soupMessage, // failureResponse 74 74 ResourceError::authenticationError(soupMessage)) 75 , m_soupSession(soupSession)76 , m_soupMessage(soupMessage)77 75 , m_soupAuth(soupAuth) 78 76 , m_authenticationClient(client) … … 82 80 bool AuthenticationChallenge::platformCompare(const AuthenticationChallenge& a, const AuthenticationChallenge& b) 83 81 { 84 return a.soupSession() == b.soupSession() 85 && a.soupMessage() == b.soupMessage() 86 && a.soupAuth() == b.soupAuth(); 82 return a.soupAuth() == b.soupAuth(); 87 83 } 88 84 -
trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp
r206731 r206732 970 970 AuthenticationChallenge& challenge = d->m_currentWebChallenge; 971 971 972 ASSERT(challenge.soupSession()); 973 ASSERT(challenge.soupMessage()); 972 ASSERT(d->m_soupMessage); 974 973 if (!credentialFromPersistentStorage.isEmpty()) 975 974 challenge.setProposedCredential(credentialFromPersistentStorage); 976 975 977 976 if (!client()) { 978 soup_session_unpause_message( challenge.soupSession(), challenge.soupMessage());977 soup_session_unpause_message(d->soupSession(), d->m_soupMessage.get()); 979 978 clearAuthentication(); 980 979 return; 981 980 } 982 981 983 ASSERT(challenge.soupSession());984 ASSERT(challenge.soupMessage());985 982 client()->didReceiveAuthenticationChallenge(this, challenge); 986 983 } … … 1016 1013 1017 1014 d->m_currentWebChallenge = challenge; 1018 soup_session_pause_message( challenge.soupSession(), challenge.soupMessage());1015 soup_session_pause_message(d->soupSession(), d->m_soupMessage.get()); 1019 1016 1020 1017 // We could also do this before we even start the request, but that would be at the expense … … 1037 1034 if (challenge != d->m_currentWebChallenge) 1038 1035 return; 1039 soup_session_unpause_message( challenge.soupSession(), challenge.soupMessage());1036 soup_session_unpause_message(d->soupSession(), d->m_soupMessage.get()); 1040 1037 1041 1038 clearAuthentication(); … … 1068 1065 } 1069 1066 1070 ASSERT(challenge.soupSession()); 1071 ASSERT(challenge.soupMessage()); 1067 ASSERT(d->m_soupMessage); 1072 1068 soup_auth_authenticate(challenge.soupAuth(), credential.user().utf8().data(), credential.password().utf8().data()); 1073 soup_session_unpause_message( challenge.soupSession(), challenge.soupMessage());1069 soup_session_unpause_message(d->soupSession(), d->m_soupMessage.get()); 1074 1070 1075 1071 clearAuthentication(); … … 1087 1083 } 1088 1084 1089 ASSERT(challenge.soupSession()); 1090 ASSERT(challenge.soupMessage()); 1091 soup_session_unpause_message(challenge.soupSession(), challenge.soupMessage()); 1085 ASSERT(d->m_soupMessage); 1086 soup_session_unpause_message(d->soupSession(), d->m_soupMessage.get()); 1092 1087 1093 1088 if (client()) -
trunk/Source/WebCore/platform/network/soup/SoupNetworkSession.cpp
r206431 r206732 76 76 } 77 77 78 static void authenticateCallback(SoupSession* session, SoupMessage* soupMessage, SoupAuth* soupAuth, gboolean retrying)78 static void authenticateCallback(SoupSession*, SoupMessage* soupMessage, SoupAuth* soupAuth, gboolean retrying) 79 79 { 80 80 RefPtr<ResourceHandle> handle = static_cast<ResourceHandle*>(g_object_get_data(G_OBJECT(soupMessage), "handle")); 81 81 if (!handle) 82 82 return; 83 handle->didReceiveAuthenticationChallenge(AuthenticationChallenge(s ession, soupMessage, soupAuth, retrying, handle.get()));83 handle->didReceiveAuthenticationChallenge(AuthenticationChallenge(soupMessage, soupAuth, retrying, handle.get())); 84 84 } 85 85
Note: See TracChangeset
for help on using the changeset viewer.