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

Side by Side Diff: Source/bindings/core/v8/custom/V8CustomEventCustom.cpp

Issue 1300093003: [bindings] Make all CustomEvent.initCustomEvent arguments non-optional and remove custom binding. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 if (SerializedScriptValue* serializedValue = event->serializedDetail()) 66 if (SerializedScriptValue* serializedValue = event->serializedDetail())
67 detail = serializedValue->deserialize(); 67 detail = serializedValue->deserialize();
68 else 68 else
69 detail = event->detail().v8ValueFor(ScriptState::current(info.GetIsolate ())); 69 detail = event->detail().v8ValueFor(ScriptState::current(info.GetIsolate ()));
70 // |detail| should be null when it is an empty handle because its default va lue is null. 70 // |detail| should be null when it is an empty handle because its default va lue is null.
71 if (detail.IsEmpty()) 71 if (detail.IsEmpty())
72 detail = v8::Null(info.GetIsolate()); 72 detail = v8::Null(info.GetIsolate());
73 v8SetReturnValue(info, cacheState(info.GetIsolate(), info.Holder(), detail)) ; 73 v8SetReturnValue(info, cacheState(info.GetIsolate(), info.Holder(), detail)) ;
74 } 74 }
75 75
76 void V8CustomEvent::initCustomEventMethodCustom(const v8::FunctionCallbackInfo<v 8::Value>& info)
77 {
78 CustomEvent* event = V8CustomEvent::toImpl(info.Holder());
79
80 TOSTRING_VOID(V8StringResource<>, typeArg, info[0]);
81 bool canBubbleArg;
82 bool cancelableArg;
83 if (!v8Call(info[1]->BooleanValue(info.GetIsolate()->GetCurrentContext()), c anBubbleArg)
84 || !v8Call(info[2]->BooleanValue(info.GetIsolate()->GetCurrentContext()) , cancelableArg))
85 return;
86 v8::Local<v8::Value> detailsArg = info[3];
87
88 event->initEvent(typeArg, canBubbleArg, cancelableArg);
89 event->setDetail(ScriptValue(ScriptState::current(info.GetIsolate()), detail sArg));
90 }
91
92 } // namespace blink 76 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/virtual/stable/animations-unprefixed/animation-events-unprefixed-04.html ('k') | Source/core/events/CustomEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698