Changeset 190689 in webkit
- Timestamp:
- Oct 7, 2015 2:34:12 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r190688 r190689 1 2015-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 1 27 2015-10-07 Antti Koivisto <antti@apple.com> 2 28 -
trunk/LayoutTests/TestExpectations
r190593 r190689 677 677 678 678 http/tests/xmlhttprequest/timeout/xmlhttprequest-timeout-overrides.html [ Failure Pass ] 679 680 webkit.org/b/149218 http/tests/notifications/events.html [ Pass Crash Timeout ] -
trunk/Source/WebKit2/ChangeLog
r190686 r190689 1 2015-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 1 27 2015-10-07 Anders Carlsson <andersca@apple.com> 2 28 -
trunk/Source/WebKit2/UIProcess/API/cpp/WKRetainPtr.h
r190594 r190689 29 29 #include <WebKit/WKType.h> 30 30 #include <algorithm> 31 #include <wtf/GetPtr.h>32 #include <wtf/HashFunctions.h>33 #include <wtf/HashTraits.h>34 #include <wtf/RefPtr.h>35 31 36 32 namespace WebKit { … … 88 84 WKRelease(ptr); 89 85 } 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); }99 86 100 87 PtrType get() const { return m_ptr; } … … 264 251 using WebKit::adoptWK; 265 252 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 WTF285 286 253 #endif // WKRetainPtr_h -
trunk/Tools/ChangeLog
r190660 r190689 1 2015-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 1 27 2015-10-06 Michael Catanzaro <mcatanzaro@igalia.com> 2 28 -
trunk/Tools/TestWebKitAPI/PlatformGTK.cmake
r190572 r190689 111 111 ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKPageGetScaleFactorNotZero.cpp 112 112 ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKPreferences.cpp 113 ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKRetainPtr.cpp114 113 ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKString.cpp 115 114 ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKStringJSString.cpp -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r190572 r190689 23 23 1AEDE22613E5E7E700E62FE8 /* InjectedBundleControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AEDE22413E5E7A000E62FE8 /* InjectedBundleControllerMac.mm */; }; 24 24 1CB9BC381A67482300FE5678 /* WeakPtr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1CB9BC371A67482300FE5678 /* WeakPtr.cpp */; }; 25 1CF0D3791BBF2F3D00B4EF54 /* WKRetainPtr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1CF0D3781BBF2F3D00B4EF54 /* WKRetainPtr.cpp */; };26 25 260BA5791B1D2E7B004FA07C /* DFACombiner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260BA5781B1D2E7B004FA07C /* DFACombiner.cpp */; }; 27 26 26DF5A6315A2A27E003689C2 /* CancelLoadFromResourceLoadDelegate.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 26DF5A6115A2A22B003689C2 /* CancelLoadFromResourceLoadDelegate.html */; }; … … 472 471 1AFDE6541953B2C000C48FFA /* Optional.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Optional.cpp; sourceTree = "<group>"; }; 473 472 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>"; };475 473 260BA5781B1D2E7B004FA07C /* DFACombiner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DFACombiner.cpp; sourceTree = "<group>"; }; 476 474 260BA57A1B1D2EE2004FA07C /* DFAHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DFAHelpers.h; sourceTree = "<group>"; }; … … 1144 1142 BC90995D12567BC100083756 /* WKString.cpp */, 1145 1143 BC9099931256ACF100083756 /* WKStringJSString.cpp */, 1146 1CF0D3781BBF2F3D00B4EF54 /* WKRetainPtr.cpp */,1147 1144 ); 1148 1145 path = WebKit2; … … 1749 1746 7A5623111AD5AF3E0096B920 /* MenuTypesForMouseEvents.cpp in Sources */, 1750 1747 51CB4AD81B3A079C00C1B1C6 /* ModalAlertsSPI.cpp in Sources */, 1751 1CF0D3791BBF2F3D00B4EF54 /* WKRetainPtr.cpp in Sources */,1752 1748 26F6E1F01ADC749B00DE696B /* DFAMinimizer.cpp in Sources */, 1753 1749 260BA5791B1D2E7B004FA07C /* DFACombiner.cpp in Sources */, -
trunk/Tools/WebKitTestRunner/WebNotificationProvider.cpp
r190593 r190689 66 66 WebNotificationProvider::~WebNotificationProvider() 67 67 { 68 for (auto& manager : m_ownedNotifications)69 WKNotificationManagerSetProvider(m anager.key.get(), nullptr);68 if (m_currentNotificationManager) 69 WKNotificationManagerSetProvider(m_currentNotificationManager.get(), nullptr); 70 70 } 71 71 … … 85 85 } 86 86 87 void WebNotificationProvider::showWebNotification(WKPageRef page, WKNotificationRef notification)87 void WebNotificationProvider::showWebNotification(WKPageRef, WKNotificationRef notification) 88 88 { 89 auto context = WKPageGetContext(page); 90 auto notificationManager = WKContextGetNotificationManager(context); 89 if (!m_currentNotificationManager) 90 return; 91 91 92 uint64_t id = WKNotificationGetID(notification); 93 ASSERT(!m_shownNotifications.contains(id)); 94 m_shownNotifications.add(id); 92 95 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)); 100 97 } 101 98 102 99 void WebNotificationProvider::closeWebNotification(WKNotificationRef notification) 103 100 { 101 if (!m_currentNotificationManager) 102 return; 103 104 104 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 113 105 WKRetainPtr<WKUInt64Ref> wkID = WKUInt64Create(id); 114 106 WKRetainPtr<WKMutableArrayRef> array(AdoptWK, WKMutableArrayCreate()); 115 107 WKArrayAppendItem(array.get(), wkID.get()); 116 WKNotificationManagerProviderDidCloseNotifications(notificationManager, array.get()); 108 m_shownNotifications.remove(id); 109 WKNotificationManagerProviderDidCloseNotifications(m_currentNotificationManager.get(), array.get()); 117 110 } 118 111 119 112 void WebNotificationProvider::addNotificationManager(WKNotificationManagerRef manager) 120 113 { 121 m_ ownedNotifications.add(manager, HashSet<uint64_t>());114 m_currentNotificationManager = manager; 122 115 } 123 116 124 117 void WebNotificationProvider::removeNotificationManager(WKNotificationManagerRef manager) 125 118 { 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());138 119 } 139 120 … … 146 127 void WebNotificationProvider::simulateWebNotificationClick(uint64_t notificationID) 147 128 { 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); 150 134 } 151 135 152 136 void WebNotificationProvider::reset() 153 137 { 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 } 160 142 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()); 163 148 } 164 m_owningManager.clear(); 149 150 m_shownNotifications.clear(); 151 WKNotificationManagerProviderDidCloseNotifications(m_currentNotificationManager.get(), array.get()); 165 152 } 166 153 -
trunk/Tools/WebKitTestRunner/WebNotificationProvider.h
r190593 r190689 30 30 #include <WebKit/WKNotificationProvider.h> 31 31 #include <WebKit/WKRetainPtr.h> 32 #include <wtf/HashMap.h>33 32 #include <wtf/HashSet.h> 34 33 … … 51 50 52 51 private: 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; 56 54 }; 57 55
Note: See TracChangeset
for help on using the changeset viewer.