Changeset 190689 in webkit


Ignore:
Timestamp:
Oct 7, 2015 2:34:12 PM (8 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r190572, r190593, r190594, and
r190639.
https://bugs.webkit.org/show_bug.cgi?id=149897

Breaks Mavericks build (Requested by litherum on #webkit).

Reverted changesets:

"Allow WKRetainPtrs to be used as keys in hashing data
structures"
https://bugs.webkit.org/show_bug.cgi?id=149762
http://trac.webkit.org/changeset/190572

"REGRESSION(189668?): http/tests/notifications/events.html
flakily asserts or times out"
https://bugs.webkit.org/show_bug.cgi?id=149218
http://trac.webkit.org/changeset/190593

"Prospective Mavericks build fix."
http://trac.webkit.org/changeset/190594

"Post-review cleanup after r190572."
http://trac.webkit.org/changeset/190639

Location:
trunk
Files:
1 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r190688 r190689  
     12015-10-07  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r190572, r190593, r190594, and
     4        r190639.
     5        https://bugs.webkit.org/show_bug.cgi?id=149897
     6
     7        Breaks Mavericks build (Requested by litherum on #webkit).
     8
     9        Reverted changesets:
     10
     11        "Allow WKRetainPtrs to be used as keys in hashing data
     12        structures"
     13        https://bugs.webkit.org/show_bug.cgi?id=149762
     14        http://trac.webkit.org/changeset/190572
     15
     16        "REGRESSION(189668?): http/tests/notifications/events.html
     17        flakily asserts or times out"
     18        https://bugs.webkit.org/show_bug.cgi?id=149218
     19        http://trac.webkit.org/changeset/190593
     20
     21        "Prospective Mavericks build fix."
     22        http://trac.webkit.org/changeset/190594
     23
     24        "Post-review cleanup after r190572."
     25        http://trac.webkit.org/changeset/190639
     26
    1272015-10-07  Antti Koivisto  <antti@apple.com>
    228
  • trunk/LayoutTests/TestExpectations

    r190593 r190689  
    677677
    678678http/tests/xmlhttprequest/timeout/xmlhttprequest-timeout-overrides.html [ Failure Pass ]
     679
     680webkit.org/b/149218 http/tests/notifications/events.html [ Pass Crash Timeout ]
  • trunk/Source/WebKit2/ChangeLog

    r190686 r190689  
     12015-10-07  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r190572, r190593, r190594, and
     4        r190639.
     5        https://bugs.webkit.org/show_bug.cgi?id=149897
     6
     7        Breaks Mavericks build (Requested by litherum on #webkit).
     8
     9        Reverted changesets:
     10
     11        "Allow WKRetainPtrs to be used as keys in hashing data
     12        structures"
     13        https://bugs.webkit.org/show_bug.cgi?id=149762
     14        http://trac.webkit.org/changeset/190572
     15
     16        "REGRESSION(189668?): http/tests/notifications/events.html
     17        flakily asserts or times out"
     18        https://bugs.webkit.org/show_bug.cgi?id=149218
     19        http://trac.webkit.org/changeset/190593
     20
     21        "Prospective Mavericks build fix."
     22        http://trac.webkit.org/changeset/190594
     23
     24        "Post-review cleanup after r190572."
     25        http://trac.webkit.org/changeset/190639
     26
    1272015-10-07  Anders Carlsson  <andersca@apple.com>
    228
  • trunk/Source/WebKit2/UIProcess/API/cpp/WKRetainPtr.h

    r190594 r190689  
    2929#include <WebKit/WKType.h>
    3030#include <algorithm>
    31 #include <wtf/GetPtr.h>
    32 #include <wtf/HashFunctions.h>
    33 #include <wtf/HashTraits.h>
    34 #include <wtf/RefPtr.h>
    3531
    3632namespace WebKit {
     
    8884            WKRelease(ptr);
    8985    }
    90 
    91     // Hash table deleted values, which are only constructed and never copied or destroyed.
    92     WKRetainPtr(WTF::HashTableDeletedValueType)
    93         : m_ptr(hashTableDeletedValue())
    94     {
    95     }
    96 
    97     bool isHashTableDeletedValue() const { return m_ptr == hashTableDeletedValue(); }
    98     constexpr static T hashTableDeletedValue() { return reinterpret_cast<T>(-1); }
    9986
    10087    PtrType get() const { return m_ptr; }
     
    264251using WebKit::adoptWK;
    265252
    266 namespace WTF {
    267 
    268 template <typename T> struct IsSmartPtr<WKRetainPtr<T>> {
    269     static const bool value = true;
    270 };
    271 
    272 template<typename P> struct DefaultHash<WKRetainPtr<P>> {
    273     typedef PtrHash<WKRetainPtr<P>> Hash;
    274 };
    275 
    276 template<typename P> struct HashTraits<WKRetainPtr<P>> : SimpleClassHashTraits<WKRetainPtr<P>> {
    277     static P emptyValue() { return nullptr; }
    278 
    279     typedef P PeekType;
    280     static PeekType peek(const WKRetainPtr<P>& value) { return value.get(); }
    281     static PeekType peek(P value) { return value; }
    282 };
    283 
    284 } // namespace WTF
    285 
    286253#endif // WKRetainPtr_h
  • trunk/Tools/ChangeLog

    r190660 r190689  
     12015-10-07  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r190572, r190593, r190594, and
     4        r190639.
     5        https://bugs.webkit.org/show_bug.cgi?id=149897
     6
     7        Breaks Mavericks build (Requested by litherum on #webkit).
     8
     9        Reverted changesets:
     10
     11        "Allow WKRetainPtrs to be used as keys in hashing data
     12        structures"
     13        https://bugs.webkit.org/show_bug.cgi?id=149762
     14        http://trac.webkit.org/changeset/190572
     15
     16        "REGRESSION(189668?): http/tests/notifications/events.html
     17        flakily asserts or times out"
     18        https://bugs.webkit.org/show_bug.cgi?id=149218
     19        http://trac.webkit.org/changeset/190593
     20
     21        "Prospective Mavericks build fix."
     22        http://trac.webkit.org/changeset/190594
     23
     24        "Post-review cleanup after r190572."
     25        http://trac.webkit.org/changeset/190639
     26
    1272015-10-06  Michael Catanzaro  <mcatanzaro@igalia.com>
    228
  • trunk/Tools/TestWebKitAPI/PlatformGTK.cmake

    r190572 r190689  
    111111    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKPageGetScaleFactorNotZero.cpp
    112112    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKPreferences.cpp
    113     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKRetainPtr.cpp
    114113    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKString.cpp
    115114    ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKStringJSString.cpp
  • trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj

    r190572 r190689  
    2323                1AEDE22613E5E7E700E62FE8 /* InjectedBundleControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AEDE22413E5E7A000E62FE8 /* InjectedBundleControllerMac.mm */; };
    2424                1CB9BC381A67482300FE5678 /* WeakPtr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1CB9BC371A67482300FE5678 /* WeakPtr.cpp */; };
    25                 1CF0D3791BBF2F3D00B4EF54 /* WKRetainPtr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1CF0D3781BBF2F3D00B4EF54 /* WKRetainPtr.cpp */; };
    2625                260BA5791B1D2E7B004FA07C /* DFACombiner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260BA5781B1D2E7B004FA07C /* DFACombiner.cpp */; };
    2726                26DF5A6315A2A27E003689C2 /* CancelLoadFromResourceLoadDelegate.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 26DF5A6115A2A22B003689C2 /* CancelLoadFromResourceLoadDelegate.html */; };
     
    472471                1AFDE6541953B2C000C48FFA /* Optional.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Optional.cpp; sourceTree = "<group>"; };
    473472                1CB9BC371A67482300FE5678 /* WeakPtr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WeakPtr.cpp; sourceTree = "<group>"; };
    474                 1CF0D3781BBF2F3D00B4EF54 /* WKRetainPtr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKRetainPtr.cpp; sourceTree = "<group>"; };
    475473                260BA5781B1D2E7B004FA07C /* DFACombiner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DFACombiner.cpp; sourceTree = "<group>"; };
    476474                260BA57A1B1D2EE2004FA07C /* DFAHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DFAHelpers.h; sourceTree = "<group>"; };
     
    11441142                                BC90995D12567BC100083756 /* WKString.cpp */,
    11451143                                BC9099931256ACF100083756 /* WKStringJSString.cpp */,
    1146                                 1CF0D3781BBF2F3D00B4EF54 /* WKRetainPtr.cpp */,
    11471144                        );
    11481145                        path = WebKit2;
     
    17491746                                7A5623111AD5AF3E0096B920 /* MenuTypesForMouseEvents.cpp in Sources */,
    17501747                                51CB4AD81B3A079C00C1B1C6 /* ModalAlertsSPI.cpp in Sources */,
    1751                                 1CF0D3791BBF2F3D00B4EF54 /* WKRetainPtr.cpp in Sources */,
    17521748                                26F6E1F01ADC749B00DE696B /* DFAMinimizer.cpp in Sources */,
    17531749                                260BA5791B1D2E7B004FA07C /* DFACombiner.cpp in Sources */,
  • trunk/Tools/WebKitTestRunner/WebNotificationProvider.cpp

    r190593 r190689  
    6666WebNotificationProvider::~WebNotificationProvider()
    6767{
    68     for (auto& manager : m_ownedNotifications)
    69         WKNotificationManagerSetProvider(manager.key.get(), nullptr);
     68    if (m_currentNotificationManager)
     69        WKNotificationManagerSetProvider(m_currentNotificationManager.get(), nullptr);
    7070}
    7171
     
    8585}
    8686
    87 void WebNotificationProvider::showWebNotification(WKPageRef page, WKNotificationRef notification)
     87void WebNotificationProvider::showWebNotification(WKPageRef, WKNotificationRef notification)
    8888{
    89     auto context = WKPageGetContext(page);
    90     auto notificationManager = WKContextGetNotificationManager(context);
     89    if (!m_currentNotificationManager)
     90        return;
     91
    9192    uint64_t id = WKNotificationGetID(notification);
     93    ASSERT(!m_shownNotifications.contains(id));
     94    m_shownNotifications.add(id);
    9295
    93     ASSERT(m_ownedNotifications.contains(notificationManager));
    94     auto addResult = m_ownedNotifications.find(notificationManager)->value.add(id);
    95     ASSERT_UNUSED(addResult, addResult.isNewEntry);
    96     auto addResult2 = m_owningManager.set(id, notificationManager);
    97     ASSERT_UNUSED(addResult2, addResult2.isNewEntry);
    98 
    99     WKNotificationManagerProviderDidShowNotification(notificationManager, id);
     96    WKNotificationManagerProviderDidShowNotification(m_currentNotificationManager.get(), WKNotificationGetID(notification));
    10097}
    10198
    10299void WebNotificationProvider::closeWebNotification(WKNotificationRef notification)
    103100{
     101    if (!m_currentNotificationManager)
     102        return;
     103
    104104    uint64_t id = WKNotificationGetID(notification);
    105     ASSERT(m_owningManager.contains(id));
    106     auto notificationManager = m_owningManager.get(id);
    107 
    108     ASSERT(m_ownedNotifications.contains(notificationManager));
    109     bool success = m_ownedNotifications.find(notificationManager)->value.remove(id);
    110     ASSERT_UNUSED(success, success);
    111     m_owningManager.remove(id);
    112 
    113105    WKRetainPtr<WKUInt64Ref> wkID = WKUInt64Create(id);
    114106    WKRetainPtr<WKMutableArrayRef> array(AdoptWK, WKMutableArrayCreate());
    115107    WKArrayAppendItem(array.get(), wkID.get());
    116     WKNotificationManagerProviderDidCloseNotifications(notificationManager, array.get());
     108    m_shownNotifications.remove(id);
     109    WKNotificationManagerProviderDidCloseNotifications(m_currentNotificationManager.get(), array.get());
    117110}
    118111
    119112void WebNotificationProvider::addNotificationManager(WKNotificationManagerRef manager)
    120113{
    121     m_ownedNotifications.add(manager, HashSet<uint64_t>());
     114    m_currentNotificationManager = manager;
    122115}
    123116
    124117void WebNotificationProvider::removeNotificationManager(WKNotificationManagerRef manager)
    125118{
    126     auto iterator = m_ownedNotifications.find(manager);
    127     ASSERT(iterator != m_ownedNotifications.end());
    128     auto toRemove = iterator->value;
    129     WKRetainPtr<WKNotificationManagerRef> guard(manager);
    130     m_ownedNotifications.remove(iterator);
    131     WKRetainPtr<WKMutableArrayRef> array = adoptWK(WKMutableArrayCreate());
    132     for (uint64_t notificationID : toRemove) {
    133         bool success = m_owningManager.remove(notificationID);
    134         ASSERT_UNUSED(success, success);
    135         WKArrayAppendItem(array.get(), adoptWK(WKUInt64Create(notificationID)).get());
    136     }
    137     WKNotificationManagerProviderDidCloseNotifications(manager, array.get());
    138119}
    139120
     
    146127void WebNotificationProvider::simulateWebNotificationClick(uint64_t notificationID)
    147128{
    148     ASSERT(m_owningManager.contains(notificationID));
    149     WKNotificationManagerProviderDidClickNotification(m_owningManager.get(notificationID), notificationID);
     129    if (!m_currentNotificationManager)
     130        return;
     131
     132    ASSERT(m_shownNotifications.contains(notificationID));
     133    WKNotificationManagerProviderDidClickNotification(m_currentNotificationManager.get(), notificationID);
    150134}
    151135
    152136void WebNotificationProvider::reset()
    153137{
    154     for (auto& notificationPair : m_ownedNotifications) {
    155         if (notificationPair.value.isEmpty())
    156             continue;
    157         WKRetainPtr<WKMutableArrayRef> array = adoptWK(WKMutableArrayCreate());
    158         for (uint64_t notificationID : notificationPair.value)
    159             WKArrayAppendItem(array.get(), adoptWK(WKUInt64Create(notificationID)).get());
     138    if (!m_currentNotificationManager) {
     139        m_shownNotifications.clear();
     140        return;
     141    }
    160142
    161         notificationPair.value.clear();
    162         WKNotificationManagerProviderDidCloseNotifications(notificationPair.key.get(), array.get());
     143    WKRetainPtr<WKMutableArrayRef> array(AdoptWK, WKMutableArrayCreate());
     144    HashSet<uint64_t>::const_iterator itEnd = m_shownNotifications.end();
     145    for (HashSet<uint64_t>::const_iterator it = m_shownNotifications.begin(); it != itEnd; ++it) {
     146        WKRetainPtr<WKUInt64Ref> wkID = WKUInt64Create(*it);
     147        WKArrayAppendItem(array.get(), wkID.get());
    163148    }
    164     m_owningManager.clear();
     149
     150    m_shownNotifications.clear();
     151    WKNotificationManagerProviderDidCloseNotifications(m_currentNotificationManager.get(), array.get());
    165152}
    166153
  • trunk/Tools/WebKitTestRunner/WebNotificationProvider.h

    r190593 r190689  
    3030#include <WebKit/WKNotificationProvider.h>
    3131#include <WebKit/WKRetainPtr.h>
    32 #include <wtf/HashMap.h>
    3332#include <wtf/HashSet.h>
    3433
     
    5150
    5251private:
    53     // Inverses of each other.
    54     HashMap<WKRetainPtr<WKNotificationManagerRef>, HashSet<uint64_t>> m_ownedNotifications;
    55     HashMap<uint64_t, WKNotificationManagerRef> m_owningManager;
     52    WKRetainPtr<WKNotificationManagerRef> m_currentNotificationManager;
     53    HashSet<uint64_t> m_shownNotifications;
    5654};
    5755
Note: See TracChangeset for help on using the changeset viewer.