Chromium Code Reviews| Index: Source/modules/notifications/Notification.cpp |
| diff --git a/Source/modules/notifications/Notification.cpp b/Source/modules/notifications/Notification.cpp |
| index 89fe61c4ffa0bb89b62a3e2a24cea916ee94f0f0..c01b82e7240113ce42649f326d1132e61d6ed9d9 100644 |
| --- a/Source/modules/notifications/Notification.cpp |
| +++ b/Source/modules/notifications/Notification.cpp |
| @@ -48,6 +48,7 @@ |
| #include "platform/UserGestureIndicator.h" |
| #include "public/platform/Platform.h" |
| #include "public/platform/WebSerializedOrigin.h" |
| +#include "public/platform/WebString.h" |
| #include "public/platform/modules/notifications/WebNotificationData.h" |
| #include "public/platform/modules/notifications/WebNotificationManager.h" |
| @@ -121,6 +122,11 @@ Notification* Notification::create(ExecutionContext* context, const String& pers |
| if (!data.icon.isEmpty()) |
| notification->setIconUrl(data.icon); |
| + if (!data.dataAsWireString.isEmpty()) { |
| + notification->setSerializedData(SerializedScriptValueFactory::instance().createFromWire(data.dataAsWireString)); |
| + notification->serializedData()->registerMemoryAllocatedWithCurrentScriptContext(); |
| + } |
| + |
| notification->setState(NotificationStateShowing); |
| notification->suspendIfNeeded(); |
| return notification; |
| @@ -162,7 +168,10 @@ void Notification::show() |
| // FIXME: Do CSP checks on the associated notification icon. |
| WebNotificationData::Direction dir = m_dir == "rtl" ? WebNotificationData::DirectionRightToLeft : WebNotificationData::DirectionLeftToRight; |
| - WebNotificationData notificationData(m_title, dir, m_lang, m_body, m_tag, m_iconUrl, m_silent); |
| + |
| + // No send data property in non-persistent notification. |
|
Peter Beverloo
2015/03/15 16:25:05
It would be good to have a more helpful comment he
Sanghyun Park
2015/03/15 17:45:05
Okay, I will add this comment. :)
|
| + String emptyDataAsWireString; |
| + WebNotificationData notificationData(m_title, dir, m_lang, m_body, m_tag, m_iconUrl, m_silent, emptyDataAsWireString); |
| notificationManager()->show(WebSerializedOrigin(*origin), notificationData, this); |
| m_state = NotificationStateShowing; |