[WK2] Add further support for notifications
authorjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Dec 2011 07:13:36 +0000 (07:13 +0000)
committerjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Dec 2011 07:13:36 +0000 (07:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=73572
<rdar://problem/10472195>

Reviewed by Darin Adler.

Source/WebCore:

* WebCore.exp.in: Export constructor and dispatch functions
* dom/EventNames.h: Add show event.
* notifications/Notification.cpp:
(WebCore::Notification::show): For the Mac platform, we just forward the show() call to the
notification client and update the state, because we cannot get synchronous acknowledgment that the
notification got delivered.
(WebCore::Notification::dispatchShowEvent): Create simple events and dispatch to the notification.
(WebCore::Notification::dispatchClickEvent): Ditto.
(WebCore::Notification::dispatchCloseEvent): Ditto.
(WebCore::Notification::dispatchErrorEvent): Ditto.
* notifications/Notification.h: Add dispatch functions.
* notifications/Notification.idl: Add onshow event listener. The ondisplay event listener should be
removed when implementations change the event listener to onshow.

Source/WebKit2:

* WebProcess/Notifications/WebNotificationManager.messages.in: Added. Contains messages for callbacks
from the notification platform.

* DerivedSources.make: Add WebNotificationManager.
* DerivedSources.pri: Ditto.
* Platform/CoreIPC/MessageID.h: Add message class.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::didReceiveMessage): Forward calls to WebNotificationManager when needed.
* WebKit2.xcodeproj/project.pbxproj: Add new message files.
* win/WebKit2.vcproj: Adding new files to project.
* win/WebKit2Common.vsprops: Add Notifications to include paths

* UIProcess/WebNotification.h: Add and expose internal ID of each notification sent to the platform.
(WebKit::WebNotification::create):
(WebKit::WebNotification::notificationID):
(WebKit::isNotificationIDValid): Checks that the ID is not a value that might trip up the HashMaps used
for mapping IDs to notifications.
* UIProcess/WebNotification.cpp:
(WebKit::WebNotification::WebNotification):
(WebKit::WebNotification::encode):
(WebKit::WebNotification::decode):
* UIProcess/API/C/WKNotification.h: Expose notification ID to WKAPI.
* UIProcess/API/C/WKNotification.cpp:
(WKNotificationGetNotificationID):

* UIProcess/WebNotificationManagerProxy.h: Add callbacks for dispatching events back to the notification.
* UIProcess/WebNotificationManagerProxy.cpp:
(WebKit::WebNotificationManagerProxy::invalidate): Remove manager.
(WebKit::WebNotificationManagerProxy::show): Add manager prior to showing.
(WebKit::WebNotificationManagerProxy::cancel): Add manager prior to canceling.
(WebKit::WebNotificationManagerProxy::didDestroyNotification):
(WebKit::WebNotificationManagerProxy::providerDidShowNotification):
(WebKit::WebNotificationManagerProxy::providerDidClickNotification):
(WebKit::WebNotificationManagerProxy::providerDidCloseNotifications):
* UIProcess/API/C/WKNotificationManager.h:
* UIProcess/API/C/WKNotificationManager.cpp:
(WKNotificationManagerProviderDidShowNotification):
(WKNotificationManagerProviderDidClickNotification):
(WKNotificationManagerProviderDidCloseNotifications):

* UIProcess/WebNotificationProvider.h:
* UIProcess/WebNotificationProvider.cpp:
(WebKit::WebNotificationProvider::show):
(WebKit::WebNotificationProvider::cancel):
(WebKit::WebNotificationProvider::didDestroyNotification):
(WebKit::WebNotificationProvider::addNotificationManager):
(WebKit::WebNotificationProvider::removeNotificationManager):
* UIProcess/API/C/WKNotificationProvider.h: Expose add/removeNotificationManager calls

* WebProcess/Notifications/WebNotificationManager.h: Add bookkeeping to keep track of notification IDs with
Notification instances.
* WebProcess/Notifications/WebNotificationManager.cpp:
(WebKit::generateNotificationID):
(WebKit::WebNotificationManager::didReceiveMessage):
(WebKit::WebNotificationManager::show):
(WebKit::WebNotificationManager::cancel):
(WebKit::WebNotificationManager::didDestroyNotification):
(WebKit::WebNotificationManager::didShowNotification):
(WebKit::WebNotificationManager::didClickNotification):
(WebKit::WebNotificationManager::didCloseNotifications):

* UIProcess/WebNotificationManagerProxy.messages.in: Add DidDestroyNotification message.
* WebProcess/WebCoreSupport/WebNotificationClient.cpp:
(WebKit::WebNotificationClient::notificationObjectDestroyed): Implemented.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@101750 268f45cc-cd09-0410-ab3c-d52691b4dbfc

30 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/dom/EventNames.h
Source/WebCore/notifications/Notification.cpp
Source/WebCore/notifications/Notification.h
Source/WebCore/notifications/Notification.idl
Source/WebKit2/ChangeLog
Source/WebKit2/DerivedSources.make
Source/WebKit2/DerivedSources.pri
Source/WebKit2/Platform/CoreIPC/MessageID.h
Source/WebKit2/UIProcess/API/C/WKNotification.cpp
Source/WebKit2/UIProcess/API/C/WKNotification.h
Source/WebKit2/UIProcess/API/C/WKNotificationManager.cpp
Source/WebKit2/UIProcess/API/C/WKNotificationManager.h
Source/WebKit2/UIProcess/API/C/WKNotificationProvider.h
Source/WebKit2/UIProcess/WebNotification.cpp
Source/WebKit2/UIProcess/WebNotification.h
Source/WebKit2/UIProcess/WebNotificationManagerProxy.cpp
Source/WebKit2/UIProcess/WebNotificationManagerProxy.h
Source/WebKit2/UIProcess/WebNotificationManagerProxy.messages.in
Source/WebKit2/UIProcess/WebNotificationProvider.cpp
Source/WebKit2/UIProcess/WebNotificationProvider.h
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp
Source/WebKit2/WebProcess/Notifications/WebNotificationManager.h
Source/WebKit2/WebProcess/Notifications/WebNotificationManager.messages.in [new file with mode: 0644]
Source/WebKit2/WebProcess/WebCoreSupport/WebNotificationClient.cpp
Source/WebKit2/WebProcess/WebProcess.cpp
Source/WebKit2/win/WebKit2.vcproj
Source/WebKit2/win/WebKit2Common.vsprops

index 9347667..3c29fa6 100644 (file)
@@ -1,3 +1,25 @@
+2011-12-01  Jon Lee  <jonlee@apple.com>
+
+        [WK2] Add further support for notifications
+        https://bugs.webkit.org/show_bug.cgi?id=73572
+        <rdar://problem/10472195>
+
+        Reviewed by Darin Adler.
+
+        * WebCore.exp.in: Export constructor and dispatch functions
+        * dom/EventNames.h: Add show event.
+        * notifications/Notification.cpp:
+        (WebCore::Notification::show): For the Mac platform, we just forward the show() call to the
+        notification client and update the state, because we cannot get synchronous acknowledgment that the
+        notification got delivered.
+        (WebCore::Notification::dispatchShowEvent): Create simple events and dispatch to the notification.
+        (WebCore::Notification::dispatchClickEvent): Ditto.
+        (WebCore::Notification::dispatchCloseEvent): Ditto.
+        (WebCore::Notification::dispatchErrorEvent): Ditto.
+        * notifications/Notification.h: Add dispatch functions.
+        * notifications/Notification.idl: Add onshow event listener. The ondisplay event listener should be
+        removed when implementations change the event listener to onshow.
+
 2011-12-01  Max Vujovic  <mvujovic@adobe.com>
 
         Focus ring of imagemap's area element does not scale when CSS zoom style is applied
index b8003fd..5943bab 100644 (file)
@@ -2008,3 +2008,11 @@ __ZNK7WebCore7IntSizecv7_NSSizeEv
 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
 _wkCreateVMPressureDispatchOnMainQueue
 #endif
+
+#if ENABLE(NOTIFICATIONS)
+__ZN7WebCore12NotificationC1Ev
+__ZN7WebCore12NotificationD1Ev
+__ZN7WebCore12Notification17dispatchShowEventEv
+__ZN7WebCore12Notification18dispatchClickEventEv
+__ZN7WebCore12Notification18dispatchCloseEventEv
+#endif
index c536cfc..d3cf3fd 100644 (file)
@@ -194,6 +194,8 @@ namespace WebCore {
     macro(addstream) \
     macro(removestream) \
     \
+    macro(show) \
+    \
 
 // end of DOM_EVENT_NAMES_FOR_EACH
 
index 3444242..d7991f2 100644 (file)
@@ -36,6 +36,7 @@
 #include "Notification.h"
 
 #include "Document.h"
+#include "ErrorEvent.h"
 #include "EventNames.h"
 #include "NotificationCenter.h"
 #include "NotificationContents.h"
@@ -127,6 +128,11 @@ void Notification::show()
         }
     } else
         startLoading();
+#elif PLATFORM(MAC)
+    if (m_state == Idle && m_notificationCenter->presenter()) {
+        m_notificationCenter->presenter()->show(this);
+        m_state = Showing;
+    }
 #else
     // prevent double-showing
     if (m_state == Idle && m_notificationCenter->presenter() && m_notificationCenter->presenter()->show(this))
@@ -230,6 +236,26 @@ void Notification::finishLoading()
     unsetPendingActivity(this);
 }
 
+void Notification::dispatchShowEvent()
+{
+    dispatchEvent(Event::create(eventNames().showEvent, false, false));
+}
+
+void Notification::dispatchClickEvent()
+{
+    dispatchEvent(Event::create(eventNames().clickEvent, false, false));
+}
+
+void Notification::dispatchCloseEvent()
+{
+    dispatchEvent(Event::create(eventNames().closeEvent, false, false));
+}
+
+void Notification::dispatchErrorEvent()
+{
+    dispatchEvent(ErrorEvent::create());
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(NOTIFICATIONS)
index bb40a80..dd0d6ed 100644 (file)
@@ -88,10 +88,18 @@ public:
 
     TextDirection direction() const { return dir() == "rtl" ? RTL : LTR; }
 
+    DEFINE_ATTRIBUTE_EVENT_LISTENER(show);
+    // FIXME: The latest Web Notifications standard uses the onshow event listener.
+    // The ondisplay event listener should be removed when implementations change the event listener to onshow.
     DEFINE_ATTRIBUTE_EVENT_LISTENER(display);
     DEFINE_ATTRIBUTE_EVENT_LISTENER(error);
     DEFINE_ATTRIBUTE_EVENT_LISTENER(close);
     DEFINE_ATTRIBUTE_EVENT_LISTENER(click);
+    
+    void dispatchClickEvent();
+    void dispatchCloseEvent();
+    void dispatchErrorEvent();
+    void dispatchShowEvent();
 
     using RefCounted<Notification>::ref;
     using RefCounted<Notification>::deref;
index 5af7c4d..d8cb3cc 100644 (file)
@@ -40,6 +40,9 @@ module threads {
         void show();
         void cancel();
 
+        attribute EventListener onshow;
+        // FIXME: The latest Web Notifications standard uses the onshow event listener.
+        // The ondisplay event listener should be removed when implementations change the event listener to onshow.
         attribute EventListener ondisplay;
         attribute EventListener onerror;
         attribute EventListener onclose;
index f84d636..6c1a1c4 100644 (file)
@@ -1,3 +1,76 @@
+2011-12-01  Jon Lee  <jonlee@apple.com>
+
+        [WK2] Add further support for notifications
+        https://bugs.webkit.org/show_bug.cgi?id=73572
+        <rdar://problem/10472195>
+
+        Reviewed by Darin Adler.
+
+        * WebProcess/Notifications/WebNotificationManager.messages.in: Added. Contains messages for callbacks
+        from the notification platform.
+
+        * DerivedSources.make: Add WebNotificationManager.
+        * DerivedSources.pri: Ditto.
+        * Platform/CoreIPC/MessageID.h: Add message class.
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::didReceiveMessage): Forward calls to WebNotificationManager when needed.
+        * WebKit2.xcodeproj/project.pbxproj: Add new message files.
+        * win/WebKit2.vcproj: Adding new files to project.
+        * win/WebKit2Common.vsprops: Add Notifications to include paths
+
+        * UIProcess/WebNotification.h: Add and expose internal ID of each notification sent to the platform.
+        (WebKit::WebNotification::create):
+        (WebKit::WebNotification::notificationID):
+        (WebKit::isNotificationIDValid): Checks that the ID is not a value that might trip up the HashMaps used
+        for mapping IDs to notifications.
+        * UIProcess/WebNotification.cpp:
+        (WebKit::WebNotification::WebNotification):
+        (WebKit::WebNotification::encode):
+        (WebKit::WebNotification::decode):
+        * UIProcess/API/C/WKNotification.h: Expose notification ID to WKAPI.
+        * UIProcess/API/C/WKNotification.cpp:
+        (WKNotificationGetNotificationID):
+
+        * UIProcess/WebNotificationManagerProxy.h: Add callbacks for dispatching events back to the notification.
+        * UIProcess/WebNotificationManagerProxy.cpp:
+        (WebKit::WebNotificationManagerProxy::invalidate): Remove manager.
+        (WebKit::WebNotificationManagerProxy::show): Add manager prior to showing.
+        (WebKit::WebNotificationManagerProxy::cancel): Add manager prior to canceling.
+        (WebKit::WebNotificationManagerProxy::didDestroyNotification):
+        (WebKit::WebNotificationManagerProxy::providerDidShowNotification):
+        (WebKit::WebNotificationManagerProxy::providerDidClickNotification):
+        (WebKit::WebNotificationManagerProxy::providerDidCloseNotifications):
+        * UIProcess/API/C/WKNotificationManager.h:
+        * UIProcess/API/C/WKNotificationManager.cpp:
+        (WKNotificationManagerProviderDidShowNotification):
+        (WKNotificationManagerProviderDidClickNotification):
+        (WKNotificationManagerProviderDidCloseNotifications):
+
+        * UIProcess/WebNotificationProvider.h:
+        * UIProcess/WebNotificationProvider.cpp:
+        (WebKit::WebNotificationProvider::show):
+        (WebKit::WebNotificationProvider::cancel):
+        (WebKit::WebNotificationProvider::didDestroyNotification):
+        (WebKit::WebNotificationProvider::addNotificationManager):
+        (WebKit::WebNotificationProvider::removeNotificationManager):
+        * UIProcess/API/C/WKNotificationProvider.h: Expose add/removeNotificationManager calls
+
+        * WebProcess/Notifications/WebNotificationManager.h: Add bookkeeping to keep track of notification IDs with
+        Notification instances.
+        * WebProcess/Notifications/WebNotificationManager.cpp:
+        (WebKit::generateNotificationID):
+        (WebKit::WebNotificationManager::didReceiveMessage):
+        (WebKit::WebNotificationManager::show):
+        (WebKit::WebNotificationManager::cancel):
+        (WebKit::WebNotificationManager::didDestroyNotification):
+        (WebKit::WebNotificationManager::didShowNotification):
+        (WebKit::WebNotificationManager::didClickNotification):
+        (WebKit::WebNotificationManager::didCloseNotifications):
+
+        * UIProcess/WebNotificationManagerProxy.messages.in: Add DidDestroyNotification message.
+        * WebProcess/WebCoreSupport/WebNotificationClient.cpp:
+        (WebKit::WebNotificationClient::notificationObjectDestroyed): Implemented.
+
 2011-12-01  Goutham J  <gouthamj@motorola.com>
 
         [WEBKIT2] Fix for compilation warnings in WebContext.cpp
index 94e3f3d..a300f84 100644 (file)
@@ -74,6 +74,7 @@ MESSAGE_RECEIVERS = \
     WebMediaCacheManager \
     WebMediaCacheManagerProxy \
     WebNotificationManagerProxy \
+    WebNotificationManager \
     WebPage \
     WebPageProxy \
     WebProcess \
index cae6020..4f25bf4 100644 (file)
@@ -84,6 +84,7 @@ MESSAGE_RECEIVERS = \
     WebMediaCacheManager.messages.in \
     WebMediaCacheManagerProxy.messages.in \
     WebNotificationManagerProxy.messages.in \
+    WebNotificationManager.messages.in \
     WebFullScreenManager.messages.in \
     WebFullScreenManagerProxy.messages.in \
     WebPage/DrawingArea.messages.in \
index 296c22f..30df148 100644 (file)
@@ -48,6 +48,7 @@ enum MessageClass {
     MessageClassWebInspector,
     MessageClassWebKeyValueStorageManager,
     MessageClassWebMediaCacheManager,
+    MessageClassWebNotificationManager,
     MessageClassWebPage,
     MessageClassWebProcess,
     MessageClassWebResourceCacheManager,
index 38c472d..088e773 100644 (file)
@@ -46,3 +46,7 @@ WKStringRef WKNotificationCopyBody(WKNotificationRef notification)
     return toCopiedAPI(toImpl(notification)->body());
 }
 
+uint64_t WKNotificationGetID(WKNotificationRef notification)
+{
+    return toImpl(notification)->notificationID();
+}
index b8d2df5..d395f5d 100644 (file)
@@ -36,7 +36,8 @@ WK_EXPORT WKTypeID WKNotificationGetTypeID();
 
 WK_EXPORT WKStringRef WKNotificationCopyTitle(WKNotificationRef notification);
 WK_EXPORT WKStringRef WKNotificationCopyBody(WKNotificationRef notification);
-    
+WK_EXPORT uint64_t WKNotificationGetID(WKNotificationRef notification);
+
 #ifdef __cplusplus
 }
 #endif
index 1012df1..6ddfa4c 100644 (file)
@@ -35,7 +35,23 @@ WKTypeID WKNotificationManagerGetTypeID()
 {
     return toAPI(WebNotificationManagerProxy::APIType);
 }
+
 void WKNotificationManagerSetProvider(WKNotificationManagerRef managerRef, const WKNotificationProvider* wkProvider)
 {
     toImpl(managerRef)->initializeProvider(wkProvider);
 }
+
+void WKNotificationManagerProviderDidShowNotification(WKNotificationManagerRef managerRef, uint64_t notificationID)
+{
+    toImpl(managerRef)->providerDidShowNotification(notificationID);
+}
+
+void WKNotificationManagerProviderDidClickNotification(WKNotificationManagerRef managerRef, uint64_t notificationID)
+{
+    toImpl(managerRef)->providerDidClickNotification(notificationID);
+}
+
+void WKNotificationManagerProviderDidCloseNotifications(WKNotificationManagerRef managerRef, WKArrayRef notificationIDs)
+{
+    toImpl(managerRef)->providerDidCloseNotifications(toImpl(notificationIDs));
+}
index 3c74351..7360dad 100644 (file)
@@ -36,6 +36,10 @@ extern "C" {
 WK_EXPORT WKTypeID WKNotificationManagerGetTypeID();
 WK_EXPORT void WKNotificationManagerSetProvider(WKNotificationManagerRef managerRef, const WKNotificationProvider* wkProvider);
 
+WK_EXPORT void WKNotificationManagerProviderDidShowNotification(WKNotificationManagerRef managerRef, uint64_t notificationID);
+WK_EXPORT void WKNotificationManagerProviderDidClickNotification(WKNotificationManagerRef managerRef, uint64_t notificationID);
+WK_EXPORT void WKNotificationManagerProviderDidCloseNotifications(WKNotificationManagerRef managerRef, WKArrayRef notificationIDs);
+
 #ifdef __cplusplus
 }
 #endif
index 27ba62f..6fa65bb 100644 (file)
@@ -34,12 +34,18 @@ extern "C" {
 
 typedef void (*WKNotificationProviderShowCallback)(WKNotificationRef notification, const void* clientInfo);
 typedef void (*WKNotificationProviderCancelCallback)(WKNotificationRef notification, const void* clientInfo);
+typedef void (*WKNotificationProviderDidDestroyNotificationCallback)(WKNotificationRef notification, const void* clientInfo);
+typedef void (*WKNotificationProviderAddNotificationManagerCallback)(WKNotificationManagerRef manager, const void* clientInfo);
+typedef void (*WKNotificationProviderRemoveNotificationManagerCallback)(WKNotificationManagerRef manager, const void* clientInfo);
 
 struct WKNotificationProvider {
     int                                                       version;
     const void*                                               clientInfo;
     WKNotificationProviderShowCallback                        show;
     WKNotificationProviderCancelCallback                      cancel;
+    WKNotificationProviderDidDestroyNotificationCallback      didDestroyNotification;
+    WKNotificationProviderAddNotificationManagerCallback      addNotificationManager;
+    WKNotificationProviderRemoveNotificationManagerCallback   removeNotificationManager;
 };
 typedef struct WKNotificationProvider WKNotificationProvider;
 
index 1d28c14..3f02598 100644 (file)
@@ -37,9 +37,10 @@ WebNotification::WebNotification()
 {
 }
 
-WebNotification::WebNotification(const String& title, const String& body)
+WebNotification::WebNotification(const String& title, const String& body, uint64_t notificationID)
     : m_title(title)
     , m_body(body)
+    , m_notificationID(notificationID)
 {
 }
 
@@ -49,12 +50,12 @@ WebNotification::~WebNotification()
 
 void WebNotification::encode(CoreIPC::ArgumentEncoder* encoder) const
 {
-    encoder->encode(CoreIPC::In(m_title, m_body));
+    encoder->encode(CoreIPC::In(m_title, m_body, m_notificationID));
 }
 
 bool WebNotification::decode(CoreIPC::ArgumentDecoder* decoder, WebNotification& notification)
 {
-    return decoder->decode(CoreIPC::Out(notification.m_title, notification.m_body));
+    return decoder->decode(CoreIPC::Out(notification.m_title, notification.m_body, notification.m_notificationID));
 }
 
 } // namespace WebKit
index 56849df..f68586f 100644 (file)
@@ -44,28 +44,38 @@ public:
     static const Type APIType = TypeNotification;
     
     WebNotification();
-    static PassRefPtr<WebNotification> create(const String& title, const String& body)
+    static PassRefPtr<WebNotification> create(const String& title, const String& body, uint64_t notificationID)
     {
-        return adoptRef(new WebNotification(title, body));
+        return adoptRef(new WebNotification(title, body, notificationID));
     }
     virtual ~WebNotification();
     
     const String& title() const { return m_title; }
     
     const String& body() const { return m_body; }
+    
+    uint64_t notificationID() const { return m_notificationID; }
 
     void encode(CoreIPC::ArgumentEncoder*) const;
     static bool decode(CoreIPC::ArgumentDecoder*, WebNotification&);
 
 private:
-    WebNotification(const String& title, const String& body);
+    WebNotification(const String& title, const String& body, uint64_t notificationID);
 
     virtual Type type() const { return APIType; }
     
     String m_title;
     String m_body;
+    uint64_t m_notificationID;
 };
-    
+
+inline bool isNotificationIDValid(uint64_t id)
+{
+    // This check makes sure that the ID is not equal to values needed by
+    // HashMap for bucketing.
+    return id && id != static_cast<uint64_t>(-1);
+}
+
 } // namespace WebKit
 
 #endif // WebNotification_h
index c2b0cd7..9029dc4 100644 (file)
 #include "config.h"
 #include "WebNotificationManagerProxy.h"
 
+#include "ImmutableArray.h"
 #include "WebContext.h"
 #include "WebNotification.h"
+#include "WebNotificationManagerMessages.h"
 #include <WebCore/NotificationContents.h>
 
 using namespace WTF;
@@ -51,6 +53,7 @@ WebNotificationManagerProxy::~WebNotificationManagerProxy()
 
 void WebNotificationManagerProxy::invalidate()
 {
+    m_provider.removeNotificationManager(this);
 }
 
 void WebNotificationManagerProxy::initializeProvider(const WKNotificationProvider *provider)
@@ -65,13 +68,75 @@ void WebNotificationManagerProxy::didReceiveMessage(CoreIPC::Connection* connect
 
 void WebNotificationManagerProxy::show(const String& title, const String& body, uint64_t notificationID)
 {
-    RefPtr<WebNotification> notification = WebNotification::create(title, body);
+    if (!isNotificationIDValid(notificationID))
+        return;
+    
+    m_provider.addNotificationManager(this);
+
+    RefPtr<WebNotification> notification = WebNotification::create(title, body, notificationID);
+    m_notifications.set(notificationID, notification);
     m_provider.show(notification.get());
 }
 
 void WebNotificationManagerProxy::cancel(uint64_t notificationID)
 {
-    m_provider.cancel(0);
+    if (!isNotificationIDValid(notificationID))
+        return;
+
+    RefPtr<WebNotification> notification = m_notifications.get(notificationID);
+    if (!notification)
+        return;
+
+    m_provider.addNotificationManager(this);
+    m_provider.cancel(notification.get());
+}
+    
+void WebNotificationManagerProxy::didDestroyNotification(uint64_t notificationID)
+{
+    if (!isNotificationIDValid(notificationID))
+        return;
+
+    RefPtr<WebNotification> notification = m_notifications.take(notificationID);
+    if (!notification)
+        return;
+
+    m_provider.didDestroyNotification(notification.get());
+}
+
+void WebNotificationManagerProxy::providerDidShowNotification(uint64_t notificationID)
+{
+    if (!m_context)
+        return;
+    
+    m_context->sendToAllProcesses(Messages::WebNotificationManager::DidShowNotification(notificationID));
+}
+
+void WebNotificationManagerProxy::providerDidClickNotification(uint64_t notificationID)
+{
+    if (!m_context)
+        return;
+    
+    m_context->sendToAllProcesses(Messages::WebNotificationManager::DidClickNotification(notificationID));
+}
+
+
+void WebNotificationManagerProxy::providerDidCloseNotifications(ImmutableArray* notificationIDs)
+{
+    if (!m_context)
+        return;
+    
+    size_t size = notificationIDs->size();
+    
+    Vector<uint64_t> vectorNotificationIDs;
+    vectorNotificationIDs.reserveInitialCapacity(size);
+    
+    for (size_t i = 0; i < size; ++i) {
+        uint64_t notificationID = notificationIDs->at<WebUInt64>(i)->value();
+        vectorNotificationIDs.append(notificationID);
+    }
+    
+    if (vectorNotificationIDs.size())
+        m_context->sendToAllProcesses(Messages::WebNotificationManager::DidCloseNotifications(vectorNotificationIDs));
 }
 
 } // namespace WebKit
index cc779b9..587fa9a 100644 (file)
@@ -29,6 +29,7 @@
 #include "APIObject.h"
 #include "MessageID.h"
 #include "WebNotificationProvider.h"
+#include <wtf/HashMap.h>
 #include <wtf/PassRefPtr.h>
 
 namespace CoreIPC {
@@ -38,6 +39,7 @@ class Connection;
 
 namespace WebKit {
 
+class ImmutableArray;
 class WebContext;
 
 class WebNotificationManagerProxy : public APIObject {
@@ -52,6 +54,10 @@ public:
 
     void initializeProvider(const WKNotificationProvider*);
     
+    void providerDidShowNotification(uint64_t notificationID);
+    void providerDidClickNotification(uint64_t notificationID);
+    void providerDidCloseNotifications(ImmutableArray* notificationIDs);
+    
     void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
 
 private:
@@ -64,9 +70,13 @@ private:
     // Message handlers
     void show(const WTF::String& title, const WTF::String& body, uint64_t notificationID);
     void cancel(uint64_t notificationID);
+    void didDestroyNotification(uint64_t notificationID);
+    
+    typedef HashMap<uint64_t, RefPtr<WebNotification> > WebNotificationMap;
     
     WebContext* m_context;
     WebNotificationProvider m_provider;
+    WebNotificationMap m_notifications;
 };
 
 } // namespace WebKit
index e7678a4..6d403c3 100644 (file)
@@ -23,4 +23,5 @@
 messages -> WebNotificationManagerProxy {
     Show(WTF::String title, WTF::String body, uint64_t notificationID);
     Cancel(uint64_t notificationID);
+    DidDestroyNotification(uint64_t notificationID);
 }
index f7ac5e7..461b1ad 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "WKAPICast.h"
 #include "WebNotification.h"
+#include "WebNotificationManagerProxy.h"
 
 namespace WebKit {
 
@@ -47,4 +48,28 @@ void WebNotificationProvider::cancel(WebNotification* notification)
     m_client.cancel(toAPI(notification), m_client.clientInfo);
 }
 
+void WebNotificationProvider::didDestroyNotification(WebNotification* notification)
+{
+    if (!m_client.didDestroyNotification)
+        return;
+    
+    m_client.didDestroyNotification(toAPI(notification), m_client.clientInfo);
+}
+
+void WebNotificationProvider::addNotificationManager(WebNotificationManagerProxy* manager)
+{
+    if (!m_client.addNotificationManager)
+        return;
+    
+    m_client.addNotificationManager(toAPI(manager), m_client.clientInfo);
+}
+
+void WebNotificationProvider::removeNotificationManager(WebNotificationManagerProxy* manager)
+{
+    if (!m_client.removeNotificationManager)
+        return;
+    
+    m_client.removeNotificationManager(toAPI(manager), m_client.clientInfo);
+}
+
 } // namespace WebKit
index eb2bf47..ff40ba8 100644 (file)
 namespace WebKit {
 
 class WebNotification;
+class WebNotificationManagerProxy;
     
 class WebNotificationProvider : public APIClient<WKNotificationProvider, kWKNotificationProviderCurrentVersion> {
 public:
     void show(WebNotification*);
     void cancel(WebNotification*);
+    void didDestroyNotification(WebNotification*);
+
+    void addNotificationManager(WebNotificationManagerProxy*);
+    void removeNotificationManager(WebNotificationManagerProxy*);
 };
 
 } // namespace WebKit
index 953e9b0..2610125 100644 (file)
                318BE17514743DD700A8FBB2 /* WKNotificationManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 318BE17414743DD600A8FBB2 /* WKNotificationManager.cpp */; };
                318BE17714743E6000A8FBB2 /* WKNotification.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 318BE17614743E6000A8FBB2 /* WKNotification.cpp */; };
                318BE17914743E6F00A8FBB2 /* WKNotification.h in Headers */ = {isa = PBXBuildFile; fileRef = 318BE17814743E6A00A8FBB2 /* WKNotification.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               31BA924D148831260062EDB5 /* WebNotificationManagerMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31BA9248148830810062EDB5 /* WebNotificationManagerMessageReceiver.cpp */; };
+               31BA924E148831260062EDB5 /* WebNotificationManagerMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 31BA9249148830810062EDB5 /* WebNotificationManagerMessages.h */; };
                31C11AB3148452E90049A4CC /* WebNotification.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31C11AB1148452E90049A4CC /* WebNotification.cpp */; };
                31C11AB4148452E90049A4CC /* WebNotification.h in Headers */ = {isa = PBXBuildFile; fileRef = 31C11AB2148452E90049A4CC /* WebNotification.h */; };
                31EA25D2134F78C0005B1452 /* NativeWebMouseEventMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 31EA25D0134F78B2005B1452 /* NativeWebMouseEventMac.mm */; };
                318BE17414743DD600A8FBB2 /* WKNotificationManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKNotificationManager.cpp; sourceTree = "<group>"; };
                318BE17614743E6000A8FBB2 /* WKNotification.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKNotification.cpp; sourceTree = "<group>"; };
                318BE17814743E6A00A8FBB2 /* WKNotification.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKNotification.h; sourceTree = "<group>"; };
+               31BA9248148830810062EDB5 /* WebNotificationManagerMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebNotificationManagerMessageReceiver.cpp; sourceTree = "<group>"; };
+               31BA9249148830810062EDB5 /* WebNotificationManagerMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNotificationManagerMessages.h; sourceTree = "<group>"; };
                31C11AB1148452E90049A4CC /* WebNotification.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebNotification.cpp; sourceTree = "<group>"; };
                31C11AB2148452E90049A4CC /* WebNotification.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNotification.h; sourceTree = "<group>"; };
                31EA25D0134F78B2005B1452 /* NativeWebMouseEventMac.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeWebMouseEventMac.mm; sourceTree = "<group>"; };
                                33D3A3C51339617900709BE4 /* WebMediaCacheManagerMessages.h */,
                                33D3A3C61339617900709BE4 /* WebMediaCacheManagerProxyMessageReceiver.cpp */,
                                33D3A3C71339617900709BE4 /* WebMediaCacheManagerProxyMessages.h */,
+                               31BA9248148830810062EDB5 /* WebNotificationManagerMessageReceiver.cpp */,
+                               31BA9249148830810062EDB5 /* WebNotificationManagerMessages.h */,
                                318BE1651473433700A8FBB2 /* WebNotificationManagerProxyMessageReceiver.cpp */,
                                318BE1661473433700A8FBB2 /* WebNotificationManagerProxyMessages.h */,
                                C0CE729E1247E71D00BC0EC4 /* WebPageMessageReceiver.cpp */,
                                318BE17114743DB100A8FBB2 /* WKNotificationManager.h in Headers */,
                                318BE17914743E6F00A8FBB2 /* WKNotification.h in Headers */,
                                31C11AB4148452E90049A4CC /* WebNotification.h in Headers */,
+                               31BA924E148831260062EDB5 /* WebNotificationManagerMessages.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                318BE17514743DD700A8FBB2 /* WKNotificationManager.cpp in Sources */,
                                318BE17714743E6000A8FBB2 /* WKNotification.cpp in Sources */,
                                31C11AB3148452E90049A4CC /* WebNotification.cpp in Sources */,
+                               31BA924D148831260062EDB5 /* WebNotificationManagerMessageReceiver.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index a4d6bf0..6c262cf 100644 (file)
 using namespace WebCore;
 
 namespace WebKit {
-    
+
+#if ENABLE(NOTIFICATIONS)
+static uint64_t generateNotificationID()
+{
+    static uint64_t uniqueNotificationID = 1;
+    return uniqueNotificationID++;
+}
+#endif
+
 WebNotificationManager::WebNotificationManager(WebProcess* process)
     : m_process(process)
 {
@@ -47,10 +55,22 @@ WebNotificationManager::~WebNotificationManager()
 {
 }
 
+void WebNotificationManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+{
+    didReceiveWebNotificationManagerMessage(connection, messageID, arguments);
+}
+
 bool WebNotificationManager::show(Notification* notification, WebPage* page)
 {
 #if ENABLE(NOTIFICATIONS)
-    m_process->connection()->send(Messages::WebNotificationManagerProxy::Show(notification->contents().title, notification->contents().body, 0), page->pageID());
+    if (!notification)
+        return true;
+    
+    uint64_t notificationID = generateNotificationID();
+    m_notificationMap.set(notification, notificationID);
+    m_notificationIDMap.set(notificationID, notification);
+    
+    m_process->connection()->send(Messages::WebNotificationManagerProxy::Show(notification->contents().title, notification->contents().body, notificationID), page->pageID());
 #endif
     return true;
 }
@@ -58,7 +78,72 @@ bool WebNotificationManager::show(Notification* notification, WebPage* page)
 void WebNotificationManager::cancel(Notification* notification, WebPage* page)
 {
 #if ENABLE(NOTIFICATIONS)
-    m_process->connection()->send(Messages::WebNotificationManagerProxy::Cancel(0), page->pageID());
+    if (!notification)
+        return;
+    
+    uint64_t notificationID = m_notificationMap.get(notification);
+    if (!notificationID)
+        return;
+    
+    m_process->connection()->send(Messages::WebNotificationManagerProxy::Cancel(notificationID), page->pageID());
+#endif
+}
+
+void WebNotificationManager::didDestroyNotification(Notification* notification, WebPage* page)
+{
+#if ENABLE(NOTIFICATIONS)
+    uint64_t notificationID = m_notificationMap.take(notification);
+    if (!notificationID)
+        return;
+
+    m_notificationIDMap.take(notificationID);
+    m_process->connection()->send(Messages::WebNotificationManagerProxy::DidDestroyNotification(notificationID), page->pageID());
+#endif
+}
+
+void WebNotificationManager::didShowNotification(uint64_t notificationID)
+{
+#if ENABLE(NOTIFICATIONS)
+    if (!isNotificationIDValid(notificationID))
+        return;
+    
+    RefPtr<Notification> notification = m_notificationIDMap.get(notificationID);
+    if (!notification)
+        return;
+
+    notification->dispatchShowEvent();
+#endif
+}
+
+void WebNotificationManager::didClickNotification(uint64_t notificationID)
+{
+#if ENABLE(NOTIFICATIONS)
+    if (!isNotificationIDValid(notificationID))
+        return;
+
+    RefPtr<Notification> notification = m_notificationIDMap.get(notificationID);
+    if (!notification)
+        return;
+
+    notification->dispatchClickEvent();
+#endif
+}
+
+void WebNotificationManager::didCloseNotifications(const Vector<uint64_t>& notificationIDs)
+{
+#if ENABLE(NOTIFICATIONS)
+    size_t count = notificationIDs.size();
+    for (size_t i = 0; i < count; ++i) {
+        uint64_t notificationID = notificationIDs[i];
+        if (!isNotificationIDValid(notificationID))
+            continue;
+
+        RefPtr<Notification> notification = m_notificationIDMap.get(notificationID);
+        if (!notification)
+            continue;
+
+        notification->dispatchCloseEvent();
+    }
 #endif
 }
 
index 0033ae3..07cfafc 100644 (file)
 #ifndef WebNotificationManager_h
 #define WebNotificationManager_h
 
+#include "MessageID.h"
+#include <wtf/HashMap.h>
 #include <wtf/Noncopyable.h>
+#include <wtf/RefPtr.h>
+#include <wtf/Vector.h>
+
+namespace CoreIPC {
+class ArgumentDecoder;
+class Connection;
+}
 
 namespace WebCore {
 class Notification;    
-} // namespace WebCore
+}
 
 namespace WebKit {
 
@@ -45,9 +54,28 @@ public:
 
     bool show(WebCore::Notification*, WebPage*);
     void cancel(WebCore::Notification*, WebPage*);
+    // This callback comes from WebCore, not messaged from the UI process.
+    void didDestroyNotification(WebCore::Notification*, WebPage*);
+
+    void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
 
 private:
+    // Implemented in generated WebNotificationManagerMessageReceiver.cpp
+    void didReceiveWebNotificationManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+    
+    void didShowNotification(uint64_t notificationID);
+    void didClickNotification(uint64_t notificationID);
+    void didCloseNotifications(const Vector<uint64_t>& notificationIDs);
+
     WebProcess* m_process;
+
+#if ENABLE(NOTIFICATIONS)
+    typedef HashMap<RefPtr<WebCore::Notification>, uint64_t> NotificationMap;
+    NotificationMap m_notificationMap;
+    
+    typedef HashMap<uint64_t, RefPtr<WebCore::Notification> > NotificationIDMap;
+    NotificationIDMap m_notificationIDMap;
+#endif
 };
 
 } // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.messages.in b/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.messages.in
new file mode 100644 (file)
index 0000000..13d97ff
--- /dev/null
@@ -0,0 +1,27 @@
+# Copyright (C) 2011 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1.  Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+# 2.  Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in the
+#     documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+messages -> WebNotificationManager {
+    DidShowNotification(uint64_t notificationID);
+    DidClickNotification(uint64_t notificationID);
+    DidCloseNotifications(Vector<uint64_t> notificationIDs);
+}
index 05717ff..f1848bd 100644 (file)
@@ -64,9 +64,14 @@ void WebNotificationClient::cancel(Notification* notification)
 #endif
 }
 
-void WebNotificationClient::notificationObjectDestroyed(Notification*)
+void WebNotificationClient::notificationObjectDestroyed(Notification* notification)
 {
+#if ENABLE(NOTIFICATIONS)
+    WebProcess::shared().notificationManager().didDestroyNotification(notification, m_page);
+#else
+    UNUSED_PARAM(notification);
     notImplemented();
+#endif
 }
 
 void WebNotificationClient::requestPermission(ScriptExecutionContext*, PassRefPtr<VoidCallback>)
index 2790932..0681a27 100644 (file)
@@ -638,6 +638,13 @@ void WebProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::Mes
         return;
     }
 
+#if ENABLE(NOTIFICATIONS)
+    if (messageID.is<CoreIPC::MessageClassWebNotificationManager>()) {
+        m_notificationManager.didReceiveMessage(connection, messageID, arguments);
+        return;
+    }
+#endif
+    
     if (messageID.is<CoreIPC::MessageClassWebResourceCacheManager>()) {
         WebResourceCacheManager::shared().didReceiveMessage(connection, messageID, arguments);
         return;
index dc64624..5566b61 100755 (executable)
                                        RelativePath="..\WebProcess\Notifications\WebNotificationManager.h"
                                        >
                                </File>
+                               <File
+                                       RelativePath="..\WebProcess\Notifications\WebNotificationManager.messages.in"
+                                       >
+                               </File>
                        </Filter>
                </Filter>
                <Filter
                                >
                        </File>
                        <File
+                               RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebNotificationManagerMessageReceiver.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebNotificationManagerMessages.h"
+                               >
+                       </File>
+                       <File
                                RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebNotificationManagerProxyMessageReceiver.cpp"
                                >
                        </File>
index 12324b7..cc14afd 100755 (executable)
@@ -6,7 +6,7 @@
        >
        <Tool
                Name="VCCLCompilerTool"
-               AdditionalIncludeDirectories="&quot;$(ProjectDir)&quot;;&quot;$(ProjectDir)\..&quot;;&quot;$(ProjectDir)\..\Platform&quot;;&quot;$(ProjectDir)\..\Platform\cg&quot;;&quot;$(ProjectDir)\..\Platform\CoreIPC&quot;;&quot;$(ProjectDir)\..\PluginProcess&quot;;&quot;$(ProjectDir)\..\Shared&quot;;&quot;$(ProjectDir)\..\Shared\win&quot;;&quot;$(ProjectDir)\..\Shared\cf&quot;;&quot;$(ProjectDir)\..\Shared\API\c&quot;;&quot;$(ProjectDir)\..\Shared\API\c\cf&quot;;&quot;$(ProjectDir)\..\Shared\API\c\win&quot;;&quot;$(ProjectDir)\..\Shared\CoreIPCSupport&quot;;&quot;$(ProjectDir)\..\Shared\Plugins&quot;;&quot;$(ProjectDir)\..\Shared\Plugins\Netscape&quot;;&quot;$(ProjectDir)\..\UIProcess&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C\win&quot;;&quot;$(ProjectDir)\..\UIProcess\API\cpp&quot;;&quot;$(ProjectDir)\..\UIProcess\API\win&quot;;&quot;$(ProjectDir)\..\UIProcess\Authentication&quot;;&quot;$(ProjectDir)\..\UIProcess\Downloads&quot;;&quot;$(ProjectDir)\..\UIProcess\Launcher&quot;;&quot;$(ProjectDir)\..\UIProcess\Plugins&quot;;&quot;$(ProjectDir)\..\UIProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport\win&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage\win&quot;;&quot;$(ProjectDir)\..\WebProcess\IconDatabase&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\API\c&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\DOM&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\win&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins\Netscape&quot;;&quot;$(ProjectDir)\..\WebProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess\ApplicationCache&quot;;&quot;$(ProjectDir)\..\WebProcess\Authentication&quot;;&quot;$(ProjectDir)\..\WebProcess\Cookies&quot;;&quot;$(ProjectDir)\..\WebProcess\Cookies\cf&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads\cf&quot;;&quot;$(ProjectDir)\..\WebProcess\FullScreen&quot;;&quot;$(ProjectDir)\..\WebProcess\Geolocation&quot;;&quot;$(ProjectDir)\..\WebProcess\KeyValueStorage&quot;;&quot;$(ProjectDir)\..\WebProcess\MediaCache&quot;;&quot;$(ProjectDir)\..\WebProcess\ResourceCache&quot;;&quot;$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources&quot;;&quot;$(ConfigurationBuildDir)\Include&quot;;&quot;$(ConfigurationBuildDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include\pthreads&quot;;&quot;$(ConfigurationBuildDir)\Include\JavaScriptCore&quot;;&quot;$(ConfigurationBuildDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\private\JavaScriptCore&quot;;&quot;$(ConfigurationBuildDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;"
+               AdditionalIncludeDirectories="&quot;$(ProjectDir)&quot;;&quot;$(ProjectDir)\..&quot;;&quot;$(ProjectDir)\..\Platform&quot;;&quot;$(ProjectDir)\..\Platform\cg&quot;;&quot;$(ProjectDir)\..\Platform\CoreIPC&quot;;&quot;$(ProjectDir)\..\PluginProcess&quot;;&quot;$(ProjectDir)\..\Shared&quot;;&quot;$(ProjectDir)\..\Shared\win&quot;;&quot;$(ProjectDir)\..\Shared\cf&quot;;&quot;$(ProjectDir)\..\Shared\API\c&quot;;&quot;$(ProjectDir)\..\Shared\API\c\cf&quot;;&quot;$(ProjectDir)\..\Shared\API\c\win&quot;;&quot;$(ProjectDir)\..\Shared\CoreIPCSupport&quot;;&quot;$(ProjectDir)\..\Shared\Plugins&quot;;&quot;$(ProjectDir)\..\Shared\Plugins\Netscape&quot;;&quot;$(ProjectDir)\..\UIProcess&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C\win&quot;;&quot;$(ProjectDir)\..\UIProcess\API\cpp&quot;;&quot;$(ProjectDir)\..\UIProcess\API\win&quot;;&quot;$(ProjectDir)\..\UIProcess\Authentication&quot;;&quot;$(ProjectDir)\..\UIProcess\Downloads&quot;;&quot;$(ProjectDir)\..\UIProcess\Launcher&quot;;&quot;$(ProjectDir)\..\UIProcess\Plugins&quot;;&quot;$(ProjectDir)\..\UIProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport\win&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage\win&quot;;&quot;$(ProjectDir)\..\WebProcess\IconDatabase&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\API\c&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\DOM&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\win&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins\Netscape&quot;;&quot;$(ProjectDir)\..\WebProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess\ApplicationCache&quot;;&quot;$(ProjectDir)\..\WebProcess\Authentication&quot;;&quot;$(ProjectDir)\..\WebProcess\Cookies&quot;;&quot;$(ProjectDir)\..\WebProcess\Cookies\cf&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads\cf&quot;;&quot;$(ProjectDir)\..\WebProcess\FullScreen&quot;;&quot;$(ProjectDir)\..\WebProcess\Geolocation&quot;;&quot;$(ProjectDir)\..\WebProcess\KeyValueStorage&quot;;&quot;$(ProjectDir)\..\WebProcess\MediaCache&quot;;&quot;$(ProjectDir)\..\WebProcess\Notifications&quot;;&quot;$(ProjectDir)\..\WebProcess\ResourceCache&quot;;&quot;$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources&quot;;&quot;$(ConfigurationBuildDir)\Include&quot;;&quot;$(ConfigurationBuildDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include\pthreads&quot;;&quot;$(ConfigurationBuildDir)\Include\JavaScriptCore&quot;;&quot;$(ConfigurationBuildDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\private\JavaScriptCore&quot;;&quot;$(ConfigurationBuildDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;"
                PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;FRAMEWORK_NAME=WebKit;BUILDING_WEBKIT"
                UsePrecompiledHeader="2"
                PrecompiledHeaderThrough="WebKit2Prefix.h"