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..9c109cc7a0e09db97832d95c0bb8a8a503c47bf8 |
--- /dev/null |
+++ b/Source/bindings/modules/v8/custom/V8NotificationCustom.cpp |
@@ -0,0 +1,27 @@ |
+// 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" |
+#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); |
+ v8::Handle<v8::Value> result; |
+ |
+ if (impl->data()) |
+ result = impl->data()->deserialize(info.GetIsolate()); |
+ else |
+ result = v8::Null(info.GetIsolate()); |
+ |
+ v8SetReturnValue(info, result); |
Peter Beverloo
2015/03/10 23:34:26
I'm not too familiar with custom bindings, but as
Sanghyun Park
2015/03/11 10:59:52
Your suggestion codes are more clean than this.
I'
|
+} |
+ |
+} |
Peter Beverloo
2015/03/10 23:34:26
micro nit: // namespace blink
Sanghyun Park
2015/03/11 10:59:51
Done.
|