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

Issue 345893002: Implement an infrastructure of Blink-in-JS

Created:
6 years, 6 months ago by haraken
Modified:
6 years, 4 months ago
CC:
abarth-chromium, arv+blink, blink-reviews, blink-reviews-bindings_chromium.org
Project:
blink
Visibility:
Public.

Description

Implement an infrastructure of Blink-in-JS * Design doc is here: https://docs.google.com/a/google.com/document/d/13cT9Klgvt_ciAR3ONGvzKvw6fz9-f6E0FrqYFqfoc8Y/edit * Developers can use Blink-in-JS in the following steps: (1) Implement a DOM feature in XXX.js. installClass("XXX", function() { function func1(int value) { ... } function func2(Node node) { ... } return {func1: func1, func2: func2}; }); (2) Add XXX.idl that defines an interface from C++ to the JS functions. [BlinkInJSInterface] interface XXX { void func1(int value); DOMString func2(Node node); }; (3) Then developers can use V8XXX::func1(int) and V8XXX::func2(Node*) in C++. * For more details, see what BlinkInJSTest.js, BlinkInJSTest.idl and BlinkInJSTest.cpp are doing. * Important files in this CL are as follows: - BlinkInJSTest.js, BlinkInJSTest.idl and BlinkInJSTest.cpp: Test cases for Blink-in-JS. - v8_blink_in_js.py, blink_in_js_interface.{h,cpp}: The code generator for Blink-in-JS' IDL files. You can see the generated code in V8TestBlinkInJSInterface.{h,cpp}. - make_blink_in_js.py: Converts the contents of Blink-in-JS' JS files into byte stream. The byte stream is generated to BlinkInJSSources.h. - BlinkInJSController.{h,cpp}: Compiles the byte stream and invokes the JS code. BUG=341031 TEST=BlinkInJSTest

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Total comments: 17

Patch Set 4 : #

Total comments: 35

Patch Set 5 : #

Patch Set 6 : #

Patch Set 7 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+965 lines, -43 lines) Patch
M Source/bindings/IDLExtendedAttributes.txt View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M Source/bindings/core/idl.gypi View 1 2 3 4 5 6 2 chunks +8 lines, -1 line 0 comments Download
M Source/bindings/scripts/code_generator_v8.py View 1 2 3 4 5 6 3 chunks +9 lines, -1 line 0 comments Download
M Source/bindings/scripts/scripts.gypi View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M Source/bindings/scripts/v8_callback_interface.py View 1 2 3 4 2 chunks +5 lines, -9 lines 0 comments Download
M Source/bindings/scripts/v8_interface.py View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/bindings/scripts/v8_methods.py View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
A Source/bindings/scripts/v8_private_script_interface.py View 1 2 3 4 1 chunk +83 lines, -0 lines 0 comments Download
M Source/bindings/scripts/v8_types.py View 1 2 3 4 6 chunks +31 lines, -24 lines 0 comments Download
M Source/bindings/templates/callback_interface.cpp View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
A Source/bindings/templates/private_script_interface.h View 1 2 3 1 chunk +28 lines, -0 lines 0 comments Download
A Source/bindings/templates/private_script_interface.cpp View 1 2 3 4 5 1 chunk +60 lines, -0 lines 0 comments Download
M Source/bindings/templates/templates.gypi View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
A Source/bindings/tests/idls/TestPrivateScriptInterface.idl View 1 2 3 4 1 chunk +15 lines, -0 lines 0 comments Download
A Source/bindings/tests/results/V8TestPrivateScriptInterface.h View 1 2 3 4 1 chunk +29 lines, -0 lines 0 comments Download
A Source/bindings/tests/results/V8TestPrivateScriptInterface.cpp View 1 2 3 4 5 1 chunk +178 lines, -0 lines 0 comments Download
M Source/bindings/v8/DOMWrapperWorld.h View 1 2 3 4 chunks +4 lines, -0 lines 0 comments Download
M Source/bindings/v8/DOMWrapperWorld.cpp View 1 2 3 1 chunk +13 lines, -0 lines 0 comments Download
A Source/bindings/v8/PrivateScriptController.h View 1 2 3 4 5 1 chunk +22 lines, -0 lines 0 comments Download
A Source/bindings/v8/PrivateScriptController.cpp View 1 2 3 4 5 1 chunk +60 lines, -0 lines 0 comments Download
A Source/bindings/v8/PrivateScriptController.js View 1 2 3 1 chunk +15 lines, -0 lines 0 comments Download
A Source/bindings/v8/PrivateScriptTest.cpp View 1 2 3 1 chunk +189 lines, -0 lines 0 comments Download
A Source/bindings/v8/PrivateScriptTest.idl View 1 2 3 1 chunk +26 lines, -0 lines 0 comments Download
A Source/bindings/v8/PrivateScriptTest.js View 1 2 3 1 chunk +80 lines, -0 lines 0 comments Download
M Source/bindings/v8/ScriptController.cpp View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M Source/bindings/v8/V8EventListener.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M Source/bindings/v8/V8PerContextData.h View 1 2 3 4 5 3 chunks +7 lines, -1 line 0 comments Download
M Source/bindings/v8/V8PerContextData.cpp View 1 2 3 4 5 2 chunks +15 lines, -4 lines 0 comments Download
M Source/bindings/v8/V8PerIsolateData.h View 1 2 3 4 5 2 chunks +2 lines, -0 lines 0 comments Download
M Source/bindings/v8/V8WindowShell.cpp View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download
M Source/bindings/v8/v8.gypi View 1 2 3 2 chunks +3 lines, -0 lines 0 comments Download
A Source/build/scripts/make_private_script_source.py View 1 2 3 4 1 chunk +46 lines, -0 lines 0 comments Download
M Source/core/core_generated.gyp View 1 2 3 4 1 chunk +23 lines, -0 lines 0 comments Download

Messages

Total messages: 18 (0 generated)
haraken
abarth@: Would you take a look at this CL when you have time? nbarth@: Would ...
6 years, 6 months ago (2014-06-20 14:04:05 UTC) #1
arv (Not doing code reviews)
FYI https://codereview.chromium.org/345893002/diff/40001/Source/bindings/v8/BlinkInJSController.js File Source/bindings/v8/BlinkInJSController.js (right): https://codereview.chromium.org/345893002/diff/40001/Source/bindings/v8/BlinkInJSController.js#newcode13 Source/bindings/v8/BlinkInJSController.js:13: (installedClasses); useless parens... This could use a comment ...
6 years, 6 months ago (2014-06-20 15:06:22 UTC) #2
abarth-chromium
This CL looks very interesting, but it's a lot to digest. Can we break it ...
6 years, 6 months ago (2014-06-20 15:17:43 UTC) #3
haraken
Thanks for comments! I'm happy to break the CL into pieces next week, so please ...
6 years, 6 months ago (2014-06-20 15:26:49 UTC) #4
haraken
> Should we limit the types we allow in ImplementedWith=JavaScript interfaces? > For example, we ...
6 years, 6 months ago (2014-06-20 15:31:11 UTC) #5
dcarney
you want everything to be per context, not per isolate. this implementation will bleed blinkinjs ...
6 years, 6 months ago (2014-06-22 12:49:31 UTC) #6
haraken
> you want everything to be per context, not per isolate. this implementation > will ...
6 years, 6 months ago (2014-06-22 13:21:00 UTC) #7
dcarney
> Am I missing something? sorry, i should have been more specific. i'm only talking ...
6 years, 6 months ago (2014-06-22 15:15:56 UTC) #8
haraken
On 2014/06/22 15:15:56, dcarney wrote: > > Am I missing something? > > sorry, i ...
6 years, 6 months ago (2014-06-22 15:27:04 UTC) #9
haraken
https://codereview.chromium.org/345893002/diff/40001/Source/bindings/v8/BlinkInJSController.js File Source/bindings/v8/BlinkInJSController.js (right): https://codereview.chromium.org/345893002/diff/40001/Source/bindings/v8/BlinkInJSController.js#newcode3 Source/bindings/v8/BlinkInJSController.js:3: // found in the LICENSE file. On 2014/06/20 15:17:43, ...
6 years, 6 months ago (2014-06-23 01:32:55 UTC) #10
Nils Barth (inactive)
* Per abarth@, breaking into separate CLs would help. * Overall CG changes look fine! ...
6 years, 6 months ago (2014-06-23 03:14:30 UTC) #11
haraken
nbarth@: thanks for detailed review! I have a question about where the IDL files for ...
6 years, 6 months ago (2014-06-23 06:01:46 UTC) #12
Nils Barth (inactive)
https://codereview.chromium.org/345893002/diff/60001/Source/bindings/scripts/code_generator_v8.py File Source/bindings/scripts/code_generator_v8.py (right): https://codereview.chromium.org/345893002/diff/60001/Source/bindings/scripts/code_generator_v8.py#newcode151 Source/bindings/scripts/code_generator_v8.py:151: if 'PrivateScriptInterface' not in interface.extended_attributes: On 2014/06/23 06:01:46, haraken ...
6 years, 6 months ago (2014-06-23 06:21:25 UTC) #13
dcarney
On 2014/06/22 15:27:04, haraken wrote: > On 2014/06/22 15:15:56, dcarney wrote: > > > Am ...
6 years, 6 months ago (2014-06-23 06:47:18 UTC) #14
haraken
I think the remaining issue would be how to rewrite make_private_script_source.py to GRIT. I'll chat ...
6 years, 6 months ago (2014-06-23 07:15:03 UTC) #15
haraken
https://codereview.chromium.org/345893002/diff/60001/Source/bindings/scripts/code_generator_v8.py File Source/bindings/scripts/code_generator_v8.py (right): https://codereview.chromium.org/345893002/diff/60001/Source/bindings/scripts/code_generator_v8.py#newcode151 Source/bindings/scripts/code_generator_v8.py:151: if 'PrivateScriptInterface' not in interface.extended_attributes: On 2014/06/23 06:21:25, Nils ...
6 years, 6 months ago (2014-06-23 08:15:38 UTC) #16
Nils Barth (inactive)
https://codereview.chromium.org/345893002/diff/60001/Source/core/core.gypi File Source/core/core.gypi (right): https://codereview.chromium.org/345893002/diff/60001/Source/core/core.gypi#newcode452 Source/core/core.gypi:452: '../bindings/v8/PrivateScriptTest.idl', On 2014/06/23 08:15:38, haraken wrote: > Done. I ...
6 years, 6 months ago (2014-06-23 08:54:11 UTC) #17
haraken
6 years, 6 months ago (2014-06-23 11:51:50 UTC) #18
I started landing this CL splitting into pieces.

abarth@: I have a question about make_private_script_source.py. I guess we want
to replace make_private_script_source.py with grit since we don't want to have
more build scripts. I'm not familiar with grit but would you tell me a couple of
examples where grit is used for build scripts?

Powered by Google App Engine
This is Rietveld 408576698