Changeset 196453 in webkit
- Timestamp:
- Feb 11, 2016 4:02:03 PM (8 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 4 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r196452 r196453 1 2016-02-11 Alex Christensen <achristensen@webkit.org> 2 3 Move Download authentication code to AuthenticationManager 4 https://bugs.webkit.org/show_bug.cgi?id=154132 5 6 Reviewed by Sam Weinig. 7 8 When a video element makes a request that receives an authentication challenge, the 9 AuthenticationManager receives an AuthenticationChallenge without an AuthenticationClient. 10 As a result, Download::receivedCredential and other functions were being called, which 11 sent a message to the challenge's sender. This functionality is not specific to downloads, 12 so I moved it from Download to AuthenticationManager. 13 14 This fixes http/tests/media/video-auth.html when using NetworkSession 15 because I use AuthenticationManager::receivedCredential if there is no AuthenticationClient 16 instead of improperly asserting that there is always an AuthenticationClient if there is no 17 completionHandler. 18 19 * NetworkProcess/Downloads/Download.h: 20 * NetworkProcess/Downloads/ios/DownloadIOS.mm: 21 (WebKit::Download::platformDidFinish): 22 (WebKit::Download::receivedCredential): Deleted. 23 (WebKit::Download::receivedRequestToContinueWithoutCredential): Deleted. 24 (WebKit::Download::receivedCancellation): Deleted. 25 (WebKit::Download::receivedRequestToPerformDefaultHandling): Deleted. 26 (WebKit::Download::receivedChallengeRejection): Deleted. 27 * NetworkProcess/Downloads/mac/DownloadMac.mm: 28 (WebKit::Download::platformDidFinish): 29 (WebKit::Download::receivedCredential): Deleted. 30 (WebKit::Download::receivedRequestToContinueWithoutCredential): Deleted. 31 (WebKit::Download::receivedCancellation): Deleted. 32 (WebKit::Download::receivedRequestToPerformDefaultHandling): Deleted. 33 (WebKit::Download::receivedChallengeRejection): Deleted. 34 * NetworkProcess/Downloads/soup/DownloadSoup.cpp: 35 (WebKit::Download::platformDidFinish): 36 (WebKit::Download::receivedCredential): Deleted. 37 (WebKit::Download::receivedRequestToContinueWithoutCredential): Deleted. 38 (WebKit::Download::receivedCancellation): Deleted. 39 (WebKit::Download::continueWithoutCredential): Deleted. 40 (WebKit::Download::useCredential): Deleted. 41 (WebKit::Download::cancelAuthenticationChallenge): Deleted. 42 (WebKit::Download::receivedRequestToPerformDefaultHandling): Deleted. 43 (WebKit::Download::receivedChallengeRejection): Deleted. 44 * PlatformEfl.cmake: 45 * PlatformGTK.cmake: 46 * PlatformMac.cmake: 47 * Shared/Authentication/AuthenticationManager.cpp: 48 (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge): 49 (WebKit::AuthenticationManager::useCredentialForSingleChallenge): 50 (WebKit::AuthenticationManager::continueWithoutCredentialForChallenge): 51 (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge): 52 (WebKit::AuthenticationManager::cancelChallenge): 53 (WebKit::AuthenticationManager::cancelSingleChallenge): 54 (WebKit::AuthenticationManager::performDefaultHandling): 55 (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge): 56 (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinue): 57 (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge): 58 * Shared/Authentication/AuthenticationManager.h: 59 (WebKit::AuthenticationManager::outstandingAuthenticationChallengeCount): 60 * Shared/Authentication/cocoa: Added. 61 * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm: Added. 62 (WebKit::AuthenticationManager::receivedCredential): 63 (WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential): 64 (WebKit::AuthenticationManager::receivedCancellation): 65 (WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling): 66 (WebKit::AuthenticationManager::receivedChallengeRejection): 67 * Shared/Authentication/soup: Added. 68 * Shared/Authentication/soup/AuthenticationManagerSoup.cpp: Added. 69 (WebKit::AuthenticationManager::receivedCredential): 70 (WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential): 71 (WebKit::AuthenticationManager::receivedCancellation): 72 (WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling): 73 (WebKit::AuthenticationManager::receivedChallengeRejection): 74 * WebKit2.xcodeproj/project.pbxproj: 75 1 76 2016-02-11 Beth Dakin <bdakin@apple.com> 2 77 -
trunk/Source/WebKit2/NetworkProcess/Downloads/Download.h
r194810 r196453 114 114 #endif 115 115 116 #if !USE(NETWORK_SESSION)117 // Authentication118 static void receivedCredential(const WebCore::AuthenticationChallenge&, const WebCore::Credential&);119 static void receivedRequestToContinueWithoutCredential(const WebCore::AuthenticationChallenge&);120 static void receivedCancellation(const WebCore::AuthenticationChallenge&);121 static void receivedRequestToPerformDefaultHandling(const WebCore::AuthenticationChallenge&);122 static void receivedChallengeRejection(const WebCore::AuthenticationChallenge&);123 124 void useCredential(const WebCore::AuthenticationChallenge&, const WebCore::Credential&);125 void continueWithoutCredential(const WebCore::AuthenticationChallenge&);126 void cancelAuthenticationChallenge(const WebCore::AuthenticationChallenge&);127 #endif128 129 116 private: 130 117 // IPC::MessageSender -
trunk/Source/WebKit2/NetworkProcess/Downloads/ios/DownloadIOS.mm
r194472 r196453 158 158 } 159 159 160 void Download::receivedCredential(const AuthenticationChallenge&, const Credential&)161 {162 notImplemented();163 }164 165 void Download::receivedRequestToContinueWithoutCredential(const AuthenticationChallenge&)166 {167 notImplemented();168 }169 170 void Download::receivedCancellation(const AuthenticationChallenge&)171 {172 notImplemented();173 }174 175 void Download::receivedRequestToPerformDefaultHandling(const WebCore::AuthenticationChallenge&)176 {177 notImplemented();178 }179 180 void Download::receivedChallengeRejection(const WebCore::AuthenticationChallenge&)181 {182 notImplemented();183 }184 185 160 } // namespace WebKit 186 161 -
trunk/Source/WebKit2/NetworkProcess/Downloads/mac/DownloadMac.mm
r194472 r196453 132 132 } 133 133 134 void Download::receivedCredential(const AuthenticationChallenge& authenticationChallenge, const Credential& credential)135 {136 [authenticationChallenge.sender() useCredential:credential.nsCredential() forAuthenticationChallenge:authenticationChallenge.nsURLAuthenticationChallenge()];137 }138 139 void Download::receivedRequestToContinueWithoutCredential(const AuthenticationChallenge& authenticationChallenge)140 {141 [authenticationChallenge.sender() continueWithoutCredentialForAuthenticationChallenge:authenticationChallenge.nsURLAuthenticationChallenge()];142 }143 144 void Download::receivedCancellation(const AuthenticationChallenge& authenticationChallenge)145 {146 [authenticationChallenge.sender() cancelAuthenticationChallenge:authenticationChallenge.nsURLAuthenticationChallenge()];147 }148 149 void Download::receivedRequestToPerformDefaultHandling(const AuthenticationChallenge& authenticationChallenge)150 {151 [authenticationChallenge.sender() performDefaultHandlingForAuthenticationChallenge:authenticationChallenge.nsURLAuthenticationChallenge()];152 }153 154 void Download::receivedChallengeRejection(const AuthenticationChallenge& authenticationChallenge)155 {156 [authenticationChallenge.sender() rejectProtectionSpaceAndContinueWithChallenge:authenticationChallenge.nsURLAuthenticationChallenge()];157 }158 159 134 } // namespace WebKit 160 135 -
trunk/Source/WebKit2/NetworkProcess/Downloads/soup/DownloadSoup.cpp
r194419 r196453 270 270 } 271 271 272 void Download::receivedCredential(const AuthenticationChallenge&, const Credential&)273 {274 notImplemented();275 }276 277 void Download::receivedRequestToContinueWithoutCredential(const AuthenticationChallenge&)278 {279 notImplemented();280 }281 282 void Download::receivedCancellation(const AuthenticationChallenge&)283 {284 notImplemented();285 }286 287 void Download::continueWithoutCredential(const AuthenticationChallenge &)288 {289 notImplemented();290 }291 292 void Download::useCredential(const AuthenticationChallenge&, const Credential&)293 {294 notImplemented();295 }296 297 void Download::cancelAuthenticationChallenge(const AuthenticationChallenge&)298 {299 notImplemented();300 }301 302 void Download::receivedRequestToPerformDefaultHandling(const AuthenticationChallenge&)303 {304 notImplemented();305 }306 307 void Download::receivedChallengeRejection(const AuthenticationChallenge&)308 {309 notImplemented();310 }311 312 272 } // namespace WebKit -
trunk/Source/WebKit2/PlatformEfl.cmake
r196053 r196453 29 29 30 30 Shared/API/c/efl/WKArrayEfl.cpp 31 32 Shared/Authentication/soup/AuthenticationManagerSoup.cpp 31 33 32 34 Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp -
trunk/Source/WebKit2/PlatformGTK.cmake
r196053 r196453 57 57 58 58 Shared/API/c/cairo/WKImageCairo.cpp 59 60 Shared/Authentication/soup/AuthenticationManagerSoup.cpp 59 61 60 62 Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp -
trunk/Source/WebKit2/PlatformMac.cmake
r196064 r196453 54 54 Shared/APIWebArchive.mm 55 55 Shared/APIWebArchiveResource.mm 56 57 Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm 56 58 57 59 Shared/API/Cocoa/RemoteObjectInvocation.mm -
trunk/Source/WebKit2/Shared/Authentication/AuthenticationManager.cpp
r194810 r196453 117 117 uint64_t challengeID = addChallengeToChallengeMap({pageID, authenticationChallenge 118 118 #if USE(NETWORK_SESSION) 119 , ChallengeCompletionHandler()119 , { } 120 120 #endif 121 121 }); … … 162 162 uint64_t challengeID = addChallengeToChallengeMap({pageID, authenticationChallenge 163 163 #if USE(NETWORK_SESSION) 164 , ChallengeCompletionHandler()164 , { } 165 165 #endif 166 166 }); … … 220 220 return; 221 221 } 222 #else 223 if (!coreClient) { 224 // FIXME: The authentication client is null for downloads, but it can also be null for canceled loads. 225 // We should not call Download::receivedCredential in the latter case. 226 Download::receivedCredential(challenge.challenge, credential); 227 return; 228 } 229 #endif 230 231 ASSERT(coreClient); 232 coreClient->receivedCredential(challenge.challenge, credential); 222 #endif 223 224 if (coreClient) 225 coreClient->receivedCredential(challenge.challenge, credential); 226 else 227 receivedCredential(challenge.challenge, credential); 233 228 } 234 229 … … 253 248 return; 254 249 } 255 #else 256 if (!coreClient) { 257 // FIXME: The authentication client is null for downloads, but it can also be null for canceled loads. 258 // We should not call Download::receivedCredential in the latter case. 259 Download::receivedRequestToContinueWithoutCredential(challenge.challenge); 260 return; 261 } 262 #endif 263 264 ASSERT(coreClient); 265 coreClient->receivedRequestToContinueWithoutCredential(challenge.challenge); 250 #endif 251 252 if (coreClient) 253 coreClient->receivedRequestToContinueWithoutCredential(challenge.challenge); 254 else 255 receivedRequestToContinueWithoutCredential(challenge.challenge); 266 256 } 267 257 … … 286 276 return; 287 277 } 288 #else 289 if (!coreClient) { 290 // FIXME: The authentication client is null for downloads, but it can also be null for canceled loads. 291 // We should not call Download::receivedCredential in the latter case. 292 Download::receivedCancellation(challenge.challenge); 293 return; 294 } 295 #endif 296 297 ASSERT(coreClient); 298 coreClient->receivedCancellation(challenge.challenge); 278 #endif 279 280 if (coreClient) 281 coreClient->receivedCancellation(challenge.challenge); 282 else 283 receivedCancellation(challenge.challenge); 299 284 } 300 285 … … 319 304 return; 320 305 } 321 #else 322 if (!coreClient) { 323 // FIXME: The authentication client is null for downloads, but it can also be null for canceled loads. 324 // We should not call Download::receivedCredential in the latter case. 325 Download::receivedRequestToPerformDefaultHandling(challenge.challenge); 326 return; 327 } 328 #endif 329 330 ASSERT(coreClient); 331 coreClient->receivedRequestToPerformDefaultHandling(challenge.challenge); 306 #endif 307 308 if (coreClient) 309 coreClient->receivedRequestToPerformDefaultHandling(challenge.challenge); 310 else 311 receivedRequestToPerformDefaultHandling(challenge.challenge); 332 312 } 333 313 … … 352 332 return; 353 333 } 354 #else 355 if (!coreClient) { 356 // FIXME: The authentication client is null for downloads, but it can also be null for canceled loads. 357 // We should not call Download::receivedCredential in the latter case. 358 Download::receivedChallengeRejection(challenge.challenge); 359 return; 360 } 361 #endif 362 363 ASSERT(coreClient); 364 coreClient->receivedChallengeRejection(challenge.challenge); 334 #endif 335 336 if (coreClient) 337 coreClient->receivedChallengeRejection(challenge.challenge); 338 else 339 receivedChallengeRejection(challenge.challenge); 365 340 } 366 341 -
trunk/Source/WebKit2/Shared/Authentication/AuthenticationManager.h
r195509 r196453 77 77 uint64_t outstandingAuthenticationChallengeCount() const { return m_challenges.size(); } 78 78 79 static void receivedCredential(const WebCore::AuthenticationChallenge&, const WebCore::Credential&); 80 static void receivedRequestToContinueWithoutCredential(const WebCore::AuthenticationChallenge&); 81 static void receivedCancellation(const WebCore::AuthenticationChallenge&); 82 static void receivedRequestToPerformDefaultHandling(const WebCore::AuthenticationChallenge&); 83 static void receivedChallengeRejection(const WebCore::AuthenticationChallenge&); 84 79 85 private: 80 86 struct Challenge { -
trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
r196370 r196453 1040 1040 52D5A1B11C57496200DE34A3 /* WebVideoFullscreenManagerProxy.mm in Sources */ = {isa = PBXBuildFile; fileRef = 52D5A1AC1C57494E00DE34A3 /* WebVideoFullscreenManagerProxy.mm */; }; 1041 1041 52D5A1B71C574A0200DE34A3 /* WebVideoFullscreenManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 52D5A1B41C5749F200DE34A3 /* WebVideoFullscreenManager.mm */; }; 1042 5C052F261C6D3BD30076E919 /* AuthenticationManagerCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C052F241C6D3AB60076E919 /* AuthenticationManagerCocoa.mm */; }; 1042 1043 5C1426EC1C23F80900D41183 /* NetworkProcessCreationParameters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C1426E21C23F80500D41183 /* NetworkProcessCreationParameters.cpp */; }; 1043 1044 5C1426ED1C23F80900D41183 /* NetworkProcessCreationParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C1426E31C23F80500D41183 /* NetworkProcessCreationParameters.h */; }; … … 3131 3132 52D5A1B31C5749F200DE34A3 /* WebVideoFullscreenManager.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebVideoFullscreenManager.messages.in; sourceTree = "<group>"; }; 3132 3133 52D5A1B41C5749F200DE34A3 /* WebVideoFullscreenManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebVideoFullscreenManager.mm; sourceTree = "<group>"; }; 3134 5C052F241C6D3AB60076E919 /* AuthenticationManagerCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AuthenticationManagerCocoa.mm; path = Authentication/cocoa/AuthenticationManagerCocoa.mm; sourceTree = "<group>"; }; 3133 3135 5C1426E21C23F80500D41183 /* NetworkProcessCreationParameters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NetworkProcessCreationParameters.cpp; path = NetworkProcess/NetworkProcessCreationParameters.cpp; sourceTree = "<group>"; }; 3134 3136 5C1426E31C23F80500D41183 /* NetworkProcessCreationParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkProcessCreationParameters.h; path = NetworkProcess/NetworkProcessCreationParameters.h; sourceTree = "<group>"; }; … … 5532 5534 isa = PBXGroup; 5533 5535 children = ( 5536 5C052F231C6D3AA10076E919 /* cocoa */, 5534 5537 518E8EF616B2091C00E91429 /* mac */, 5535 5538 518E8EF316B2091C00E91429 /* AuthenticationManager.cpp */, … … 5648 5651 ); 5649 5652 name = IconDatabase; 5653 sourceTree = "<group>"; 5654 }; 5655 5C052F231C6D3AA10076E919 /* cocoa */ = { 5656 isa = PBXGroup; 5657 children = ( 5658 5C052F241C6D3AB60076E919 /* AuthenticationManagerCocoa.mm */, 5659 ); 5660 name = cocoa; 5650 5661 sourceTree = "<group>"; 5651 5662 }; … … 9241 9252 BCCF673312C7F15C008F9C35 /* OriginAndDatabases.cpp in Sources */, 9242 9253 7C387434172F5615001BD88A /* PageBanner.cpp in Sources */, 9254 5C052F261C6D3BD30076E919 /* AuthenticationManagerCocoa.mm in Sources */, 9243 9255 7C6D37FC172F555F009D2847 /* PageBannerMac.mm in Sources */, 9244 9256 0FCB4E6318BBE3D9000FCFC9 /* PageClientImpl.mm in Sources */,
Note: See TracChangeset
for help on using the changeset viewer.