summaryrefslogtreecommitdiff
path: root/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2013-09-13 12:51:20 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-19 20:50:05 +0200
commitd441d6f39bb846989d95bcf5caf387b42414718d (patch)
treee367e64a75991c554930278175d403c072de6bb8 /Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.h
parent0060b2994c07842f4c59de64b5e3e430525c4b90 (diff)
downloadqtwebkit-d441d6f39bb846989d95bcf5caf387b42414718d.tar.gz
Import Qt5x2 branch of QtWebkit for Qt 5.2
Importing a new snapshot of webkit. Change-Id: I2d01ad12cdc8af8cb015387641120a9d7ea5f10c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.h')
-rw-r--r--Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.h53
1 files changed, 28 insertions, 25 deletions
diff --git a/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.h b/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.h
index d54338769..5890b5c1b 100644
--- a/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.h
+++ b/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2011, 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -28,6 +28,7 @@
#include "APIObject.h"
#include "MessageReceiver.h"
+#include "WebContextSupplement.h"
#include "WebNotificationProvider.h"
#include <WebCore/NotificationClient.h>
#include <wtf/HashMap.h>
@@ -42,45 +43,47 @@ class WebContext;
class WebPageProxy;
class WebSecurityOrigin;
-class WebNotificationManagerProxy : public APIObject, private CoreIPC::MessageReceiver {
+class WebNotificationManagerProxy : public TypedAPIObject<APIObject::TypeNotificationManager>, public WebContextSupplement {
public:
- static const Type APIType = TypeNotificationManager;
-
+
+ static const char* supplementName();
+
static PassRefPtr<WebNotificationManagerProxy> create(WebContext*);
-
- void invalidate();
- void clearContext() { m_context = 0; }
void initializeProvider(const WKNotificationProvider*);
void populateCopyOfNotificationPermissions(HashMap<String, bool>&);
- void show(WebPageProxy*, const String& title, const String& body, const String& iconURL, const String& tag, const String& lang, const String& dir, const String& originString, uint64_t notificationID);
+ void show(WebPageProxy*, const String& title, const String& body, const String& iconURL, const String& tag, const String& lang, const String& dir, const String& originString, uint64_t pageNotificationID);
+ void cancel(WebPageProxy*, uint64_t pageNotificationID);
+ void clearNotifications(WebPageProxy*);
+ void clearNotifications(WebPageProxy*, const Vector<uint64_t>& pageNotificationIDs);
+ void didDestroyNotification(WebPageProxy*, uint64_t pageNotificationID);
void providerDidShowNotification(uint64_t notificationID);
void providerDidClickNotification(uint64_t notificationID);
void providerDidCloseNotifications(ImmutableArray* notificationIDs);
void providerDidUpdateNotificationPolicy(const WebSecurityOrigin*, bool allowed);
void providerDidRemoveNotificationPolicies(ImmutableArray* origins);
-
+
+ using APIObject::ref;
+ using APIObject::deref;
+
private:
explicit WebNotificationManagerProxy(WebContext*);
-
- virtual Type type() const { return APIType; }
-
- // CoreIPC::MessageReceiver
- virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
- void didReceiveWebNotificationManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
-
- // Message handlers
- void cancel(uint64_t notificationID);
- void didDestroyNotification(uint64_t notificationID);
- void clearNotifications(const Vector<uint64_t>& notificationIDs);
-
- typedef HashMap<uint64_t, RefPtr<WebNotification> > WebNotificationMap;
-
- WebContext* m_context;
+
+ typedef bool (*NotificationFilterFunction)(uint64_t pageID, uint64_t pageNotificationID, uint64_t desiredPageID, const Vector<uint64_t>& desiredPageNotificationIDs);
+ void clearNotifications(WebPageProxy*, const Vector<uint64_t>& pageNotificationIDs, NotificationFilterFunction);
+
+ // WebContextSupplement
+ virtual void contextDestroyed() OVERRIDE;
+ virtual void refWebContextSupplement() OVERRIDE;
+ virtual void derefWebContextSupplement() OVERRIDE;
+
WebNotificationProvider m_provider;
- WebNotificationMap m_notifications;
+ // Pair comprised of web page ID and the web process's notification ID
+ HashMap<uint64_t, pair<uint64_t, uint64_t>> m_globalNotificationMap;
+ // Key pair comprised of web page ID and the web process's notification ID; value pair comprised of global notification ID, and notification object
+ HashMap<pair<uint64_t, uint64_t>, pair<uint64_t, RefPtr<WebNotification>>> m_notifications;
};
} // namespace WebKit