Changeset 129087 in webkit
- Timestamp:
- Sep 19, 2012 7:34:43 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r129086 r129087 1 2012-09-19 Sean Wang <Xuewen.Wang@torchmobile.com.cn> 2 3 [BlackBerry] Basic authentication challenge credentials for stored credentials again after restarting browser 4 https://bugs.webkit.org/show_bug.cgi?id=96362 5 6 Reviewed by Rob Buis. 7 8 This patch enable reading credentials from the persistent credential storage 9 when it is not private browsing mode and there is not a credential in the RAM 10 for the requested resource. 11 12 Since we don't load persistent stored credentials into RAM at the starting time, 13 even we have saved the credentials at the last browsing, after restarting the browser, 14 it will still challenge for credentials for the requesting resources. 15 16 No new tests, it uses the original authentication tests. There is no way to 17 clear all credentials or restarting browsers to test this feature. 18 19 * platform/network/blackberry/CredentialBackingStore.cpp: 20 (WebCore::CredentialBackingStore::getProtectionSpace): 21 (WebCore): 22 * platform/network/blackberry/CredentialBackingStore.h: 23 (CredentialBackingStore): 24 * platform/network/blackberry/NetworkManager.cpp: 25 (WebCore::NetworkManager::startJob): 26 1 27 2012-09-19 Shinya Kawanaka <shinyak@chromium.org> 2 28 -
trunk/Source/WebCore/platform/network/blackberry/CredentialBackingStore.cpp
r128312 r129087 254 254 } 255 255 256 ProtectionSpace CredentialBackingStore::getProtectionSpace(const KURL& url) 257 { 258 ASSERT(m_database.isOpen()); 259 ASSERT(m_database.tableExists("logins")); 260 261 if (!m_getLoginByURLStatement) 262 return ProtectionSpace(); 263 264 m_getLoginByURLStatement->bindText(1, url.string()); 265 266 int result = m_getLoginByURLStatement->step(); 267 String username = m_getLoginByURLStatement->getColumnText(0); 268 String password = m_usingCertManager ? "" : m_getLoginByURLStatement->getColumnBlobAsString(1); 269 String host = m_getLoginByURLStatement->getColumnText(2); 270 int port = m_getLoginByURLStatement->getColumnInt(3); 271 int serviceType = m_getLoginByURLStatement->getColumnInt(4); 272 String realm = m_getLoginByURLStatement->getColumnText(5); 273 int authenticationScheme = m_getLoginByURLStatement->getColumnInt(6); 274 m_getLoginByURLStatement->reset(); 275 HANDLE_SQL_EXEC_FAILURE(result != SQLResultRow, ProtectionSpace(), 276 "Failed to execute select login info from table logins in getLoginByURL - %i", result); 277 278 return ProtectionSpace (host, port, static_cast<ProtectionSpaceServerType>(serviceType), 279 realm, static_cast<ProtectionSpaceAuthenticationScheme>(authenticationScheme)); 280 } 281 256 282 Credential CredentialBackingStore::getLogin(const ProtectionSpace& protectionSpace) 257 283 { -
trunk/Source/WebCore/platform/network/blackberry/CredentialBackingStore.h
r128312 r129087 45 45 bool updateLogin(const KURL&, const ProtectionSpace&, const Credential&); 46 46 bool hasLogin(const KURL&, const ProtectionSpace&); 47 ProtectionSpace getProtectionSpace(const KURL&); 47 48 Credential getLogin(const ProtectionSpace&); 48 49 Credential getLogin(const KURL&); -
trunk/Source/WebCore/platform/network/blackberry/NetworkManager.cpp
r128182 r129087 21 21 22 22 #include "Chrome.h" 23 #if ENABLE(BLACKBERRY_CREDENTIAL_PERSIST) 24 #include "CredentialBackingStore.h" 25 #endif 23 26 #include "CredentialStorage.h" 24 27 #include "Frame.h" … … 27 30 #include "Page.h" 28 31 #include "ReadOnlyLatin1String.h" 32 #if ENABLE(BLACKBERRY_CREDENTIAL_PERSIST) 33 #include "ResourceHandleClient.h" 34 #endif 29 35 #include "ResourceHandleInternal.h" 30 36 #include "ResourceRequest.h" … … 130 136 // try and reuse the credential preemptively, as allowed by RFC 2617. 131 137 Credential credential = CredentialStorage::get(url); 138 #if ENABLE(BLACKBERRY_CREDENTIAL_PERSIST) 139 // FIXME: needs to refactor the credentialBackingStore to get credential and protection space at one time. 140 if (credential.isEmpty() && guardJob->client()->shouldUseCredentialStorage(guardJob.get())) { 141 credential = credentialBackingStore().getLogin(url); 142 if (!credential.isEmpty()) 143 CredentialStorage::set(credential, credentialBackingStore().getProtectionSpace(url), url); 144 } 145 #endif 132 146 if (!credential.isEmpty()) 133 147 platformRequest.setCredentials(credential.user().utf8().data(), credential.password().utf8().data(), BlackBerry::Platform::NetworkRequest::AuthHTTPBasic); -
trunk/Source/WebKit/blackberry/ChangeLog
r129044 r129087 1 2012-09-19 Sean Wang <Xuewen.Wang@torchmobile.com.cn> 2 3 [BlackBerry] Basic authentication challenge credentials for stored credentials again after restarting browser 4 https://bugs.webkit.org/show_bug.cgi?id=96362 5 6 Reviewed by Rob Buis. 7 8 Make the FrameLoaderClient use credential storage according to the macro 9 BLACKBERRY_CREDENTIAL_PERSIST 10 11 * WebCoreSupport/FrameLoaderClientBlackBerry.cpp: 12 (WebCore::FrameLoaderClientBlackBerry::shouldUseCredentialStorage): 13 (WebCore): 14 * WebCoreSupport/FrameLoaderClientBlackBerry.h: 15 (FrameLoaderClientBlackBerry): 16 1 17 2012-09-19 Mike Fenton <mifenton@rim.com> 2 18 -
trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp
r129010 r129087 58 58 #include "ProtectionSpace.h" 59 59 #include "ScopePointer.h" 60 #if ENABLE(BLACKBERRY_CREDENTIAL_PERSIST) 61 #include "Settings.h" 62 #endif 60 63 #include "SharedBuffer.h" 61 64 #include "SkData.h" … … 1013 1016 } 1014 1017 1018 bool FrameLoaderClientBlackBerry::shouldUseCredentialStorage(DocumentLoader* loader, long unsigned identifier) 1019 { 1020 #if ENABLE(BLACKBERRY_CREDENTIAL_PERSIST) 1021 if (m_frame->page()->settings()->privateBrowsingEnabled()) 1022 return false; 1023 return true; 1024 #else 1025 return false; 1026 #endif 1027 } 1028 1015 1029 void FrameLoaderClientBlackBerry::loadIconExternally(const String& originalPageUrl, const String& finalPageUrl, const String& iconUrl) 1016 1030 { -
trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.h
r128211 r129087 57 57 virtual void assignIdentifierToInitialRequest(long unsigned int, DocumentLoader*, const ResourceRequest&) { notImplemented(); } 58 58 virtual void dispatchWillSendRequest(DocumentLoader*, long unsigned int, ResourceRequest&, const ResourceResponse&); 59 virtual bool shouldUseCredentialStorage(DocumentLoader*, long unsigned int) { notImplemented(); return false; }59 virtual bool shouldUseCredentialStorage(DocumentLoader*, long unsigned); 60 60 virtual void dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, long unsigned int, const AuthenticationChallenge&) { notImplemented(); } 61 61 virtual void dispatchDidCancelAuthenticationChallenge(DocumentLoader*, long unsigned int, const AuthenticationChallenge&) { notImplemented(); }
Note: See TracChangeset
for help on using the changeset viewer.