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

Issue 1248043003: Initial patch for the web modules layered platform proposal. (Closed)

Created:
5 years, 5 months ago by ojan
Modified:
3 years, 8 months ago
Reviewers:
haraken, esprehn
CC:
blink-reviews, blink-reviews-bindings_chromium.org, blink-reviews-dom_chromium.org, Inactive, dglazkov+blink, eae+blinkwatch, rwlbuis, sof, vivekg_samsung, vivekg, jochen (gone - plz use gerrit)
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Initial patch for the web modules layered platform proposal. This reads in the IDL we use to expose APIs to the web platform and instead generates C++ bindings to expose to Blink developers. The C++ bindings are a very simple wrapper around a pointer to the core C++ class. Compilers will completely compile out the wrapper and there is no performance overhead compared to writing the raw C++ code. This patch just adds the plumbing to expose Node::firstChild. There will need to be followup patches to expose more types of methods and more classes. The IDL compiler is two phases. The parser, which generates an intermediate representation (IR), and the codegen that generates the C++ code from the IR. We share the parser code with the V8 code generator, but don't share the code to generate the C++ bindings from the IR. Using this we can build features in a layered way. It's not quite as true to the layered platform vision as writing the features in JS code, but it's a big pragmatic step in that direction.

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+251 lines, -16 lines) Patch
M Source/bindings/IDLExtendedAttributes.txt View 1 chunk +1 line, -0 lines 0 comments Download
M Source/bindings/core/core.gni View 2 chunks +6 lines, -0 lines 0 comments Download
M Source/bindings/core/v8/BUILD.gn View 2 chunks +11 lines, -1 line 0 comments Download
M Source/bindings/modules/v8/BUILD.gn View 2 chunks +4 lines, -2 lines 0 comments Download
A Source/bindings/scripts/code_generator_web_modules.py View 1 chunk +134 lines, -0 lines 0 comments Download
M Source/bindings/scripts/idl_compiler.py View 4 chunks +30 lines, -7 lines 0 comments Download
M Source/bindings/scripts/scripts.gni View 3 chunks +19 lines, -5 lines 0 comments Download
A Source/bindings/templates/web_modules_interface.h View 1 chunk +34 lines, -0 lines 1 comment Download
A Source/bindings/templates/web_modules_interface.cpp View 1 chunk +5 lines, -0 lines 0 comments Download
M Source/core/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/core.gni View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/core.gypi View 1 chunk +3 lines, -0 lines 1 comment Download
M Source/core/dom/Node.idl View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 6 (2 generated)
esprehn
I don't think we want to call it a WebModuleNode that'll make all code using ...
5 years, 5 months ago (2015-07-22 02:25:11 UTC) #2
dglazkov
A couple of thoughts, a year later. 1) I think we should just always run ...
4 years, 4 months ago (2016-07-29 22:26:27 UTC) #3
ojan
On 2016/07/29 at 22:26:27, dglazkov wrote: > A couple of thoughts, a year later. > ...
4 years, 4 months ago (2016-07-30 03:36:46 UTC) #4
haraken
4 years, 4 months ago (2016-07-30 15:35:02 UTC) #6
The overall direction looks good to me. Once the CL is ready, we might want to
ask yukishiino@ or bashi@ for the IDL compiler review.

https://codereview.chromium.org/1248043003/diff/1/Source/bindings/templates/w...
File Source/bindings/templates/web_modules_interface.h (right):

https://codereview.chromium.org/1248043003/diff/1/Source/bindings/templates/w...
Source/bindings/templates/web_modules_interface.h:1: {% include
'copyright_block.txt' %}

You can add a test to bindings/tests/idls/.

https://codereview.chromium.org/1248043003/diff/1/Source/core/core.gypi
File Source/core/core.gypi (right):

https://codereview.chromium.org/1248043003/diff/1/Source/core/core.gypi#newcode7
Source/core/core.gypi:7: 'dom/Node.idl',

It's a bit unfortunate that we need to list up IDL files that have
[WebModulesExposed]. Can we generate the list automatically? (You don't need to
address in this CL though.)

Powered by Google App Engine
This is Rietveld 408576698