|
Implement Blink-in-JS for DOM methods
* This CL implements the core infrastructure of Blink-in-JS to support DOM methods. DOM attributes, DOM constants etc will be supported in follow-up CLs.
* Developers can use Blink-in-JS as follows:
(1) Implement DOM features in JavaScript.
// Foo.js
installClass("Foo", function(window) {
var FooPrototype = {};
FooPrototype.method = function(a, b) { ... } // DOM method
return FooPrototype;
});
(2) Add an [ImplementedInPrivateScript] IDL attribute to Foo.idl.
// Foo.idl
interface Foo {
[ImplementedInPrivateScript] DOMString method(short a, Node b);
};
* For more details, see changes to Internals.js and Internals.idl.
* bindings/scripts/v8_methods.py and bindings/templates/methods.cpp implement the binding layer that connects DOM methods with private scripts. Only primitive types and DOM wrappers are allowed as types of return values and parameter values of Blink-in-JS.
BUG= 341031
TEST=fast/dom/private_script_unittest.html
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=177298
Total comments: 8
Total comments: 1
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+705 lines, -17 lines) |
Patch |
|
M |
LayoutTests/TestExpectations
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/dom/private_script_unittest.html
|
View
|
|
1 chunk |
+54 lines, -0 lines |
0 comments
|
Download
|
|
A |
LayoutTests/fast/dom/private_script_unittest-expected.txt
|
View
|
|
1 chunk |
+28 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/bindings/IDLExtendedAttributes.txt
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
Source/bindings/core/v8/PrivateScriptRunner.h
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
Source/bindings/core/v8/PrivateScriptRunner.cpp
|
View
|
1
2
3
4
5
6
7
|
3 chunks |
+23 lines, -6 lines |
0 comments
|
Download
|
|
M |
Source/bindings/core/v8/PrivateScriptRunner.js
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
Source/bindings/scripts/idl_types.py
|
View
|
1
2
3
|
1 chunk |
+4 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/bindings/scripts/v8_methods.py
|
View
|
1
2
3
4
5
6
7
8
|
10 chunks |
+50 lines, -4 lines |
0 comments
|
Download
|
|
M |
Source/bindings/scripts/v8_types.py
|
View
|
1
2
3
4
5
6
7
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
Source/bindings/scripts/v8_utilities.py
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/bindings/templates/interface_base.cpp
|
View
|
1
2
3
|
1 chunk |
+5 lines, -1 line |
0 comments
|
Download
|
|
M |
Source/bindings/templates/methods.cpp
|
View
|
1
2
|
2 chunks |
+50 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/bindings/tests/idls/TestObject.idl
|
View
|
|
1 chunk |
+9 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/bindings/tests/results/V8TestObject.cpp
|
View
|
1
2
3
4
5
6
7
8
|
4 chunks |
+320 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/build/scripts/make_private_script_source.py
|
View
|
1
2
3
|
3 chunks |
+5 lines, -3 lines |
0 comments
|
Download
|
|
M |
Source/core/BUILD.gn
|
View
|
1
2
3
4
5
6
7
|
2 chunks |
+20 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/core_generated.gyp
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+19 lines, -0 lines |
0 comments
|
Download
|
|
M |
Source/core/testing/Internals.idl
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+20 lines, -0 lines |
0 comments
|
Download
|
|
A |
Source/core/testing/Internals.js
|
View
|
1
2
3
4
5
|
1 chunk |
+89 lines, -0 lines |
0 comments
|
Download
|
Total messages: 24 (0 generated)
|