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

Unified Diff: Source/bindings/modules/v8/custom/V8NotificationCustom.cpp

Issue 993893002: Add the data attribute to the Notification object (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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/bindings/modules/v8/custom/V8NotificationCustom.cpp
diff --git a/Source/bindings/modules/v8/custom/V8NotificationCustom.cpp b/Source/bindings/modules/v8/custom/V8NotificationCustom.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..4597f8c5b4ec546f342fafa44e0664b593fe4eb1
--- /dev/null
+++ b/Source/bindings/modules/v8/custom/V8NotificationCustom.cpp
@@ -0,0 +1,25 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "bindings/modules/v8/V8Notification.h"
+
+#include "bindings/core/v8/SerializedScriptValue.h"
Peter Beverloo 2015/03/12 01:16:26 nit: you can drop this include
Sanghyun Park 2015/03/12 02:58:47 I'll remove this.
+#include "modules/notifications/Notification.h"
+
+namespace blink {
+
+void V8Notification::dataAttributeGetterCustom(const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+ v8::Local<v8::Object> holder = info.Holder();
+ Notification* impl = V8Notification::toImpl(holder);
+ if (!impl->data()) {
+ v8SetReturnValueNull(info);
+ return;
+ }
+
+ v8SetReturnValue(info, impl->data()->deserialize(info.GetIsolate()));
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698