From 03e12282df9aa1e1fb05a8b90f1cfc2e08764cec Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 9 Feb 2012 14:16:12 +0100 Subject: Imported WebKit commit e09a82039aa4273ab318b71122e92d8e5f233525 (http://svn.webkit.org/repository/webkit/trunk@107223) --- .../UIProcess/Notifications/WebNotificationProvider.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'Source/WebKit2/UIProcess/Notifications/WebNotificationProvider.cpp') 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& notificationIDs) +{ + if (!m_client.clearNotifications) + return; + + RefPtr 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) -- cgit v1.2.1