Title: [208977] trunk/Source/WebKit2
Revision
208977
Author
[email protected]
Date
2016-11-25 10:38:15 -0800 (Fri, 25 Nov 2016)

Log Message

[GTK] Follow-up fixes to r208974
https://bugs.webkit.org/show_bug.cgi?id=164771

Unreviewed, implement Carlos's review feedback.

* UIProcess/API/gtk/WebKitNotification.cpp:
(webkit_notification_get_tag):
* UIProcess/API/gtk/WebKitNotificationProvider.cpp:
(WebKitNotificationProvider::withdrawAnyPreviousNotificationMatchingTag):
(WebKitNotificationProvider::show):
* UIProcess/API/gtk/WebKitNotificationProvider.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (208976 => 208977)


--- trunk/Source/WebKit2/ChangeLog	2016-11-25 17:35:06 UTC (rev 208976)
+++ trunk/Source/WebKit2/ChangeLog	2016-11-25 18:38:15 UTC (rev 208977)
@@ -1,3 +1,17 @@
+2016-11-25  Michael Catanzaro  <[email protected]>
+
+        [GTK] Follow-up fixes to r208974
+        https://bugs.webkit.org/show_bug.cgi?id=164771
+
+        Unreviewed, implement Carlos's review feedback.
+
+        * UIProcess/API/gtk/WebKitNotification.cpp:
+        (webkit_notification_get_tag):
+        * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
+        (WebKitNotificationProvider::withdrawAnyPreviousNotificationMatchingTag):
+        (WebKitNotificationProvider::show):
+        * UIProcess/API/gtk/WebKitNotificationProvider.h:
+
 2016-11-24  Michael Catanzaro  <[email protected]>
 
         [GTK] Notifications API does not expose or respect the "tag" attribute

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotification.cpp (208976 => 208977)


--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotification.cpp	2016-11-25 17:35:06 UTC (rev 208976)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotification.cpp	2016-11-25 18:38:15 UTC (rev 208977)
@@ -272,7 +272,7 @@
     g_return_val_if_fail(WEBKIT_IS_NOTIFICATION(notification), nullptr);
 
     const gchar* tag = notification->priv->tag.data();
-    return strlen(tag) > 0 ? tag : nullptr;
+    return notification->priv->tag.length() ? tag : nullptr;
 }
 
 /**

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotificationProvider.cpp (208976 => 208977)


--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotificationProvider.cpp	2016-11-25 17:35:06 UTC (rev 208976)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotificationProvider.cpp	2016-11-25 18:38:15 UTC (rev 208977)
@@ -102,9 +102,9 @@
     provider->m_notificationManager->providerDidClickNotification(webkit_notification_get_id(notification));
 }
 
-void WebKitNotificationProvider::withdrawAnyPreviousNotificationMatchingTag(const String& tag)
+void WebKitNotificationProvider::withdrawAnyPreviousNotificationMatchingTag(const CString& tag)
 {
-    if (tag.isEmpty())
+    if (!tag.length())
         return;
 
     for (auto& notification : m_notifications.values()) {
@@ -125,7 +125,7 @@
     GRefPtr<WebKitNotification> notification = m_notifications.get(webNotification.notificationID());
 
     if (!notification) {
-        withdrawAnyPreviousNotificationMatchingTag(webNotification.tag());
+        withdrawAnyPreviousNotificationMatchingTag(webNotification.tag().utf8());
         notification = adoptGRef(webkitNotificationCreate(WEBKIT_WEB_VIEW(page->viewWidget()), webNotification));
         g_signal_connect(notification.get(), "closed", G_CALLBACK(notificationCloseCallback), this);
         g_signal_connect(notification.get(), "clicked", G_CALLBACK(notificationClickedCallback), this);

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotificationProvider.h (208976 => 208977)


--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotificationProvider.h	2016-11-25 17:35:06 UTC (rev 208976)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitNotificationProvider.h	2016-11-25 18:38:15 UTC (rev 208977)
@@ -48,7 +48,7 @@
     static void notificationCloseCallback(WebKitNotification*, WebKitNotificationProvider*);
     static void notificationClickedCallback(WebKitNotification*, WebKitNotificationProvider*);
 
-    void withdrawAnyPreviousNotificationMatchingTag(const String&);
+    void withdrawAnyPreviousNotificationMatchingTag(const CString&);
 
     RefPtr<WebNotificationManagerProxy> m_notificationManager;
     HashMap<uint64_t, GRefPtr<WebKitNotification>> m_notifications;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to