Changeset 42536 in webkit
- Timestamp:
- Apr 14, 2009, 11:43:35 PM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r42534 r42536 1 2009-04-14 Alexey Proskuryakov <ap@webkit.org> 2 3 Rubber-stamped by Darin Adler. 4 5 Don't keep platform objects for authentication challenge in ResourceHandleInternal. 6 We already have a copy in AuthenticationChallenge object. 7 8 * platform/network/ResourceHandle.cpp: 9 (WebCore::ResourceHandle::clearAuthentication): 10 * platform/network/ResourceHandleInternal.h: 11 (WebCore::ResourceHandleInternal::ResourceHandleInternal): 12 * platform/network/cf/ResourceHandleCFNet.cpp: 13 (WebCore::ResourceHandle::didReceiveAuthenticationChallenge): 14 (WebCore::ResourceHandle::receivedCredential): 15 (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential): 16 (WebCore::ResourceHandle::receivedCancellation): 17 * platform/network/mac/ResourceHandleMac.mm: 18 (WebCore::ResourceHandle::didReceiveAuthenticationChallenge): 19 (WebCore::ResourceHandle::didCancelAuthenticationChallenge): 20 (WebCore::ResourceHandle::receivedCredential): 21 (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential): 22 (WebCore::ResourceHandle::receivedCancellation): 23 1 24 2009-04-14 Geoffrey Garen <ggaren@apple.com> 2 25 -
trunk/WebCore/platform/network/ResourceHandle.cpp
r31438 r42536 104 104 void ResourceHandle::clearAuthentication() 105 105 { 106 #if PLATFORM(MAC) 107 d->m_currentMacChallenge = nil; 108 #elif USE(CFNETWORK) 109 d->m_currentCFChallenge = 0; 110 #endif 111 d->m_currentWebChallenge.nullify(); 106 d->m_currentChallenge.nullify(); 112 107 } 113 108 -
trunk/WebCore/platform/network/ResourceHandleInternal.h
r42483 r42536 128 128 #if PLATFORM(MAC) 129 129 , m_startWhenScheduled(false) 130 , m_currentMacChallenge(nil)131 #elif USE(CFNETWORK)132 , m_currentCFChallenge(0)133 130 #endif 134 131 , m_failureTimer(loader, &ResourceHandle::fireFailure) … … 210 207 QWebFrame* m_frame; 211 208 #endif 212 #if PLATFORM(MAC) 213 NSURLAuthenticationChallenge *m_currentMacChallenge; 214 #endif 215 #if USE(CFNETWORK) 216 CFURLAuthChallengeRef m_currentCFChallenge; 217 #endif 218 AuthenticationChallenge m_currentWebChallenge; 209 AuthenticationChallenge m_currentChallenge; 219 210 220 211 ResourceHandle::FailureType m_failureType; -
trunk/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
r42486 r42536 410 410 { 411 411 LOG(Network, "CFNet - didReceiveAuthenticationChallenge()"); 412 ASSERT(!d->m_currentCFChallenge); 413 ASSERT(d->m_currentWebChallenge.isNull()); 412 ASSERT(d->m_currentChallenge.isNull()); 414 413 // Since CFURLConnection networking relies on keeping a reference to the original CFURLAuthChallengeRef, 415 414 // we make sure that is actually present … … 438 437 } 439 438 440 d->m_currentCFChallenge = challenge.cfURLAuthChallengeRef(); 441 d->m_currentWebChallenge = AuthenticationChallenge(d->m_currentCFChallenge, this); 439 d->m_currentChallenge = AuthenticationChallenge(challenge.cfURLAuthChallengeRef(), this); 442 440 443 441 if (client()) 444 client()->didReceiveAuthenticationChallenge(this, d->m_current WebChallenge);442 client()->didReceiveAuthenticationChallenge(this, d->m_currentChallenge); 445 443 } 446 444 … … 450 448 ASSERT(!challenge.isNull()); 451 449 ASSERT(challenge.cfURLAuthChallengeRef()); 452 if (challenge != d->m_current WebChallenge)450 if (challenge != d->m_currentChallenge) 453 451 return; 454 452 … … 473 471 ASSERT(!challenge.isNull()); 474 472 ASSERT(challenge.cfURLAuthChallengeRef()); 475 if (challenge != d->m_current WebChallenge)473 if (challenge != d->m_currentChallenge) 476 474 return; 477 475 … … 484 482 { 485 483 LOG(Network, "CFNet - receivedCancellation()"); 486 if (challenge != d->m_current WebChallenge)484 if (challenge != d->m_currentChallenge) 487 485 return; 488 486 -
trunk/WebCore/platform/network/mac/ResourceHandleMac.mm
r42502 r42536 407 407 void ResourceHandle::didReceiveAuthenticationChallenge(const AuthenticationChallenge& challenge) 408 408 { 409 ASSERT(!d->m_currentMacChallenge); 410 ASSERT(d->m_currentWebChallenge.isNull()); 409 ASSERT(d->m_currentChallenge.isNull()); 411 410 // Since NSURLConnection networking relies on keeping a reference to the original NSURLAuthenticationChallenge, 412 411 // we make sure that is actually present … … 417 416 password:d->m_pass 418 417 persistence:NSURLCredentialPersistenceNone]; 419 d->m_currentMacChallenge = challenge.nsURLAuthenticationChallenge(); 420 d->m_currentWebChallenge = challenge; 418 d->m_currentChallenge = challenge; 421 419 receivedCredential(challenge, core(credential)); 422 420 [credential release]; … … 435 433 } 436 434 437 d->m_currentMacChallenge = challenge.nsURLAuthenticationChallenge(); 438 NSURLAuthenticationChallenge *webChallenge = [[NSURLAuthenticationChallenge alloc] initWithAuthenticationChallenge:d->m_currentMacChallenge 435 NSURLAuthenticationChallenge *webChallenge = [[NSURLAuthenticationChallenge alloc] initWithAuthenticationChallenge:challenge.nsURLAuthenticationChallenge() 439 436 sender:(id<NSURLAuthenticationChallengeSender>)delegate()]; 440 d->m_current WebChallenge = core(webChallenge);437 d->m_currentChallenge = core(webChallenge); 441 438 [webChallenge release]; 442 439 443 440 if (client()) 444 client()->didReceiveAuthenticationChallenge(this, d->m_current WebChallenge);441 client()->didReceiveAuthenticationChallenge(this, d->m_currentChallenge); 445 442 } 446 443 447 444 void ResourceHandle::didCancelAuthenticationChallenge(const AuthenticationChallenge& challenge) 448 445 { 449 ASSERT(d->m_currentMacChallenge); 450 ASSERT(!d->m_currentWebChallenge.isNull()); 451 ASSERT(d->m_currentWebChallenge == challenge); 446 ASSERT(!d->m_currentChallenge.isNull()); 447 ASSERT(d->m_currentChallenge == challenge); 452 448 453 449 if (client()) … … 458 454 { 459 455 ASSERT(!challenge.isNull()); 460 if (challenge != d->m_currentWebChallenge) 461 return; 456 if (challenge != d->m_currentChallenge) 457 return; 458 459 NSURLAuthenticationChallenge *currentMacChallenge = challenge.nsURLAuthenticationChallenge(); 462 460 463 461 #ifdef BUILDING_ON_TIGER … … 465 463 // NSURLCredentialPersistenceNone doesn't work on Tiger, so we have to use session persistence. 466 464 Credential webCredential(credential.user(), credential.password(), CredentialPersistenceForSession); 467 WebCoreCredentialStorage::set(mac(webCredential), [ d->m_currentMacChallenge protectionSpace]);468 [[ d->m_currentMacChallenge sender] useCredential:mac(webCredential) forAuthenticationChallenge:d->m_currentMacChallenge];465 WebCoreCredentialStorage::set(mac(webCredential), [currentMacChallenge protectionSpace]); 466 [[currentMacChallenge sender] useCredential:mac(webCredential) forAuthenticationChallenge:currentMacChallenge]; 469 467 } else 470 468 #else … … 473 471 // to ignore it for a particular request (short of removing it altogether). 474 472 Credential webCredential(credential.user(), credential.password(), CredentialPersistenceNone); 475 WebCoreCredentialStorage::set(mac(webCredential), [ d->m_currentMacChallenge protectionSpace]);476 [[ d->m_currentMacChallenge sender] useCredential:mac(webCredential) forAuthenticationChallenge:d->m_currentMacChallenge];473 WebCoreCredentialStorage::set(mac(webCredential), [currentMacChallenge protectionSpace]); 474 [[currentMacChallenge sender] useCredential:mac(webCredential) forAuthenticationChallenge:currentMacChallenge]; 477 475 } else 478 476 #endif 479 [[ d->m_currentMacChallenge sender] useCredential:mac(credential) forAuthenticationChallenge:d->m_currentMacChallenge];477 [[currentMacChallenge sender] useCredential:mac(credential) forAuthenticationChallenge:currentMacChallenge]; 480 478 481 479 clearAuthentication(); … … 485 483 { 486 484 ASSERT(!challenge.isNull()); 487 if (challenge != d->m_currentWebChallenge) 488 return; 489 490 [[d->m_currentMacChallenge sender] continueWithoutCredentialForAuthenticationChallenge:d->m_currentMacChallenge]; 485 if (challenge != d->m_currentChallenge) 486 return; 487 488 NSURLAuthenticationChallenge *currentMacChallenge = challenge.nsURLAuthenticationChallenge(); 489 [[currentMacChallenge sender] continueWithoutCredentialForAuthenticationChallenge:currentMacChallenge]; 491 490 492 491 clearAuthentication(); … … 495 494 void ResourceHandle::receivedCancellation(const AuthenticationChallenge& challenge) 496 495 { 497 if (challenge != d->m_current WebChallenge)496 if (challenge != d->m_currentChallenge) 498 497 return; 499 498
Note:
See TracChangeset
for help on using the changeset viewer.