Skip to content
Permalink
Browse files
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

Canonical link: https://commits.webkit.org/168034@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190689 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
webkit-commit-queue committed Oct 7, 2015
1 parent a01738f commit c78443cadbbad13c7fbd6810bc77f6e3d0297dc2
@@ -1,3 +1,29 @@
2015-10-07 Commit Queue <commit-queue@webkit.org>

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

2015-10-07 Antti Koivisto <antti@apple.com>

Implement :host pseudo class
@@ -676,3 +676,5 @@ webkit.org/b/148695 fast/shadow-dom [ Failure ImageOnlyFailure ]
# Marks as flaky (see also https://bugs.webkit.org/show_bug.cgi?id=132388)

http/tests/xmlhttprequest/timeout/xmlhttprequest-timeout-overrides.html [ Failure Pass ]

webkit.org/b/149218 http/tests/notifications/events.html [ Pass Crash Timeout ]
@@ -1,3 +1,29 @@
2015-10-07 Commit Queue <commit-queue@webkit.org>

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

2015-10-07 Anders Carlsson <andersca@apple.com>

Provide a way to get a WKFrameInfoRef from a WKFrameRef
@@ -28,10 +28,6 @@

#include <WebKit/WKType.h>
#include <algorithm>
#include <wtf/GetPtr.h>
#include <wtf/HashFunctions.h>
#include <wtf/HashTraits.h>
#include <wtf/RefPtr.h>

namespace WebKit {

@@ -88,15 +84,6 @@ template<typename T> class WKRetainPtr {
WKRelease(ptr);
}

// Hash table deleted values, which are only constructed and never copied or destroyed.
WKRetainPtr(WTF::HashTableDeletedValueType)
: m_ptr(hashTableDeletedValue())
{
}

bool isHashTableDeletedValue() const { return m_ptr == hashTableDeletedValue(); }
constexpr static T hashTableDeletedValue() { return reinterpret_cast<T>(-1); }

PtrType get() const { return m_ptr; }

void clear()
@@ -263,24 +250,4 @@ using WebKit::WKRetainPtr;
using WebKit::AdoptWK;
using WebKit::adoptWK;

namespace WTF {

template <typename T> struct IsSmartPtr<WKRetainPtr<T>> {
static const bool value = true;
};

template<typename P> struct DefaultHash<WKRetainPtr<P>> {
typedef PtrHash<WKRetainPtr<P>> Hash;
};

template<typename P> struct HashTraits<WKRetainPtr<P>> : SimpleClassHashTraits<WKRetainPtr<P>> {
static P emptyValue() { return nullptr; }

typedef P PeekType;
static PeekType peek(const WKRetainPtr<P>& value) { return value.get(); }
static PeekType peek(P value) { return value; }
};

} // namespace WTF

#endif // WKRetainPtr_h
@@ -1,3 +1,29 @@
2015-10-07 Commit Queue <commit-queue@webkit.org>

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

2015-10-06 Michael Catanzaro <mcatanzaro@igalia.com>

[GTK] Add autocleanups
@@ -110,7 +110,6 @@ add_executable(TestWebKit2
${TESTWEBKITAPI_DIR}/Tests/WebKit2/WillSendSubmitEvent.cpp
${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKPageGetScaleFactorNotZero.cpp
${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKPreferences.cpp
${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKRetainPtr.cpp
${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKString.cpp
${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKStringJSString.cpp
${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKURL.cpp
@@ -22,7 +22,6 @@
1ADBEFE3130C6AA100D61D19 /* simple-accelerated-compositing.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 1ADBEFBC130C6A0100D61D19 /* simple-accelerated-compositing.html */; };
1AEDE22613E5E7E700E62FE8 /* InjectedBundleControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AEDE22413E5E7A000E62FE8 /* InjectedBundleControllerMac.mm */; };
1CB9BC381A67482300FE5678 /* WeakPtr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1CB9BC371A67482300FE5678 /* WeakPtr.cpp */; };
1CF0D3791BBF2F3D00B4EF54 /* WKRetainPtr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1CF0D3781BBF2F3D00B4EF54 /* WKRetainPtr.cpp */; };
260BA5791B1D2E7B004FA07C /* DFACombiner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260BA5781B1D2E7B004FA07C /* DFACombiner.cpp */; };
26DF5A6315A2A27E003689C2 /* CancelLoadFromResourceLoadDelegate.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 26DF5A6115A2A22B003689C2 /* CancelLoadFromResourceLoadDelegate.html */; };
26F52EAD1828827B0023D412 /* geolocationGetCurrentPosition.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 26F52EAC1828820E0023D412 /* geolocationGetCurrentPosition.html */; };
@@ -471,7 +470,6 @@
1AEF994817A09F5300998EF0 /* GetPIDAfterAbortedProcessLaunch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetPIDAfterAbortedProcessLaunch.cpp; sourceTree = "<group>"; };
1AFDE6541953B2C000C48FFA /* Optional.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Optional.cpp; sourceTree = "<group>"; };
1CB9BC371A67482300FE5678 /* WeakPtr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WeakPtr.cpp; sourceTree = "<group>"; };
1CF0D3781BBF2F3D00B4EF54 /* WKRetainPtr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKRetainPtr.cpp; sourceTree = "<group>"; };
260BA5781B1D2E7B004FA07C /* DFACombiner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DFACombiner.cpp; sourceTree = "<group>"; };
260BA57A1B1D2EE2004FA07C /* DFAHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DFAHelpers.h; sourceTree = "<group>"; };
261516D515B0E60500A2C201 /* SetAndUpdateCacheModel.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SetAndUpdateCacheModel.mm; sourceTree = "<group>"; };
@@ -1143,7 +1141,6 @@
BC7B619A1299FE9E00D174A4 /* WKPreferences.cpp */,
BC90995D12567BC100083756 /* WKString.cpp */,
BC9099931256ACF100083756 /* WKStringJSString.cpp */,
1CF0D3781BBF2F3D00B4EF54 /* WKRetainPtr.cpp */,
);
path = WebKit2;
sourceTree = "<group>";
@@ -1748,7 +1745,6 @@
A1C4FB6E1BACCE50003742D0 /* QuickLook.mm in Sources */,
7A5623111AD5AF3E0096B920 /* MenuTypesForMouseEvents.cpp in Sources */,
51CB4AD81B3A079C00C1B1C6 /* ModalAlertsSPI.cpp in Sources */,
1CF0D3791BBF2F3D00B4EF54 /* WKRetainPtr.cpp in Sources */,
26F6E1F01ADC749B00DE696B /* DFAMinimizer.cpp in Sources */,
260BA5791B1D2E7B004FA07C /* DFACombiner.cpp in Sources */,
7A99D9941AD4A29D00373141 /* MenuTypesForMouseEvents.mm in Sources */,

This file was deleted.

@@ -65,8 +65,8 @@ WebNotificationProvider::WebNotificationProvider()

WebNotificationProvider::~WebNotificationProvider()
{
for (auto& manager : m_ownedNotifications)
WKNotificationManagerSetProvider(manager.key.get(), nullptr);
if (m_currentNotificationManager)
WKNotificationManagerSetProvider(m_currentNotificationManager.get(), nullptr);
}

WKNotificationProviderV0 WebNotificationProvider::provider()
@@ -84,57 +84,38 @@ WKNotificationProviderV0 WebNotificationProvider::provider()
return notificationProvider;
}

void WebNotificationProvider::showWebNotification(WKPageRef page, WKNotificationRef notification)
void WebNotificationProvider::showWebNotification(WKPageRef, WKNotificationRef notification)
{
auto context = WKPageGetContext(page);
auto notificationManager = WKContextGetNotificationManager(context);
uint64_t id = WKNotificationGetID(notification);
if (!m_currentNotificationManager)
return;

ASSERT(m_ownedNotifications.contains(notificationManager));
auto addResult = m_ownedNotifications.find(notificationManager)->value.add(id);
ASSERT_UNUSED(addResult, addResult.isNewEntry);
auto addResult2 = m_owningManager.set(id, notificationManager);
ASSERT_UNUSED(addResult2, addResult2.isNewEntry);
uint64_t id = WKNotificationGetID(notification);
ASSERT(!m_shownNotifications.contains(id));
m_shownNotifications.add(id);

WKNotificationManagerProviderDidShowNotification(notificationManager, id);
WKNotificationManagerProviderDidShowNotification(m_currentNotificationManager.get(), WKNotificationGetID(notification));
}

void WebNotificationProvider::closeWebNotification(WKNotificationRef notification)
{
uint64_t id = WKNotificationGetID(notification);
ASSERT(m_owningManager.contains(id));
auto notificationManager = m_owningManager.get(id);

ASSERT(m_ownedNotifications.contains(notificationManager));
bool success = m_ownedNotifications.find(notificationManager)->value.remove(id);
ASSERT_UNUSED(success, success);
m_owningManager.remove(id);
if (!m_currentNotificationManager)
return;

uint64_t id = WKNotificationGetID(notification);
WKRetainPtr<WKUInt64Ref> wkID = WKUInt64Create(id);
WKRetainPtr<WKMutableArrayRef> array(AdoptWK, WKMutableArrayCreate());
WKArrayAppendItem(array.get(), wkID.get());
WKNotificationManagerProviderDidCloseNotifications(notificationManager, array.get());
m_shownNotifications.remove(id);
WKNotificationManagerProviderDidCloseNotifications(m_currentNotificationManager.get(), array.get());
}

void WebNotificationProvider::addNotificationManager(WKNotificationManagerRef manager)
{
m_ownedNotifications.add(manager, HashSet<uint64_t>());
m_currentNotificationManager = manager;
}

void WebNotificationProvider::removeNotificationManager(WKNotificationManagerRef manager)
{
auto iterator = m_ownedNotifications.find(manager);
ASSERT(iterator != m_ownedNotifications.end());
auto toRemove = iterator->value;
WKRetainPtr<WKNotificationManagerRef> guard(manager);
m_ownedNotifications.remove(iterator);
WKRetainPtr<WKMutableArrayRef> array = adoptWK(WKMutableArrayCreate());
for (uint64_t notificationID : toRemove) {
bool success = m_owningManager.remove(notificationID);
ASSERT_UNUSED(success, success);
WKArrayAppendItem(array.get(), adoptWK(WKUInt64Create(notificationID)).get());
}
WKNotificationManagerProviderDidCloseNotifications(manager, array.get());
}

WKDictionaryRef WebNotificationProvider::notificationPermissions()
@@ -145,23 +126,29 @@ WKDictionaryRef WebNotificationProvider::notificationPermissions()

void WebNotificationProvider::simulateWebNotificationClick(uint64_t notificationID)
{
ASSERT(m_owningManager.contains(notificationID));
WKNotificationManagerProviderDidClickNotification(m_owningManager.get(notificationID), notificationID);
if (!m_currentNotificationManager)
return;

ASSERT(m_shownNotifications.contains(notificationID));
WKNotificationManagerProviderDidClickNotification(m_currentNotificationManager.get(), notificationID);
}

void WebNotificationProvider::reset()
{
for (auto& notificationPair : m_ownedNotifications) {
if (notificationPair.value.isEmpty())
continue;
WKRetainPtr<WKMutableArrayRef> array = adoptWK(WKMutableArrayCreate());
for (uint64_t notificationID : notificationPair.value)
WKArrayAppendItem(array.get(), adoptWK(WKUInt64Create(notificationID)).get());

notificationPair.value.clear();
WKNotificationManagerProviderDidCloseNotifications(notificationPair.key.get(), array.get());
if (!m_currentNotificationManager) {
m_shownNotifications.clear();
return;
}
m_owningManager.clear();

WKRetainPtr<WKMutableArrayRef> array(AdoptWK, WKMutableArrayCreate());
HashSet<uint64_t>::const_iterator itEnd = m_shownNotifications.end();
for (HashSet<uint64_t>::const_iterator it = m_shownNotifications.begin(); it != itEnd; ++it) {
WKRetainPtr<WKUInt64Ref> wkID = WKUInt64Create(*it);
WKArrayAppendItem(array.get(), wkID.get());
}

m_shownNotifications.clear();
WKNotificationManagerProviderDidCloseNotifications(m_currentNotificationManager.get(), array.get());
}

} // namespace WTR
@@ -29,7 +29,6 @@
#include <WebKit/WKNotificationManager.h>
#include <WebKit/WKNotificationProvider.h>
#include <WebKit/WKRetainPtr.h>
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>

namespace WTR {
@@ -50,9 +49,8 @@ class WebNotificationProvider {
void reset();

private:
// Inverses of each other.
HashMap<WKRetainPtr<WKNotificationManagerRef>, HashSet<uint64_t>> m_ownedNotifications;
HashMap<uint64_t, WKNotificationManagerRef> m_owningManager;
WKRetainPtr<WKNotificationManagerRef> m_currentNotificationManager;
HashSet<uint64_t> m_shownNotifications;
};

}

0 comments on commit c78443c

Please sign in to comment.