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

Side by Side 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: [WIP] modified wrong comment. 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "bindings/modules/v8/V8Notification.h"
7
8 #include "bindings/core/v8/SerializedScriptValue.h"
9 #include "modules/notifications/Notification.h"
10
11 namespace blink {
12
13 void V8Notification::dataAttributeGetterCustom(const v8::PropertyCallbackInfo<v8 ::Value>& info)
14 {
15 v8::Local<v8::Object> holder = info.Holder();
16 Notification* impl = V8Notification::toImpl(holder);
17 v8::Handle<v8::Value> result;
18
19 if (impl->data())
20 result = impl->data()->deserialize(info.GetIsolate());
21 else
22 result = v8::Null(info.GetIsolate());
23
24 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'
25 }
26
27 }
Peter Beverloo 2015/03/10 23:34:26 micro nit: // namespace blink
Sanghyun Park 2015/03/11 10:59:51 Done.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698