Changeset 171747 in webkit
- Timestamp:
- Jul 29, 2014 9:40:17 AM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r171746 r171747 1 2014-07-29 Dan Bernstein <mitz@apple.com> 2 3 Moved the Cocoa-specific parts of CredentialBase into a Cocoa-specific Credential class. 4 Work towards fixing https://bugs.webkit.org/show_bug.cgi?id=135327 5 6 Reviewed by Alexey Proskuryakov. 7 8 No change in functionality. 9 10 * WebCore.exp.in: Updated for functions moved in the class hierarchy. 11 12 * WebCore.xcodeproj/project.pbxproj: Added CredentialCocoa.{h,mm}. 13 14 * platform/network/Credential.h: For Cocoa, include CredentialCocoa.h instead of the generic 15 class. 16 (WebCore::Credential::Credential): Removed #if CERTIFICATE_CREDENTIALS_SUPPORTED code. 17 18 * platform/network/CredentialBase.cpp: 19 (WebCore::CredentialBase::CredentialBase): Changed to use emptyString instead of "", removed 20 #if CERTIFICATE_CREDENTIALS_SUPPORTED code. 21 (WebCore::CredentialBase::isEmpty): Ditto. 22 (WebCore::CredentialBase::compare): Renamed operator== to this, removed 23 #if CERTIFICATE_CREDENTIALS_SUPPORTED code, but changed the end to call platformCompare. 24 (WebCore::CredentialBase::identity): Deleted. 25 (WebCore::CredentialBase::certificates): Deleted. 26 (WebCore::CredentialBase::type): Deleted. 27 * platform/network/CredentialBase.h: Removed #if CERTIFICATE_CREDENTIALS_SUPPORTED members. 28 (WebCore::CredentialBase::platformCompare): Added a base implementation that returns true. 29 (WebCore::operator==): Changed to use CredentialBase::compare. 30 31 * platform/network/cocoa/CredentialCocoa.h: Added. 32 (WebCore::Credential::Credential): 33 * platform/network/cocoa/CredentialCocoa.mm: Added. 34 (WebCore::Credential::Credential): Moved the constructor that takes an identity and 35 certificates here. 36 (WebCore::Credential::isEmpty): Moved here. 37 (WebCore::Credential::identity): Ditto. 38 (WebCore::Credential::certificates): Ditto. 39 (WebCore::Credential::type): Ditto. 40 (WebCore::Credential::platformCompare): Moved the code that compares client-certificate 41 credentials here. 42 43 * platform/network/mac/AuthenticationMac.mm: 44 (WebCore::mac): Removed #if CERTIFICATE_CREDENTIALS_SUPPORTED guards in this Cocoa-only 45 file. 46 (WebCore::core): Ditto. 47 1 48 2014-07-29 Daniel Bates <dabates@apple.com> 2 49 -
trunk/Source/WebCore/WebCore.exp.in
r171723 r171747 1535 1535 __ZNK3JSC8Bindings10RootObject12globalObjectEv 1536 1536 __ZNK3WTF6String14createCFStringEv 1537 __ZNK7WebCore10Credential12certificatesEv 1538 __ZNK7WebCore10Credential4typeEv 1539 __ZNK7WebCore10Credential7isEmptyEv 1540 __ZNK7WebCore10Credential8identityEv 1537 1541 __ZNK7WebCore10FloatPointcv7CGPointEv 1538 1542 __ZNK7WebCore10FontGlyphs17realizeFontDataAtERKNS_15FontDescriptionEj … … 1654 1658 __ZNK7WebCore14CredentialBase11hasPasswordEv 1655 1659 __ZNK7WebCore14CredentialBase11persistenceEv 1656 __ZNK7WebCore14CredentialBase12certificatesEv1657 __ZNK7WebCore14CredentialBase4typeEv1658 1660 __ZNK7WebCore14CredentialBase4userEv 1659 __ZNK7WebCore14CredentialBase7isEmptyEv1660 __ZNK7WebCore14CredentialBase8identityEv1661 1661 __ZNK7WebCore14CredentialBase8passwordEv 1662 1662 __ZNK7WebCore14DocumentLoader10requestURLEv … … 2220 2220 .objc_class_name_WebWindowFadeAnimation 2221 2221 .objc_class_name_WebWindowScaleAnimation 2222 __ZN7WebCore10CredentialC1EP20OpaqueSecIdentityRefPK9__CFArrayNS_21CredentialPersistenceE 2222 2223 __ZN7WebCore10FloatPointC1ERK8_NSPoint 2223 2224 __ZN7WebCore10handCursorEv … … 2237 2238 __ZN7WebCore13getRawCookiesERKNS_21NetworkStorageSessionERKNS_3URLES5_RN3WTF6VectorINS_6CookieELm0ENS6_15CrashOnOverflowEEE 2238 2239 __ZN7WebCore13toDeviceSpaceERKNS_9FloatRectEP8NSWindow 2239 __ZN7WebCore14CredentialBaseC2EP20OpaqueSecIdentityRefPK9__CFArrayNS_21CredentialPersistenceE2240 2240 __ZN7WebCore14cookiesEnabledERKNS_21NetworkStorageSessionERKNS_3URLES5_ 2241 2241 __ZN7WebCore15GraphicsContext15drawNativeImageEP7CGImageRKNS_9FloatSizeENS_10ColorSpaceERKNS_9FloatRectES9_fNS_17CompositeOperatorENS_9BlendModeENS_16ImageOrientationE … … 2526 2526 _WebUIApplicationWillEnterForegroundNotification 2527 2527 _WebUIApplicationWillResignActiveNotification 2528 __ZN7WebCore10CredentialC1EP13__SecIdentityPK9__CFArrayNS_21CredentialPersistenceE 2528 2529 __ZN7WebCore10RenderView35resumePausedImageAnimationsIfNeededEv 2529 2530 __ZN7WebCore10ScrollView15setScrollOffsetERKNS_8IntPointE … … 2562 2563 __ZN7WebCore13getRawCookiesERKNS_21NetworkStorageSessionERKNS_3URLES5_RN3WTF6VectorINS_6CookieELm0ENS6_15CrashOnOverflowEEE 2563 2564 __ZN7WebCore13isStartOfLineERKNS_15VisiblePositionE 2564 __ZN7WebCore14CredentialBaseC1EP13__SecIdentityPK9__CFArrayNS_21CredentialPersistenceE2565 2565 __ZN7WebCore14DocumentLoader19setResponseMIMETypeERKN3WTF6StringE 2566 2566 __ZN7WebCore14DocumentWriter3endEv -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r171744 r171747 1315 1315 37919C240B7D188600A56998 /* PositionIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 37919C220B7D188600A56998 /* PositionIterator.h */; settings = {ATTRIBUTES = (); }; }; 1316 1316 3792917A1985EF3900F4B661 /* CredentialBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 379291781985EF3900F4B661 /* CredentialBase.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1317 3792917D1987678F00F4B661 /* CredentialCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3792917B1987678F00F4B661 /* CredentialCocoa.mm */; }; 1318 3792917E1987678F00F4B661 /* CredentialCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 3792917C1987678F00F4B661 /* CredentialCocoa.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1317 1319 379919961200DDF400EA041C /* WOFFFileFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 379919941200DDF400EA041C /* WOFFFileFormat.cpp */; }; 1318 1320 379919971200DDF400EA041C /* WOFFFileFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 379919951200DDF400EA041C /* WOFFFileFormat.h */; }; … … 8341 8343 37919C220B7D188600A56998 /* PositionIterator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PositionIterator.h; sourceTree = "<group>"; }; 8342 8344 379291781985EF3900F4B661 /* CredentialBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CredentialBase.h; sourceTree = "<group>"; }; 8345 3792917B1987678F00F4B661 /* CredentialCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = CredentialCocoa.mm; path = cocoa/CredentialCocoa.mm; sourceTree = "<group>"; }; 8346 3792917C1987678F00F4B661 /* CredentialCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CredentialCocoa.h; path = cocoa/CredentialCocoa.h; sourceTree = "<group>"; }; 8343 8347 379919941200DDF400EA041C /* WOFFFileFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WOFFFileFormat.cpp; sourceTree = "<group>"; }; 8344 8348 379919951200DDF400EA041C /* WOFFFileFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WOFFFileFormat.h; sourceTree = "<group>"; }; … … 16768 16772 isa = PBXGroup; 16769 16773 children = ( 16774 3792917C1987678F00F4B661 /* CredentialCocoa.h */, 16775 3792917B1987678F00F4B661 /* CredentialCocoa.mm */, 16770 16776 372ADA37197F47B900FC501E /* ProtectionSpaceCocoa.h */, 16771 16777 372ADA39197F687600FC501E /* ProtectionSpaceCocoa.mm */, … … 25675 25681 ABB5419F0ACDDFE4002820EB /* RenderListBox.h in Headers */, 25676 25682 A8EA7A520A191A5200A8EF5F /* RenderListItem.h in Headers */, 25683 3792917E1987678F00F4B661 /* CredentialCocoa.h in Headers */, 25677 25684 A8EA7A500A191A5200A8EF5F /* RenderListMarker.h in Headers */, 25678 25685 0F56028F0E4B76580065B038 /* RenderMarquee.h in Headers */, … … 28665 28672 B2FA3DC60AB75A6F000E5AC4 /* JSSVGPathSegCurvetoQuadraticAbs.cpp in Sources */, 28666 28673 B2FA3DC80AB75A6F000E5AC4 /* JSSVGPathSegCurvetoQuadraticRel.cpp in Sources */, 28674 3792917D1987678F00F4B661 /* CredentialCocoa.mm in Sources */, 28667 28675 B2FA3DCA0AB75A6F000E5AC4 /* JSSVGPathSegCurvetoQuadraticSmoothAbs.cpp in Sources */, 28668 28676 B2FA3DCC0AB75A6F000E5AC4 /* JSSVGPathSegCurvetoQuadraticSmoothRel.cpp in Sources */, -
trunk/Source/WebCore/platform/network/Credential.h
r171722 r171747 27 27 #define Credential_h 28 28 29 #if PLATFORM(COCOA) 30 #include "CredentialCocoa.h" 31 #else 32 29 33 #include "CredentialBase.h" 34 35 // FIXME: Remove this macro once it is not used in WebKit. 36 #define CERTIFICATE_CREDENTIALS_SUPPORTED 0 30 37 31 38 namespace WebCore { … … 47 54 { 48 55 } 49 50 #if CERTIFICATE_CREDENTIALS_SUPPORTED51 Credential(SecIdentityRef identity, CFArrayRef certificates, CredentialPersistence persistence)52 : CredentialBase(identity, certificates, persistence)53 {54 }55 #endif56 56 }; 57 57 58 58 } 59 59 60 #endif 61 60 62 #endif // Credential_h -
trunk/Source/WebCore/platform/network/CredentialBase.cpp
r171722 r171747 34 34 // combined with the semantics of the String(NSString*) constructor 35 35 CredentialBase::CredentialBase() 36 : m_user( "")37 , m_password( "")36 : m_user(emptyString()) 37 , m_password(emptyString()) 38 38 , m_persistence(CredentialPersistenceNone) 39 #if CERTIFICATE_CREDENTIALS_SUPPORTED40 , m_type(CredentialTypePassword)41 #endif42 39 { 43 40 } … … 46 43 // combined with the semantics of the String(NSString*) constructor 47 44 CredentialBase::CredentialBase(const String& user, const String& password, CredentialPersistence persistence) 48 : m_user(user.length() ? user : "")49 , m_password(password.length() ? password : "")45 : m_user(user.length() ? user : emptyString()) 46 , m_password(password.length() ? password : emptyString()) 50 47 , m_persistence(persistence) 51 #if CERTIFICATE_CREDENTIALS_SUPPORTED52 , m_type(CredentialTypePassword)53 #endif54 48 { 55 49 } … … 59 53 , m_password(original.password()) 60 54 , m_persistence(persistence) 61 #if CERTIFICATE_CREDENTIALS_SUPPORTED62 , m_identity(original.identity())63 , m_certificates(original.certificates())64 , m_type(original.type())65 #endif66 55 { 67 56 } … … 69 58 bool CredentialBase::isEmpty() const 70 59 { 71 #if CERTIFICATE_CREDENTIALS_SUPPORTED72 if (m_type == CredentialTypeClientCertificate && (m_identity || m_certificates))73 return false;74 #endif75 76 60 return m_user.isEmpty() && m_password.isEmpty(); 77 61 } … … 96 80 return m_persistence; 97 81 } 98 99 #if CERTIFICATE_CREDENTIALS_SUPPORTED100 CredentialBase::CredentialBase(SecIdentityRef identity, CFArrayRef certificates, CredentialPersistence persistence)101 : m_user("")102 , m_password("")103 , m_persistence(persistence)104 , m_identity(identity)105 , m_certificates(certificates)106 , m_type(CredentialTypeClientCertificate)107 {108 }109 110 SecIdentityRef CredentialBase::identity() const111 {112 return m_identity.get();113 }114 115 CFArrayRef CredentialBase::certificates() const116 {117 return m_certificates.get();118 }119 120 CredentialType CredentialBase::type() const121 {122 return m_type;123 }124 #endif125 82 126 bool operator==(const Credential& a, const Credential& b)83 bool CredentialBase::compare(const Credential& a, const Credential& b) 127 84 { 128 85 // Check persistence first since all credential types … … 130 87 if (a.persistence() != b.persistence()) 131 88 return false; 132 133 #if CERTIFICATE_CREDENTIALS_SUPPORTED134 CredentialType aType = a.type();135 if (aType != b.type())136 return false;137 138 // Comparing identity and certificate chain pointers is valid only139 // for client certificate type credentials.140 //141 // FIXME: Is pointer comparison of the identity and certificates properties sufficient?142 if (aType == CredentialTypeClientCertificate) {143 if (a.identity() != b.identity())144 return false;145 if (a.certificates() != b.certificates())146 return false;147 148 // We only need to check identity and certificates to compare149 // client certificate based credentials.150 return true;151 }152 153 ASSERT(a.type() == CredentialTypePassword && b.type() == CredentialTypePassword);154 #endif155 156 89 if (a.user() != b.user()) 157 90 return false; … … 159 92 return false; 160 93 161 return true;94 return Credential::platformCompare(a, b); 162 95 } 163 96 -
trunk/Source/WebCore/platform/network/CredentialBase.h
r171722 r171747 29 29 #include <wtf/text/WTFString.h> 30 30 31 #define CERTIFICATE_CREDENTIALS_SUPPORTED (PLATFORM(COCOA))32 33 #if CERTIFICATE_CREDENTIALS_SUPPORTED34 #include <Security/SecBase.h>35 #include <wtf/RetainPtr.h>36 #endif37 38 31 namespace WebCore { 39 32 … … 45 38 CredentialPersistencePermanent 46 39 }; 47 48 #if CERTIFICATE_CREDENTIALS_SUPPORTED49 enum CredentialType {50 CredentialTypePassword,51 CredentialTypeClientCertificate52 };53 #endif54 40 55 41 class CredentialBase { … … 63 49 CredentialPersistence persistence() const; 64 50 65 #if CERTIFICATE_CREDENTIALS_SUPPORTED 66 SecIdentityRef identity() const; 67 CFArrayRef certificates() const; 68 CredentialType type() const; 69 #endif 70 51 static bool compare(const Credential&, const Credential&); 52 71 53 protected: 72 54 CredentialBase(); 73 55 CredentialBase(const String& user, const String& password, CredentialPersistence); 74 56 CredentialBase(const Credential& original, CredentialPersistence); 75 #if CERTIFICATE_CREDENTIALS_SUPPORTED 76 CredentialBase(SecIdentityRef, CFArrayRef certificates, CredentialPersistence); 77 #endif 78 57 58 static bool platformCompare(const Credential&, const Credential&) { return true; } 59 79 60 private: 80 61 String m_user; 81 62 String m_password; 82 63 CredentialPersistence m_persistence; 83 #if CERTIFICATE_CREDENTIALS_SUPPORTED84 RetainPtr<SecIdentityRef> m_identity;85 RetainPtr<CFArrayRef> m_certificates;86 CredentialType m_type;87 #endif88 64 }; 89 65 90 bool operator==(const Credential& a, const Credential& b); 66 inline bool operator==(const Credential& a, const Credential& b) { return CredentialBase::compare(a, b); } 91 67 inline bool operator!=(const Credential& a, const Credential& b) { return !(a == b); } 92 68 93 69 }; 70 94 71 #endif -
trunk/Source/WebCore/platform/network/mac/AuthenticationMac.mm
r171540 r171747 243 243 } 244 244 245 #if CERTIFICATE_CREDENTIALS_SUPPORTED246 245 if (coreCredential.type() == CredentialTypeClientCertificate) { 247 246 return [[[NSURLCredential alloc] initWithIdentity:coreCredential.identity() … … 250 249 autorelease]; 251 250 } 252 #endif253 251 254 252 return [[[NSURLCredential alloc] initWithUser:coreCredential.user() … … 279 277 } 280 278 281 #if CERTIFICATE_CREDENTIALS_SUPPORTED282 279 SecIdentityRef identity = [macCredential identity]; 283 280 if (identity) 284 281 return Credential(identity, (CFArrayRef)[macCredential certificates], persistence); 285 #endif286 282 287 283 return Credential([macCredential user], [macCredential password], persistence);
Note: See TracChangeset
for help on using the changeset viewer.