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

Issue 109473008: Remove custom signatures from V8 bindings (Closed)

Created:
6 years, 12 months ago by haraken
Modified:
6 years, 11 months ago
CC:
blink-reviews, Nils Barth (inactive), kojih, arv+blink, jsbell+bindings_chromium.org, sof, abarth-chromium, marja+watch_chromium.org, adamk+blink_chromium.org, haraken, Nate Chapin, watchdog-blink-watchlist_google.com, Inactive
Visibility:
Public.

Description

Remove custom signatures from V8 bindings - Previously custom signatures were specified on methods that have parameters whose type is a DOM object. For example: void foo(bool a, bool b, Node node); // This method has a custom signature because Node is a DOM object. - Custom signatures were used by V8 to validate the parameter type when the method is called back. However, it is a responsibility of (not V8 but) V8 binding to validate the parameter type. In fact, V8 binding already generates code for the validation. For example: Node* node = V8Node::hasInstance(args[2]) ? V8Node::toNative(args[2]) : 0; - Thus, custom signatures are unnecessary. This CL removes the custom signatures completely. - The only thing we have to be careful about is DOMWindow. Because DOMWindow has a hidden prototype chain, we cannot validate the parameter type just by checking V8Window::hasInstance(). Thus this CL adds toNativeDOMWindow() that looks up the prototype chain and finds an instance on the hidden prototype chain. Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=164407

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+44 lines, -243 lines) Patch
M Source/bindings/scripts/code_generator_v8.pm View 4 chunks +4 lines, -79 lines 0 comments Download
M Source/bindings/tests/results/V8TestInterfaceImplementedAs.cpp View 2 chunks +1 line, -6 lines 0 comments Download
M Source/bindings/tests/results/V8TestObject.cpp View 2 chunks +5 lines, -30 lines 0 comments Download
M Source/bindings/tests/results/V8TestObjectPython.cpp View 8 chunks +18 lines, -112 lines 0 comments Download
M Source/bindings/v8/Dictionary.cpp View 1 chunk +1 line, -7 lines 0 comments Download
M Source/bindings/v8/V8Binding.h View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/v8/V8Binding.cpp View 1 chunk +12 lines, -0 lines 0 comments Download
M Source/bindings/v8/custom/V8MessageEventCustom.cpp View 1 chunk +1 line, -9 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
haraken
PTAL
6 years, 12 months ago (2013-12-29 06:21:19 UTC) #1
kouhei (in TOK)
lgtm
6 years, 11 months ago (2014-01-01 01:00:00 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/haraken@chromium.org/109473008/1
6 years, 11 months ago (2014-01-01 02:31:19 UTC) #3
commit-bot: I haz the power
6 years, 11 months ago (2014-01-01 02:37:58 UTC) #4
Message was sent while issue was closed.
Change committed as 164407

Powered by Google App Engine
This is Rietveld 408576698