diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-09 14:16:12 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-09 14:16:12 +0100 |
commit | 03e12282df9aa1e1fb05a8b90f1cfc2e08764cec (patch) | |
tree | 52599cd0ab782b1768e23ad176f7618f98333cb6 /Source/WebKit2/UIProcess/Notifications/WebNotificationProvider.cpp | |
parent | cd44dc59cdfc39534aef4d417e9f3c412e3be139 (diff) | |
download | qtwebkit-03e12282df9aa1e1fb05a8b90f1cfc2e08764cec.tar.gz |
Imported WebKit commit e09a82039aa4273ab318b71122e92d8e5f233525 (http://svn.webkit.org/repository/webkit/trunk@107223)
Diffstat (limited to 'Source/WebKit2/UIProcess/Notifications/WebNotificationProvider.cpp')
-rw-r--r-- | Source/WebKit2/UIProcess/Notifications/WebNotificationProvider.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/WebKit2/UIProcess/Notifications/WebNotificationProvider.cpp b/Source/WebKit2/UIProcess/Notifications/WebNotificationProvider.cpp index afd13bccd..133e79aaa 100644 --- a/Source/WebKit2/UIProcess/Notifications/WebNotificationProvider.cpp +++ b/Source/WebKit2/UIProcess/Notifications/WebNotificationProvider.cpp @@ -27,9 +27,11 @@ #include "WebNotificationProvider.h" #include "ImmutableDictionary.h" +#include "MutableArray.h" #include "WKAPICast.h" #include "WebNotification.h" #include "WebNotificationManagerProxy.h" +#include "WebNumber.h" #include "WebSecurityOrigin.h" namespace WebKit { @@ -58,6 +60,20 @@ void WebNotificationProvider::didDestroyNotification(WebNotification* notificati m_client.didDestroyNotification(toAPI(notification), m_client.clientInfo); } +void WebNotificationProvider::clearNotifications(const Vector<uint64_t>& notificationIDs) +{ + if (!m_client.clearNotifications) + return; + + RefPtr<MutableArray> arrayIDs = MutableArray::create(); + size_t count = notificationIDs.size(); + arrayIDs->reserveCapacity(count); + for (size_t i = 0; i < count; ++i) + arrayIDs->append(WebUInt64::create(notificationIDs[i]).leakRef()); + + m_client.clearNotifications(toAPI(arrayIDs.get()), m_client.clientInfo); +} + void WebNotificationProvider::addNotificationManager(WebNotificationManagerProxy* manager) { if (!m_client.addNotificationManager) |