Changeset 86169 in webkit
- Timestamp:
- May 10, 2011 11:04:00 AM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r86168 r86169 1 2011-05-10 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Extra sign in required to view video on MobileMe Gallery album 6 https://bugs.webkit.org/show_bug.cgi?id=60560 7 <rdar://problem/9338693> 8 9 Add symbols required by WebKit2. 10 11 * WebCore.exp.in: 12 1 13 2011-05-10 Alexander Pavlov <apavlov@chromium.org> 2 14 -
trunk/Source/WebCore/WebCore.exp.in
r86039 r86169 490 490 __ZN7WebCore16startOfParagraphERKNS_15VisiblePositionENS_27EditingBoundaryCrossingRuleE 491 491 __ZN7WebCore17CredentialStorage3getERKNS_15ProtectionSpaceE 492 __ZN7WebCore17CredentialStorage24getFromPersistentStorageERKNS_15ProtectionSpaceE 492 493 __ZN7WebCore17DOMImplementation13isXMLMIMETypeERKN3WTF6StringE 493 494 __ZN7WebCore17DOMImplementation14isTextMIMETypeERKN3WTF6StringE … … 1015 1016 __ZNK3WTF6String14createCFStringEv 1016 1017 __ZNK7WebCore5Frame26getDocumentBackgroundColorEv 1018 __ZNK7WebCore10Credential11hasPasswordEv 1017 1019 __ZNK7WebCore10Credential11persistenceEv 1018 1020 __ZNK7WebCore10Credential4userEv 1021 __ZNK7WebCore10Credential7isEmptyEv 1019 1022 __ZNK7WebCore10Credential8passwordEv 1020 1023 __ZNK7WebCore10FloatPointcv8_NSPointEv -
trunk/Source/WebKit2/ChangeLog
r86161 r86169 1 2011-05-10 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Extra sign in required to view video on MobileMe Gallery album 6 https://bugs.webkit.org/show_bug.cgi?id=60560 7 8 Implement NPN_GetAuthenticationInfo. 9 10 * PluginProcess/PluginControllerProxy.cpp: 11 (WebKit::PluginControllerProxy::getAuthenticationInfo): 12 Send a GetAuthenticationInfo message to the web process. 13 14 * PluginProcess/PluginControllerProxy.h: 15 * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: 16 (WebKit::initializeProtectionSpace): 17 Initialize a WebCore::ProtectionSpace object from NPAPI parameters. 18 19 (WebKit::NPN_GetAuthenticationInfo): 20 Make a ProtectionSpace object and then call NetscapePlugin::getAuthenticationInfo. 21 Finally, copy the username/password and pass them back to the plug-in. 22 23 * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: 24 (WebKit::NetscapePlugin::getAuthenticationInfo): 25 Call the plug-in controller. 26 27 * WebProcess/Plugins/PluginController.h: 28 Add getAuthenticationInfo pure virtual member function. 29 30 * WebProcess/Plugins/PluginProxy.cpp: 31 (WebKit::PluginProxy::getAuthenticationInfo): 32 Call the real plug-in controller's getAuthenticationInfo member function. 33 34 * WebProcess/Plugins/PluginProxy.messages.in: 35 Add GetAuthenticationInfo message. 36 37 * WebProcess/Plugins/PluginView.cpp: 38 (WebKit::PluginView::getAuthenticationInfo): 39 Try to get the authentication info from the credential storage. Failing that, 40 get it from the persistent credential storage. 41 1 42 2011-05-10 Adam Roben <aroben@apple.com> 2 43 -
trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp
r85961 r86169 355 355 } 356 356 357 bool PluginControllerProxy::getAuthenticationInfo(const ProtectionSpace& protectionSpace, String& username, String& password) 358 { 359 bool returnValue; 360 if (!m_connection->connection()->sendSync(Messages::PluginProxy::GetAuthenticationInfo(protectionSpace), Messages::PluginProxy::GetAuthenticationInfo::Reply(returnValue, username, password), m_pluginInstanceID)) 361 return false; 362 363 return returnValue; 364 } 365 357 366 void PluginControllerProxy::protectPluginFromDestruction() 358 367 { -
trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.h
r85961 r86169 103 103 virtual void setCookiesForURL(const String& urlString, const String& cookieString); 104 104 virtual bool isPrivateBrowsingEnabled(); 105 virtual bool getAuthenticationInfo(const WebCore::ProtectionSpace&, String& username, String& password); 105 106 virtual void protectPluginFromDestruction(); 106 107 virtual void unprotectPluginFromDestruction(); -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp
r85859 r86169 33 33 #include <WebCore/IdentifierRep.h> 34 34 #include <WebCore/NotImplemented.h> 35 #include <WebCore/ProtectionSpace.h> 35 36 #include <WebCore/SharedBuffer.h> 36 37 #include <utility> … … 855 856 } 856 857 857 static NPError NPN_GetAuthenticationInfo(NPP instance, const char* protocol, const char* host, int32_t port, const char* scheme, 858 const char* realm, char** username, uint32_t* ulen, char** password, uint32_t* plen) 859 { 860 notImplemented(); 861 return NPERR_GENERIC_ERROR; 858 static bool initializeProtectionSpace(const char* protocol, const char* host, int port, const char* scheme, const char* realm, ProtectionSpace& protectionSpace) 859 { 860 ProtectionSpaceServerType serverType; 861 if (!strcasecmp(protocol, "http")) 862 serverType = ProtectionSpaceServerHTTP; 863 else if (!strcasecmp(protocol, "https")) 864 serverType = ProtectionSpaceServerHTTPS; 865 else { 866 // We only care about http and https. 867 return false; 868 } 869 870 ProtectionSpaceAuthenticationScheme authenticationScheme = ProtectionSpaceAuthenticationSchemeDefault; 871 if (serverType == ProtectionSpaceServerHTTP) { 872 if (!strcasecmp(scheme, "basic")) 873 authenticationScheme = ProtectionSpaceAuthenticationSchemeHTTPBasic; 874 else if (!strcmp(scheme, "digest")) 875 authenticationScheme = ProtectionSpaceAuthenticationSchemeHTTPDigest; 876 } 877 878 protectionSpace = ProtectionSpace(host, port, serverType, realm, authenticationScheme); 879 return true; 880 } 881 882 static NPError NPN_GetAuthenticationInfo(NPP npp, const char* protocol, const char* host, int32_t port, const char* scheme, 883 const char* realm, char** username, uint32_t* usernameLength, char** password, uint32_t* passwordLength) 884 { 885 if (!protocol || !host || !scheme || !realm || !username || !usernameLength || !password || !passwordLength) 886 return NPERR_GENERIC_ERROR; 887 888 ProtectionSpace protectionSpace; 889 if (!initializeProtectionSpace(protocol, host, port, scheme, realm, protectionSpace)) 890 return NPERR_GENERIC_ERROR; 891 892 RefPtr<NetscapePlugin> plugin = NetscapePlugin::fromNPP(npp); 893 String usernameString; 894 String passwordString; 895 if (!plugin->getAuthenticationInfo(protectionSpace, usernameString, passwordString)) 896 return NPERR_GENERIC_ERROR; 897 898 NPError result = copyCString(usernameString.utf8(), username, usernameLength); 899 if (result != NPERR_NO_ERROR) 900 return result; 901 902 result = copyCString(passwordString.utf8(), password, passwordLength); 903 if (result != NPERR_NO_ERROR) { 904 npnMemFree(*username); 905 return result; 906 } 907 908 return NPERR_NO_ERROR; 862 909 } 863 910 -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
r85961 r86169 289 289 } 290 290 291 bool NetscapePlugin::getAuthenticationInfo(const ProtectionSpace& protectionSpace, String& username, String& password) 292 { 293 return m_pluginController->getAuthenticationInfo(protectionSpace, username, password); 294 } 295 291 296 NPError NetscapePlugin::NPP_New(NPMIMEType pluginType, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData* savedData) 292 297 { -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
r85961 r86169 38 38 namespace WebCore { 39 39 class HTTPHeaderMap; 40 class ProtectionSpace; 40 41 } 41 42 … … 100 101 String cookiesForURL(const String& urlString); 101 102 void setCookiesForURL(const String& urlString, const String& cookieString); 103 bool getAuthenticationInfo(const WebCore::ProtectionSpace&, String& username, String& password); 102 104 103 105 // Member functions for calling into the plug-in. -
trunk/Source/WebKit2/WebProcess/Plugins/PluginController.h
r85961 r86169 36 36 class IntRect; 37 37 class KURL; 38 class ProtectionSpace; 38 39 } 39 40 … … 120 121 virtual void setCookiesForURL(const String& urlString, const String& cookieString) = 0; 121 122 123 // Get authentication credentials for the given protection space. 124 virtual bool getAuthenticationInfo(const WebCore::ProtectionSpace&, String& username, String& password) = 0; 125 122 126 // Returns whether private browsing is enabled. 123 127 virtual bool isPrivateBrowsingEnabled() = 0; -
trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp
r85961 r86169 396 396 } 397 397 398 void PluginProxy::getAuthenticationInfo(const ProtectionSpace& protectionSpace, bool& returnValue, String& username, String& password) 399 { 400 returnValue = m_pluginController->getAuthenticationInfo(protectionSpace, username, password); 401 } 402 398 403 void PluginProxy::getWindowScriptNPObject(uint64_t& windowScriptNPObjectID) 399 404 { -
trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.h
r85961 r86169 39 39 namespace WebCore { 40 40 class HTTPHeaderMap; 41 class ProtectionSpace; 41 42 } 42 43 … … 111 112 void cookiesForURL(const String& urlString, String& cookieString); 112 113 void setCookiesForURL(const String& urlString, const String& cookieString); 114 void getAuthenticationInfo(const WebCore::ProtectionSpace&, bool& returnValue, String& username, String& password); 113 115 void getWindowScriptNPObject(uint64_t& windowScriptNPObjectID); 114 116 void getPluginElementNPObject(uint64_t& pluginElementNPObjectID); -
trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.messages.in
r74224 r86169 39 39 SetCookiesForURL(WTF::String urlString, WTF::String cookieString) 40 40 41 # Gets the authentication info for the given protection space. 42 GetAuthenticationInfo(WebCore::ProtectionSpace protectionSpace) -> (bool returnValue, WTF::String username, WTF::String password) 43 41 44 # Gets a reference to the window NPObject. 42 45 GetWindowScriptNPObject() -> (uint64_t windowScriptNPObjectID) -
trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp
r86045 r86169 36 36 #include <WebCore/Chrome.h> 37 37 #include <WebCore/CookieJar.h> 38 #include <WebCore/CredentialStorage.h> 38 39 #include <WebCore/DocumentLoader.h> 39 40 #include <WebCore/Event.h> … … 47 48 #include <WebCore/NetscapePlugInStreamLoader.h> 48 49 #include <WebCore/NetworkingContext.h> 50 #include <WebCore/ProtectionSpace.h> 49 51 #include <WebCore/ProxyServer.h> 50 52 #include <WebCore/RenderEmbeddedObject.h> … … 1078 1080 } 1079 1081 1082 bool PluginView::getAuthenticationInfo(const ProtectionSpace& protectionSpace, String& username, String& password) 1083 { 1084 Credential credential = CredentialStorage::get(protectionSpace); 1085 if (credential.isEmpty()) 1086 credential = CredentialStorage::getFromPersistentStorage(protectionSpace); 1087 1088 if (!credential.hasPassword()) 1089 return false; 1090 1091 username = credential.user(); 1092 password = credential.password(); 1093 1094 return true; 1095 } 1096 1080 1097 bool PluginView::isPrivateBrowsingEnabled() 1081 1098 { -
trunk/Source/WebKit2/WebProcess/Plugins/PluginView.h
r85961 r86169 146 146 virtual String cookiesForURL(const String&); 147 147 virtual void setCookiesForURL(const String& urlString, const String& cookieString); 148 virtual bool getAuthenticationInfo(const WebCore::ProtectionSpace&, String& username, String& password); 148 149 virtual bool isPrivateBrowsingEnabled(); 149 150 virtual void protectPluginFromDestruction();
Note: See TracChangeset
for help on using the changeset viewer.