Diff
Modified: trunk/Source/WebKit/mac/ChangeLog (109765 => 109766)
--- trunk/Source/WebKit/mac/ChangeLog 2012-03-05 18:26:26 UTC (rev 109765)
+++ trunk/Source/WebKit/mac/ChangeLog 2012-03-05 18:34:14 UTC (rev 109766)
@@ -1,3 +1,15 @@
+2012-03-02 Jon Lee <jon...@apple.com>
+
+ Add support for notification replaceId in Mac WebKit and WK2
+ https://bugs.webkit.org/show_bug.cgi?id=80206
+ <rdar://problem/10965574>
+
+ Reviewed by Sam Weinig.
+
+ * WebView/WebNotification.h: Add replaceID method.
+ * WebView/WebNotification.mm:
+ (-[WebNotification replaceID]):
+
2012-03-05 Adam Barth <aba...@webkit.org>
Geolocation should use a ScriptExecutionContext as its context object
Modified: trunk/Source/WebKit/mac/WebView/WebNotification.h (109765 => 109766)
--- trunk/Source/WebKit/mac/WebView/WebNotification.h 2012-03-05 18:26:26 UTC (rev 109765)
+++ trunk/Source/WebKit/mac/WebView/WebNotification.h 2012-03-05 18:34:14 UTC (rev 109766)
@@ -36,6 +36,7 @@
- (NSString *)title;
- (NSString *)body;
+- (NSString *)replaceID;
- (WebSecurityOrigin *)origin;
- (uint64_t)notificationID;
Modified: trunk/Source/WebKit/mac/WebView/WebNotification.mm (109765 => 109766)
--- trunk/Source/WebKit/mac/WebView/WebNotification.mm 2012-03-05 18:26:26 UTC (rev 109765)
+++ trunk/Source/WebKit/mac/WebView/WebNotification.mm 2012-03-05 18:34:14 UTC (rev 109766)
@@ -101,6 +101,16 @@
#endif
}
+- (NSString *)replaceID
+{
+#if ENABLE(NOTIFICATIONS)
+ ASSERT(core(self));
+ return core(self)->replaceId();
+#else
+ return nil;
+#endif
+}
+
- (WebSecurityOrigin *)origin
{
#if ENABLE(NOTIFICATIONS)
Modified: trunk/Source/WebKit2/ChangeLog (109765 => 109766)
--- trunk/Source/WebKit2/ChangeLog 2012-03-05 18:26:26 UTC (rev 109765)
+++ trunk/Source/WebKit2/ChangeLog 2012-03-05 18:34:14 UTC (rev 109766)
@@ -1,3 +1,32 @@
+2012-03-02 Jon Lee <jon...@apple.com>
+
+ Add support for notification replaceId in Mac WebKit and WK2
+ https://bugs.webkit.org/show_bug.cgi?id=80206
+ <rdar://problem/10965574>
+
+ Reviewed by Sam Weinig.
+
+ * UIProcess/API/C/WKNotification.cpp: Add WK API.
+ (WKNotificationCopyReplaceID):
+ * UIProcess/API/C/WKNotification.h:
+ * UIProcess/Notifications/WebNotification.cpp:
+ (WebKit::WebNotification::WebNotification):
+ * UIProcess/Notifications/WebNotification.h: Add replaceID member.
+ (WebKit::WebNotification::create):
+ (WebKit::WebNotification::replaceID):
+ (WebNotification):
+ * UIProcess/Notifications/WebNotificationManagerProxy.cpp:
+ (WebKit::WebNotificationManagerProxy::show):
+ * UIProcess/Notifications/WebNotificationManagerProxy.h:
+ (WebNotificationManagerProxy):
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::showNotification):
+ * UIProcess/WebPageProxy.h:
+ (WebPageProxy):
+ * UIProcess/WebPageProxy.messages.in: Add replaceID to the showNotification message.
+ * WebProcess/Notifications/WebNotificationManager.cpp:
+ (WebKit::WebNotificationManager::show):
+
2012-03-05 Sheriff Bot <webkit.review....@gmail.com>
Unreviewed, rolling out r109748.
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKNotification.cpp (109765 => 109766)
--- trunk/Source/WebKit2/UIProcess/API/C/WKNotification.cpp 2012-03-05 18:26:26 UTC (rev 109765)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKNotification.cpp 2012-03-05 18:34:14 UTC (rev 109766)
@@ -52,6 +52,11 @@
return toCopiedAPI(toImpl(notification)->iconURL());
}
+WKStringRef WKNotificationCopyReplaceID(WKNotificationRef notification)
+{
+ return toCopiedAPI(toImpl(notification)->replaceID());
+}
+
WKSecurityOriginRef WKNotificationGetSecurityOrigin(WKNotificationRef notification)
{
return toAPI(toImpl(notification)->origin());
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKNotification.h (109765 => 109766)
--- trunk/Source/WebKit2/UIProcess/API/C/WKNotification.h 2012-03-05 18:26:26 UTC (rev 109765)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKNotification.h 2012-03-05 18:34:14 UTC (rev 109766)
@@ -37,6 +37,7 @@
WK_EXPORT WKStringRef WKNotificationCopyTitle(WKNotificationRef notification);
WK_EXPORT WKStringRef WKNotificationCopyBody(WKNotificationRef notification);
WK_EXPORT WKStringRef WKNotificationCopyIconURL(WKNotificationRef notification);
+WK_EXPORT WKStringRef WKNotificationCopyReplaceID(WKNotificationRef notification);
WK_EXPORT WKSecurityOriginRef WKNotificationGetSecurityOrigin(WKNotificationRef notification);
WK_EXPORT uint64_t WKNotificationGetID(WKNotificationRef notification);
Modified: trunk/Source/WebKit2/UIProcess/Notifications/WebNotification.cpp (109765 => 109766)
--- trunk/Source/WebKit2/UIProcess/Notifications/WebNotification.cpp 2012-03-05 18:26:26 UTC (rev 109765)
+++ trunk/Source/WebKit2/UIProcess/Notifications/WebNotification.cpp 2012-03-05 18:34:14 UTC (rev 109766)
@@ -33,10 +33,11 @@
namespace WebKit {
-WebNotification::WebNotification(const String& title, const String& body, const String& iconURL, const String& originString, uint64_t notificationID)
+WebNotification::WebNotification(const String& title, const String& body, const String& iconURL, const String& replaceID, const String& originString, uint64_t notificationID)
: m_title(title)
, m_body(body)
, m_iconURL(iconURL)
+ , m_replaceID(replaceID)
, m_origin(WebSecurityOrigin::createFromString(originString))
, m_notificationID(notificationID)
{
Modified: trunk/Source/WebKit2/UIProcess/Notifications/WebNotification.h (109765 => 109766)
--- trunk/Source/WebKit2/UIProcess/Notifications/WebNotification.h 2012-03-05 18:26:26 UTC (rev 109765)
+++ trunk/Source/WebKit2/UIProcess/Notifications/WebNotification.h 2012-03-05 18:34:14 UTC (rev 109766)
@@ -45,26 +45,28 @@
public:
static const Type APIType = TypeNotification;
- static PassRefPtr<WebNotification> create(const String& title, const String& body, const String& iconURL, const String& originString, uint64_t notificationID)
+ static PassRefPtr<WebNotification> create(const String& title, const String& body, const String& iconURL, const String& replaceID, const String& originString, uint64_t notificationID)
{
- return adoptRef(new WebNotification(title, body, iconURL, originString, notificationID));
+ return adoptRef(new WebNotification(title, body, iconURL, replaceID, originString, notificationID));
}
const String& title() const { return m_title; }
const String& body() const { return m_body; }
const String& iconURL() const { return m_iconURL; }
+ const String& replaceID() const { return m_replaceID; }
WebSecurityOrigin* origin() const { return m_origin.get(); }
uint64_t notificationID() const { return m_notificationID; }
private:
- WebNotification(const String& title, const String& body, const String& iconURL, const String& originString, uint64_t notificationID);
+ WebNotification(const String& title, const String& body, const String& iconURL, const String& replaceID, const String& originString, uint64_t notificationID);
virtual Type type() const { return APIType; }
String m_title;
String m_body;
String m_iconURL;
+ String m_replaceID;
RefPtr<WebSecurityOrigin> m_origin;
uint64_t m_notificationID;
};
Modified: trunk/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp (109765 => 109766)
--- trunk/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp 2012-03-05 18:26:26 UTC (rev 109765)
+++ trunk/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp 2012-03-05 18:34:14 UTC (rev 109766)
@@ -77,12 +77,12 @@
didReceiveWebNotificationManagerProxyMessage(connection, messageID, arguments);
}
-void WebNotificationManagerProxy::show(WebPageProxy* page, const String& title, const String& body, const String& iconURL, const String& originString, uint64_t notificationID)
+void WebNotificationManagerProxy::show(WebPageProxy* page, const String& title, const String& body, const String& iconURL, const String& replaceID, const String& originString, uint64_t notificationID)
{
if (!isNotificationIDValid(notificationID))
return;
- RefPtr<WebNotification> notification = WebNotification::create(title, body, iconURL, originString, notificationID);
+ RefPtr<WebNotification> notification = WebNotification::create(title, body, iconURL, replaceID, originString, notificationID);
m_notifications.set(notificationID, notification);
m_provider.show(page, notification.get());
}
Modified: trunk/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.h (109765 => 109766)
--- trunk/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.h 2012-03-05 18:26:26 UTC (rev 109765)
+++ trunk/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.h 2012-03-05 18:34:14 UTC (rev 109766)
@@ -60,7 +60,7 @@
void initializeProvider(const WKNotificationProvider*);
void populateCopyOfNotificationPermissions(HashMap<String, bool>&);
- void show(WebPageProxy*, const String& title, const String& body, const String& iconURL, const String& originString, uint64_t notificationID);
+ void show(WebPageProxy*, const String& title, const String& body, const String& iconURL, const String& replaceID, const String& originString, uint64_t notificationID);
void providerDidShowNotification(uint64_t notificationID);
void providerDidClickNotification(uint64_t notificationID);
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (109765 => 109766)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2012-03-05 18:26:26 UTC (rev 109765)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2012-03-05 18:34:14 UTC (rev 109766)
@@ -3419,9 +3419,9 @@
request->deny();
}
-void WebPageProxy::showNotification(const String& title, const String& body, const String& iconURL, const String& originString, uint64_t notificationID)
+void WebPageProxy::showNotification(const String& title, const String& body, const String& iconURL, const String& replaceID, const String& originString, uint64_t notificationID)
{
- m_process->context()->notificationManagerProxy()->show(this, title, body, iconURL, originString, notificationID);
+ m_process->context()->notificationManagerProxy()->show(this, title, body, iconURL, replaceID, originString, notificationID);
}
float WebPageProxy::headerHeight(WebFrameProxy* frame)
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (109765 => 109766)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2012-03-05 18:26:26 UTC (rev 109765)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2012-03-05 18:34:14 UTC (rev 109766)
@@ -730,7 +730,7 @@
void reattachToWebProcessWithItem(WebBackForwardListItem*);
void requestNotificationPermission(uint64_t notificationID, const String& originString);
- void showNotification(const String& title, const String& body, const String& iconURL, const String& originString, uint64_t notificationID);
+ void showNotification(const String& title, const String& body, const String& iconURL, const String& replaceID, const String& originString, uint64_t notificationID);
#if USE(TILED_BACKING_STORE)
void pageDidRequestScroll(const WebCore::IntPoint&);
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (109765 => 109766)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in 2012-03-05 18:26:26 UTC (rev 109765)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in 2012-03-05 18:34:14 UTC (rev 109766)
@@ -208,7 +208,7 @@
# Notification messages
RequestNotificationPermission(uint64_t requestID, WTF::String originIdentifier)
- ShowNotification(WTF::String title, WTF::String body, WTF::String iconURL, WTF::String originIdentifier, uint64_t notificationID)
+ ShowNotification(WTF::String title, WTF::String body, WTF::String iconURL, WTF::String replaceID, WTF::String originIdentifier, uint64_t notificationID)
# Spelling and grammar messages
#if USE(UNIFIED_TEXT_CHECKING)
Modified: trunk/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp (109765 => 109766)
--- trunk/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp 2012-03-05 18:26:26 UTC (rev 109765)
+++ trunk/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp 2012-03-05 18:34:14 UTC (rev 109766)
@@ -117,7 +117,7 @@
NotificationContextMap::iterator it = m_notificationContextMap.add(notification->scriptExecutionContext(), Vector<uint64_t>()).first;
it->second.append(notificationID);
- m_process->connection()->send(Messages::WebPageProxy::ShowNotification(notification->contents().title, notification->contents().body, notification->iconURL().string(), notification->scriptExecutionContext()->securityOrigin()->toString(), notificationID), page->pageID());
+ m_process->connection()->send(Messages::WebPageProxy::ShowNotification(notification->contents().title, notification->contents().body, notification->iconURL().string(), notification->replaceId(), notification->scriptExecutionContext()->securityOrigin()->toString(), notificationID), page->pageID());
return true;
#else
return false;