Changeset 155527 in webkit


Ignore:
Timestamp:
Sep 11, 2013 7:43:03 AM (11 years ago)
Author:
mikhail.pozdnyakov@intel.com
Message:

WTF::OwnPtr should behave similarly with the rest of WTF smart pointers
https://bugs.webkit.org/show_bug.cgi?id=120773

Reviewed by Anders Carlsson.

Before the change OwnPtr could take either the pointer type or the pointed-to type, which was bad
for the following reasons:

  • It distinguished OwnPtr behaviour from other WTF smart pointer classes behaviour (so it was confusing for the Client).
  • It was potential error-prone as it actually modified the type given by the Client in opaque way.

Source/WebCore:

  • page/animation/CSSPropertyAnimation.cpp:

(WebCore::PropertyWrapperShadow::blendSimpleOrMatchedShadowLists):
(WebCore::PropertyWrapperShadow::blendMismatchedShadowLists):

Source/WebKit2:

  • UIProcess/API/efl/ewk_database_manager.cpp:

(getDatabaseOriginsCallback):

  • UIProcess/API/efl/ewk_storage_manager.cpp:

(getStorageOriginsCallback):

Source/WTF:

  • wtf/OwnPtr.h:
  • wtf/PassOwnPtr.h:
Location:
trunk/Source
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r155526 r155527  
     12013-09-11  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
     2
     3        WTF::OwnPtr should behave similarly with the rest of WTF smart pointers
     4        https://bugs.webkit.org/show_bug.cgi?id=120773
     5
     6        Reviewed by Anders Carlsson.
     7
     8        Before the change OwnPtr could take either the pointer type or the pointed-to type, which was bad
     9        for the following reasons:
     10        - It distinguished OwnPtr behaviour from other WTF smart pointer classes behaviour (so it was confusing for the Client).
     11        - It was potential error-prone as it actually modified the type given by the Client in opaque way.
     12
     13        * wtf/OwnPtr.h:
     14        * wtf/PassOwnPtr.h:
     15
    1162013-09-11  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
    217
  • trunk/Source/WTF/wtf/OwnPtr.h

    r155526 r155527  
    3131namespace WTF {
    3232
    33     // Unlike most of our smart pointers, OwnPtr can take either the pointer type or the pointed-to type.
    34 
    3533    template<typename T> class PassOwnPtr;
    3634    template<typename T> PassOwnPtr<T> adoptPtr(T*);
     
    3836    template<typename T> class OwnPtr {
    3937    public:
    40         typedef typename std::remove_pointer<T>::type ValueType;
     38        typedef T ValueType;
    4139        typedef ValueType* PtrType;
    4240
  • trunk/Source/WTF/wtf/PassOwnPtr.h

    r155357 r155527  
    3434namespace WTF {
    3535
    36     // Unlike most of our smart pointers, PassOwnPtr can take either the pointer type or the pointed-to type.
    37 
    3836    template<typename T> class OwnPtr;
    3937    template<typename T> class PassOwnPtr;
     
    4543    template<typename T> class PassOwnPtr {
    4644    public:
    47         typedef typename std::remove_pointer<T>::type ValueType;
     45        typedef T ValueType;
    4846        typedef ValueType* PtrType;
    4947
  • trunk/Source/WebCore/ChangeLog

    r155524 r155527  
     12013-09-11  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
     2
     3        WTF::OwnPtr should behave similarly with the rest of WTF smart pointers
     4        https://bugs.webkit.org/show_bug.cgi?id=120773
     5
     6        Reviewed by Anders Carlsson.
     7
     8        Before the change OwnPtr could take either the pointer type or the pointed-to type, which was bad
     9        for the following reasons:
     10        - It distinguished OwnPtr behaviour from other WTF smart pointer classes behaviour (so it was confusing for the Client).
     11        - It was potential error-prone as it actually modified the type given by the Client in opaque way.
     12
     13        * page/animation/CSSPropertyAnimation.cpp:
     14        (WebCore::PropertyWrapperShadow::blendSimpleOrMatchedShadowLists):
     15        (WebCore::PropertyWrapperShadow::blendMismatchedShadowLists):
     16
    1172013-09-11  Andreas Kling  <akling@apple.com>
    218
  • trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp

    r155240 r155527  
    673673
    674674private:
    675     PassOwnPtr<ShadowData*> blendSimpleOrMatchedShadowLists(const AnimationBase* anim, double progress, const ShadowData* shadowA, const ShadowData* shadowB) const
     675    PassOwnPtr<ShadowData> blendSimpleOrMatchedShadowLists(const AnimationBase* anim, double progress, const ShadowData* shadowA, const ShadowData* shadowB) const
    676676    {
    677677        OwnPtr<ShadowData> newShadowData;
     
    699699    }
    700700
    701     PassOwnPtr<ShadowData*> blendMismatchedShadowLists(const AnimationBase* anim, double progress, const ShadowData* shadowA, const ShadowData* shadowB, int fromLength, int toLength) const
     701    PassOwnPtr<ShadowData> blendMismatchedShadowLists(const AnimationBase* anim, double progress, const ShadowData* shadowA, const ShadowData* shadowB, int fromLength, int toLength) const
    702702    {
    703703        // The shadows in ShadowData are stored in reverse order, so when animating mismatched lists,
  • trunk/Source/WebKit2/ChangeLog

    r155522 r155527  
     12013-09-11  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
     2
     3        WTF::OwnPtr should behave similarly with the rest of WTF smart pointers
     4        https://bugs.webkit.org/show_bug.cgi?id=120773
     5
     6        Reviewed by Anders Carlsson.
     7
     8        Before the change OwnPtr could take either the pointer type or the pointed-to type, which was bad
     9        for the following reasons:
     10        - It distinguished OwnPtr behaviour from other WTF smart pointer classes behaviour (so it was confusing for the Client).
     11        - It was potential error-prone as it actually modified the type given by the Client in opaque way.
     12
     13        * UIProcess/API/efl/ewk_database_manager.cpp:
     14        (getDatabaseOriginsCallback):
     15        * UIProcess/API/efl/ewk_storage_manager.cpp:
     16        (getStorageOriginsCallback):
     17
    1182013-09-11  ChangSeok Oh  <changseok.oh@collabora.com>
    219
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_database_manager.cpp

    r140905 r155527  
    7878static void getDatabaseOriginsCallback(WKArrayRef origins, WKErrorRef wkError, void* context)
    7979{
    80     OwnPtr<Ewk_Database_Origins_Async_Get_Context*> webDatabaseContext = adoptPtr(static_cast<Ewk_Database_Origins_Async_Get_Context*>(context));
     80    OwnPtr<Ewk_Database_Origins_Async_Get_Context> webDatabaseContext = adoptPtr(static_cast<Ewk_Database_Origins_Async_Get_Context*>(context));
    8181    Eina_List* originList = webDatabaseContext->manager->createOriginList(origins);
    8282    OwnPtr<EwkError> ewkError = EwkError::create(wkError);
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_storage_manager.cpp

    r140905 r155527  
    7979{
    8080    Eina_List* originList = 0;
    81     OwnPtr<Ewk_Storage_Origins_Async_Get_Context*> webStorageContext = adoptPtr(static_cast<Ewk_Storage_Origins_Async_Get_Context*>(context));
     81    OwnPtr<Ewk_Storage_Origins_Async_Get_Context> webStorageContext = adoptPtr(static_cast<Ewk_Storage_Origins_Async_Get_Context*>(context));
    8282
    8383    originList = webStorageContext->manager->createOriginList(origins);
Note: See TracChangeset for help on using the changeset viewer.