Changeset 171722 in webkit


Ignore:
Timestamp:
Jul 28, 2014 9:22:14 PM (10 years ago)
Author:
mitz@apple.com
Message:

Introduced CredentialBase and made Credential derive from it
Work towards fixing https://bugs.webkit.org/show_bug.cgi?id=135327

Reviewed by Darin Adler.

No change in functionality.

  • CMakeLists.txt: Updated for source file rename.
  • WebCore.exp.in: Changed to export CredentialBase symbols.
  • WebCore.vcxproj/WebCore.vcxproj: Updated for source file rename and new header.
  • WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
  • WebCore.xcodeproj/project.pbxproj: Ditto.
  • platform/network/Credential.cpp: Renamed to CredentialBase.cpp.
  • platform/network/Credential.h: Defined Credential to derive from CredentialBase.
  • platform/network/CredentialBase.cpp: Renamed Credential.cpp to this. Updated for the new

name.

  • platform/network/CredentialBase.h: Copied from Credential.h, renamed the class to

CredentialBase, and made the constructors protected.

Location:
trunk/Source/WebCore
Files:
7 edited
1 copied
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/CMakeLists.txt

    r171540 r171722  
    22092209    platform/network/BlobRegistryImpl.cpp
    22102210    platform/network/BlobResourceHandle.cpp
    2211     platform/network/Credential.cpp
     2211    platform/network/CredentialBase.cpp
    22122212    platform/network/CredentialStorage.cpp
    22132213    platform/network/DNSResolveQueue.cpp
  • trunk/Source/WebCore/ChangeLog

    r171718 r171722  
     12014-07-28  Dan Bernstein  <mitz@apple.com>
     2
     3        Introduced CredentialBase and made Credential derive from it
     4        Work towards fixing https://bugs.webkit.org/show_bug.cgi?id=135327
     5
     6        Reviewed by Darin Adler.
     7
     8        No change in functionality.
     9
     10        * CMakeLists.txt: Updated for source file rename.
     11
     12        * WebCore.exp.in: Changed to export CredentialBase symbols.
     13
     14        * WebCore.vcxproj/WebCore.vcxproj: Updated for source file rename and new header.
     15        * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
     16
     17        * WebCore.xcodeproj/project.pbxproj: Ditto.
     18
     19        * platform/network/Credential.cpp: Renamed to CredentialBase.cpp.
     20
     21        * platform/network/Credential.h: Defined Credential to derive from CredentialBase.
     22
     23        * platform/network/CredentialBase.cpp: Renamed Credential.cpp to this. Updated for the new
     24        name.
     25
     26        * platform/network/CredentialBase.h: Copied from Credential.h, renamed the class to
     27        CredentialBase, and made the constructors protected.
     28
    1292014-07-28  Zalan Bujtas  <zalan@apple.com>
    230
  • trunk/Source/WebCore/WebCore.exp.in

    r171615 r171722  
    7272__ZN7WebCore10ClientRectC1ERKNS_9FloatRectE
    7373__ZN7WebCore10ClientRectC1Ev
    74 __ZN7WebCore10CredentialC1ERKN3WTF6StringES4_NS_21CredentialPersistenceE
    75 __ZN7WebCore10CredentialC1Ev
    7674__ZN7WebCore10FloatPointC1ERK7CGPoint
    7775__ZN7WebCore10FloatPointC1ERKNS_8IntPointE
     
    337335__ZN7WebCore14ClientRectListC1Ev
    338336__ZN7WebCore14ClientRectListD1Ev
     337__ZN7WebCore14CredentialBaseC2EP20OpaqueSecIdentityRefPK9__CFArrayNS_21CredentialPersistenceE
     338__ZN7WebCore14CredentialBaseC2ERKN3WTF6StringES4_NS_21CredentialPersistenceE
     339__ZN7WebCore14CredentialBaseC2Ev
    339340__ZN7WebCore14DocumentLoader10commitDataEPKcm
    340341__ZN7WebCore14DocumentLoader12dataReceivedEPNS_14CachedResourceEPKci
     
    15351536__ZNK3JSC8Bindings10RootObject12globalObjectEv
    15361537__ZNK3WTF6String14createCFStringEv
    1537 __ZNK7WebCore10Credential11hasPasswordEv
    1538 __ZNK7WebCore10Credential11persistenceEv
    1539 __ZNK7WebCore10Credential12certificatesEv
    1540 __ZNK7WebCore10Credential4typeEv
    1541 __ZNK7WebCore10Credential4userEv
    1542 __ZNK7WebCore10Credential7isEmptyEv
    1543 __ZNK7WebCore10Credential8identityEv
    1544 __ZNK7WebCore10Credential8passwordEv
    15451538__ZNK7WebCore10FloatPointcv7CGPointEv
    15461539__ZNK7WebCore10FontGlyphs17realizeFontDataAtERKNS_15FontDescriptionEj
     
    16601653__ZNK7WebCore13ResourceError7nsErrorEv
    16611654__ZNK7WebCore13ResourceErrorcvP7NSErrorEv
     1655__ZNK7WebCore14CredentialBase11hasPasswordEv
     1656__ZNK7WebCore14CredentialBase11persistenceEv
     1657__ZNK7WebCore14CredentialBase12certificatesEv
     1658__ZNK7WebCore14CredentialBase4typeEv
     1659__ZNK7WebCore14CredentialBase4userEv
     1660__ZNK7WebCore14CredentialBase7isEmptyEv
     1661__ZNK7WebCore14CredentialBase8identityEv
     1662__ZNK7WebCore14CredentialBase8passwordEv
    16621663__ZNK7WebCore14DocumentLoader10requestURLEv
    16631664__ZNK7WebCore14DocumentLoader11frameLoaderEv
     
    22202221.objc_class_name_WebWindowFadeAnimation
    22212222.objc_class_name_WebWindowScaleAnimation
    2222 __ZN7WebCore10CredentialC1EP20OpaqueSecIdentityRefPK9__CFArrayNS_21CredentialPersistenceE
    22232223__ZN7WebCore10FloatPointC1ERK8_NSPoint
    22242224__ZN7WebCore10handCursorEv
  • trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj

    r171540 r171722  
    85338533    <ClCompile Include="..\platform\network\BlobRegistry.cpp" />
    85348534    <ClCompile Include="..\platform\network\BlobRegistryImpl.cpp" />
    8535     <ClCompile Include="..\platform\network\Credential.cpp" />
     8535    <ClCompile Include="..\platform\network\CredentialBase.cpp" />
    85368536    <ClCompile Include="..\platform\network\CredentialStorage.cpp" />
    85378537    <ClCompile Include="..\platform\network\DataURL.cpp" />
     
    1976519765    <ClInclude Include="..\platform\network\CookieStorage.h" />
    1976619766    <ClInclude Include="..\platform\network\Credential.h" />
     19767    <ClInclude Include="..\platform\network\CredentialBase.h" />
    1976719768    <ClInclude Include="..\platform\network\CredentialStorage.h" />
    1976819769    <ClInclude Include="..\platform\network\DataURL.h" />
  • trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters

    r171540 r171722  
    17921792      <Filter>platform\network</Filter>
    17931793    </ClCompile>
    1794     <ClCompile Include="..\platform\network\Credential.cpp">
     1794    <ClCompile Include="..\platform\network\CredentialBase.cpp">
    17951795      <Filter>platform\network</Filter>
    17961796    </ClCompile>
     
    88078807    </ClInclude>
    88088808    <ClInclude Include="..\platform\network\Credential.h">
     8809      <Filter>platform\network</Filter>
     8810    </ClInclude>
     8811    <ClInclude Include="..\platform\network\CredentialBase.h">
    88098812      <Filter>platform\network</Filter>
    88108813    </ClInclude>
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r171690 r171722  
    13141314                37919C230B7D188600A56998 /* PositionIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37919C210B7D188600A56998 /* PositionIterator.cpp */; };
    13151315                37919C240B7D188600A56998 /* PositionIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 37919C220B7D188600A56998 /* PositionIterator.h */; settings = {ATTRIBUTES = (); }; };
     1316                3792917A1985EF3900F4B661 /* CredentialBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 379291781985EF3900F4B661 /* CredentialBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
    13161317                379919961200DDF400EA041C /* WOFFFileFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 379919941200DDF400EA041C /* WOFFFileFormat.cpp */; };
    13171318                379919971200DDF400EA041C /* WOFFFileFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 379919951200DDF400EA041C /* WOFFFileFormat.h */; };
     
    18591860                514C76530CE9234E007EF3CD /* ResourceRequestMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 514C76490CE9234E007EF3CD /* ResourceRequestMac.mm */; };
    18601861                514C76550CE9234F007EF3CD /* ResourceResponseMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 514C764B0CE9234E007EF3CD /* ResourceResponseMac.mm */; };
    1861                 514C766D0CE923A1007EF3CD /* Credential.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 514C76580CE923A1007EF3CD /* Credential.cpp */; };
     1862                514C766D0CE923A1007EF3CD /* CredentialBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 514C76580CE923A1007EF3CD /* CredentialBase.cpp */; };
    18621863                514C766E0CE923A1007EF3CD /* Credential.h in Headers */ = {isa = PBXBuildFile; fileRef = 514C76590CE923A1007EF3CD /* Credential.h */; settings = {ATTRIBUTES = (Private, ); }; };
    18631864                514C766F0CE923A1007EF3CD /* FormData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 514C765A0CE923A1007EF3CD /* FormData.cpp */; };
     
    83388339                37919C210B7D188600A56998 /* PositionIterator.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PositionIterator.cpp; sourceTree = "<group>"; };
    83398340                37919C220B7D188600A56998 /* PositionIterator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PositionIterator.h; sourceTree = "<group>"; };
     8341                379291781985EF3900F4B661 /* CredentialBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CredentialBase.h; sourceTree = "<group>"; };
    83408342                379919941200DDF400EA041C /* WOFFFileFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WOFFFileFormat.cpp; sourceTree = "<group>"; };
    83418343                379919951200DDF400EA041C /* WOFFFileFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WOFFFileFormat.h; sourceTree = "<group>"; };
     
    89468948                514C76490CE9234E007EF3CD /* ResourceRequestMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ResourceRequestMac.mm; sourceTree = "<group>"; };
    89478949                514C764B0CE9234E007EF3CD /* ResourceResponseMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ResourceResponseMac.mm; sourceTree = "<group>"; };
    8948                 514C76580CE923A1007EF3CD /* Credential.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Credential.cpp; sourceTree = "<group>"; };
     8950                514C76580CE923A1007EF3CD /* CredentialBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CredentialBase.cpp; sourceTree = "<group>"; };
    89498951                514C76590CE923A1007EF3CD /* Credential.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Credential.h; sourceTree = "<group>"; };
    89508952                514C765A0CE923A1007EF3CD /* FormData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FormData.cpp; sourceTree = "<group>"; };
     
    1633016332                                2EB4BCD1121F03E300EC4885 /* BlobResourceHandle.h */,
    1633116333                                E13F01EA1270E10D00DFBA71 /* CookieStorage.h */,
    16332                                 514C76580CE923A1007EF3CD /* Credential.cpp */,
    1633316334                                514C76590CE923A1007EF3CD /* Credential.h */,
     16335                                514C76580CE923A1007EF3CD /* CredentialBase.cpp */,
     16336                                379291781985EF3900F4B661 /* CredentialBase.h */,
    1633416337                                51A052321058774F00CC9E95 /* CredentialStorage.cpp */,
    1633516338                                51A052311058774F00CC9E95 /* CredentialStorage.h */,
     
    2416024163                                A7CFB3D20B7ED10A0070C32D /* DragImage.h in Headers */,
    2416124164                                81F65FF613788FAA00FF6F2D /* DragState.h in Headers */,
     24165                                3792917A1985EF3900F4B661 /* CredentialBase.h in Headers */,
    2416224166                                498770DC1242C535002226BA /* DrawingBuffer.h in Headers */,
    2416324167                                E1BA66F11742BD8600C20251 /* DynamicLinkerInterposing.h in Headers */,
     
    2728327287                                9392F1500AD1862300691BD4 /* CounterNode.cpp in Sources */,
    2728427288                                D0B0556909C6700100307E43 /* CreateLinkCommand.cpp in Sources */,
    27285                                 514C766D0CE923A1007EF3CD /* Credential.cpp in Sources */,
     27289                                514C766D0CE923A1007EF3CD /* CredentialBase.cpp in Sources */,
    2728627290                                51A052341058774F00CC9E95 /* CredentialStorage.cpp in Sources */,
    2728727291                                7EE6846512D26E3800E79415 /* CredentialStorageCFNet.cpp in Sources */,
  • trunk/Source/WebCore/platform/network/Credential.h

    r165676 r171722  
    2323 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2424 */
     25
    2526#ifndef Credential_h
    2627#define Credential_h
    2728
    28 #include <wtf/text/WTFString.h>
    29 
    30 #define CERTIFICATE_CREDENTIALS_SUPPORTED (PLATFORM(COCOA))
    31 
    32 #if CERTIFICATE_CREDENTIALS_SUPPORTED
    33 #include <Security/SecBase.h>
    34 #include <wtf/RetainPtr.h>
    35 #endif
     29#include "CredentialBase.h"
    3630
    3731namespace WebCore {
    3832
    39 enum CredentialPersistence {
    40     CredentialPersistenceNone,
    41     CredentialPersistenceForSession,
    42     CredentialPersistencePermanent
    43 };
     33class Credential : public CredentialBase {
     34public:
     35    Credential()
     36        : CredentialBase()
     37    {
     38    }
     39
     40    Credential(const String& user, const String& password, CredentialPersistence persistence)
     41        : CredentialBase(user, password, persistence)
     42    {
     43    }
     44
     45    Credential(const Credential& original, CredentialPersistence persistence)
     46        : CredentialBase(original, persistence)
     47    {
     48    }
    4449
    4550#if CERTIFICATE_CREDENTIALS_SUPPORTED
    46 enum CredentialType {
    47     CredentialTypePassword,
    48     CredentialTypeClientCertificate
    49 };
    50 #endif
    51 
    52 class Credential {
    53 
    54 public:
    55     Credential();
    56     Credential(const String& user, const String& password, CredentialPersistence);
    57     Credential(const Credential& original, CredentialPersistence);
    58 #if CERTIFICATE_CREDENTIALS_SUPPORTED
    59     Credential(SecIdentityRef identity, CFArrayRef certificates, CredentialPersistence);
    60 #endif
    61    
    62     bool isEmpty() const;
    63    
    64     const String& user() const;
    65     const String& password() const;
    66     bool hasPassword() const;
    67     CredentialPersistence persistence() const;
    68    
    69 #if CERTIFICATE_CREDENTIALS_SUPPORTED
    70     SecIdentityRef identity() const;
    71     CFArrayRef certificates() const;
    72     CredentialType type() const;
    73 #endif   
    74    
    75 private:
    76     String m_user;
    77     String m_password;
    78     CredentialPersistence m_persistence;
    79 #if CERTIFICATE_CREDENTIALS_SUPPORTED
    80     RetainPtr<SecIdentityRef> m_identity;
    81     RetainPtr<CFArrayRef> m_certificates;
    82     CredentialType m_type;
     51    Credential(SecIdentityRef identity, CFArrayRef certificates, CredentialPersistence persistence)
     52        : CredentialBase(identity, certificates, persistence)
     53    {
     54    }
    8355#endif
    8456};
    8557
    86 bool operator==(const Credential& a, const Credential& b);
    87 inline bool operator!=(const Credential& a, const Credential& b) { return !(a == b); }
    88    
    89 };
    90 #endif
     58}
     59
     60#endif // Credential_h
  • trunk/Source/WebCore/platform/network/CredentialBase.cpp

    r171719 r171722  
    2323 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2424 */
     25
    2526#include "config.h"
     27#include "CredentialBase.h"
     28
    2629#include "Credential.h"
    2730
     
    3033// Need to enforce empty, non-null strings due to the pickiness of the String == String operator
    3134// combined with the semantics of the String(NSString*) constructor
    32 Credential::Credential()
     35CredentialBase::CredentialBase()
    3336    : m_user("")
    3437    , m_password("")
     
    4245// Need to enforce empty, non-null strings due to the pickiness of the String == String operator
    4346// combined with the semantics of the String(NSString*) constructor
    44 Credential::Credential(const String& user, const String& password, CredentialPersistence persistence)
     47CredentialBase::CredentialBase(const String& user, const String& password, CredentialPersistence persistence)
    4548    : m_user(user.length() ? user : "")
    4649    , m_password(password.length() ? password : "")
     
    5255}
    5356   
    54 Credential::Credential(const Credential& original, CredentialPersistence persistence)
     57CredentialBase::CredentialBase(const Credential& original, CredentialPersistence persistence)
    5558    : m_user(original.user())
    5659    , m_password(original.password())
     
    6467}
    6568
    66 bool Credential::isEmpty() const
     69bool CredentialBase::isEmpty() const
    6770{
    6871#if CERTIFICATE_CREDENTIALS_SUPPORTED
     
    7477}
    7578   
    76 const String& Credential::user() const
     79const String& CredentialBase::user() const
    7780{
    7881    return m_user;
    7982}
    8083
    81 const String& Credential::password() const
     84const String& CredentialBase::password() const
    8285{
    8386    return m_password;
    8487}
    8588
    86 bool Credential::hasPassword() const
     89bool CredentialBase::hasPassword() const
    8790{
    8891    return !m_password.isEmpty();
    8992}
    9093
    91 CredentialPersistence Credential::persistence() const
     94CredentialPersistence CredentialBase::persistence() const
    9295{
    9396    return m_persistence;
     
    9598   
    9699#if CERTIFICATE_CREDENTIALS_SUPPORTED
    97 Credential::Credential(SecIdentityRef identity, CFArrayRef certificates, CredentialPersistence persistence)
     100CredentialBase::CredentialBase(SecIdentityRef identity, CFArrayRef certificates, CredentialPersistence persistence)
    98101    : m_user("")
    99102    , m_password("")
     
    105108}
    106109   
    107 SecIdentityRef Credential::identity() const
     110SecIdentityRef CredentialBase::identity() const
    108111{
    109112    return m_identity.get();
    110113}
    111114   
    112 CFArrayRef Credential::certificates() const
     115CFArrayRef CredentialBase::certificates() const
    113116{
    114117    return m_certificates.get();
    115118}
    116119   
    117 CredentialType Credential::type() const
     120CredentialType CredentialBase::type() const
    118121{
    119122    return m_type;
     
    160163
    161164}
    162 
  • trunk/Source/WebCore/platform/network/CredentialBase.h

    r171719 r171722  
    2323 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2424 */
    25 #ifndef Credential_h
    26 #define Credential_h
     25
     26#ifndef CredentialBase_h
     27#define CredentialBase_h
    2728
    2829#include <wtf/text/WTFString.h>
     
    3637
    3738namespace WebCore {
     39
     40class Credential;
    3841
    3942enum CredentialPersistence {
     
    5053#endif
    5154
    52 class Credential {
     55class CredentialBase {
    5356
    5457public:
    55     Credential();
    56     Credential(const String& user, const String& password, CredentialPersistence);
    57     Credential(const Credential& original, CredentialPersistence);
    58 #if CERTIFICATE_CREDENTIALS_SUPPORTED
    59     Credential(SecIdentityRef identity, CFArrayRef certificates, CredentialPersistence);
    60 #endif
    61    
    6258    bool isEmpty() const;
    6359   
     
    7268    CredentialType type() const;
    7369#endif   
     70   
     71protected:
     72    CredentialBase();
     73    CredentialBase(const String& user, const String& password, CredentialPersistence);
     74    CredentialBase(const Credential& original, CredentialPersistence);
     75#if CERTIFICATE_CREDENTIALS_SUPPORTED
     76    CredentialBase(SecIdentityRef, CFArrayRef certificates, CredentialPersistence);
     77#endif
    7478   
    7579private:
Note: See TracChangeset for help on using the changeset viewer.