Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1028)

Unified Diff: Source/modules/notifications/Notification.h

Issue 993893002: Add the data attribute to the Notification object (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix layout test failures. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/modules/notifications/Notification.h
diff --git a/Source/modules/notifications/Notification.h b/Source/modules/notifications/Notification.h
index 4074afbeba9fe6eeb0739c61ab33505b0d1f502c..1f780a0a9bfdd265eb3e0c2c89bc3e0ed2ae1cb6 100644
--- a/Source/modules/notifications/Notification.h
+++ b/Source/modules/notifications/Notification.h
@@ -31,6 +31,7 @@
#ifndef Notification_h
#define Notification_h
+#include "bindings/core/v8/SerializedScriptValue.h"
#include "core/dom/ActiveDOMObject.h"
#include "modules/EventTargetModules.h"
#include "platform/AsyncMethodRunner.h"
@@ -40,13 +41,17 @@
#include "public/platform/modules/notifications/WebNotificationDelegate.h"
#include "public/platform/modules/notifications/WebNotificationPermission.h"
#include "wtf/PassOwnPtr.h"
+#include "wtf/PassRefPtr.h"
#include "wtf/RefCounted.h"
+#include "wtf/RefPtr.h"
namespace blink {
class ExecutionContext;
class NotificationOptions;
class NotificationPermissionCallback;
+class ScriptState;
+class ScriptValue;
struct WebNotificationData;
class Notification final : public RefCountedGarbageCollectedEventTargetWithInlineData<Notification>, public ActiveDOMObject, public WebNotificationDelegate {
@@ -83,9 +88,11 @@ public:
String tag() const { return m_tag; }
String icon() const { return m_iconUrl; }
bool silent() const { return m_silent; }
+ ScriptValue data(ScriptState*) const;
TextDirection direction() const;
KURL iconURL() const { return m_iconUrl; }
+ SerializedScriptValue* serializedData() const { return m_serializedData.get(); }
static String permissionString(WebNotificationPermission);
static String permission(ExecutionContext*);
@@ -121,6 +128,7 @@ private:
void setIconUrl(KURL iconUrl) { m_iconUrl = iconUrl; }
void setTag(const String& tag) { m_tag = tag; }
void setSilent(bool silent) { m_silent = silent; }
+ void setSerializedData(PassRefPtr<SerializedScriptValue> data) { m_serializedData = data; }
void setPersistentId(const String& persistentId) { m_persistentId = persistentId; }
@@ -131,6 +139,7 @@ private:
String m_body;
String m_tag;
bool m_silent;
+ RefPtr<SerializedScriptValue> m_serializedData;
KURL m_iconUrl;

Powered by Google App Engine
This is Rietveld 408576698