New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 718614 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: May 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Mojo JS bindings: make sure the generated code conforms to the JS naming style.

Project Member Reported by yzshen@chromium.org, May 4 2017

Issue description

Currently we only make the method name lowerCaseCamel, we also need to handle packageName, parameterName, fieldName correctly.

This requires the code generator to support naming styles for different target languages. 
 
Project Member

Comment 2 by bugdroid1@chromium.org, May 8 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8899feb0588fd6fa12ecd3e5807cf55aa778eac7

commit 8899feb0588fd6fa12ecd3e5807cf55aa778eac7
Author: yzshen <yzshen@chromium.org>
Date: Mon May 08 18:17:52 2017

Mojo code generator: simplify how imported types and values are handled.

With this change, there is no need to make deep-copies of types and values from the imported module. Besides, Module.imports are a list of Modules, instead of dictionary objects with redundant information.

This CL also removes some trivial IsXXXField forwarding functions in mojom_js_generator.py

BUG= 718614 

Review-Url: https://codereview.chromium.org/2864753002
Cr-Commit-Position: refs/heads/master@{#470054}

[modify] https://crrev.com/8899feb0588fd6fa12ecd3e5807cf55aa778eac7/mojo/public/tools/bindings/generators/cpp_templates/module-shared-internal.h.tmpl
[modify] https://crrev.com/8899feb0588fd6fa12ecd3e5807cf55aa778eac7/mojo/public/tools/bindings/generators/cpp_templates/module-shared.h.tmpl
[modify] https://crrev.com/8899feb0588fd6fa12ecd3e5807cf55aa778eac7/mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl
[modify] https://crrev.com/8899feb0588fd6fa12ecd3e5807cf55aa778eac7/mojo/public/tools/bindings/generators/js_templates/module.amd.tmpl
[modify] https://crrev.com/8899feb0588fd6fa12ecd3e5807cf55aa778eac7/mojo/public/tools/bindings/generators/js_templates/struct_definition.tmpl
[modify] https://crrev.com/8899feb0588fd6fa12ecd3e5807cf55aa778eac7/mojo/public/tools/bindings/generators/js_templates/union_definition.tmpl
[modify] https://crrev.com/8899feb0588fd6fa12ecd3e5807cf55aa778eac7/mojo/public/tools/bindings/generators/js_templates/validation_macros.tmpl
[modify] https://crrev.com/8899feb0588fd6fa12ecd3e5807cf55aa778eac7/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
[modify] https://crrev.com/8899feb0588fd6fa12ecd3e5807cf55aa778eac7/mojo/public/tools/bindings/generators/mojom_js_generator.py
[modify] https://crrev.com/8899feb0588fd6fa12ecd3e5807cf55aa778eac7/mojo/public/tools/bindings/pylib/mojom/generate/module.py
[modify] https://crrev.com/8899feb0588fd6fa12ecd3e5807cf55aa778eac7/mojo/public/tools/bindings/pylib/mojom/generate/translate.py

Project Member

Comment 3 by bugdroid1@chromium.org, May 11 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/121205ac1fd5cf2274a6f429dec741fb602f7081

commit 121205ac1fd5cf2274a6f429dec741fb602f7081
Author: yzshen <yzshen@chromium.org>
Date: Thu May 11 17:12:28 2017

Mojo code generator: change where to add computed data to mojom definitions

So that the same work is not done multiple times.

BUG= 718614 

Review-Url: https://codereview.chromium.org/2863353002
Cr-Commit-Position: refs/heads/master@{#470986}

[modify] https://crrev.com/121205ac1fd5cf2274a6f429dec741fb602f7081/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl
[modify] https://crrev.com/121205ac1fd5cf2274a6f429dec741fb602f7081/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
[modify] https://crrev.com/121205ac1fd5cf2274a6f429dec741fb602f7081/mojo/public/tools/bindings/generators/mojom_java_generator.py
[modify] https://crrev.com/121205ac1fd5cf2274a6f429dec741fb602f7081/mojo/public/tools/bindings/generators/mojom_js_generator.py
[modify] https://crrev.com/121205ac1fd5cf2274a6f429dec741fb602f7081/mojo/public/tools/bindings/mojom_bindings_generator.py
[modify] https://crrev.com/121205ac1fd5cf2274a6f429dec741fb602f7081/mojo/public/tools/bindings/pylib/mojom/generate/generator.py
[delete] https://crrev.com/d997518a95d124b2deebb67e37c96cff7fe5c1c2/mojo/public/tools/bindings/pylib/mojom/generate/generator_unittest.py
[modify] https://crrev.com/121205ac1fd5cf2274a6f429dec741fb602f7081/mojo/public/tools/bindings/pylib/mojom/generate/module.py
[modify] https://crrev.com/121205ac1fd5cf2274a6f429dec741fb602f7081/mojo/public/tools/bindings/pylib/mojom/generate/translate.py
[modify] https://crrev.com/121205ac1fd5cf2274a6f429dec741fb602f7081/mojo/public/tools/bindings/pylib/mojom_tests/generate/generator_unittest.py

Project Member

Comment 4 by bugdroid1@chromium.org, May 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/80101fbdaea7992de9cd435162351b85df4a5d40

commit 80101fbdaea7992de9cd435162351b85df4a5d40
Author: yzshen <yzshen@chromium.org>
Date: Tue May 16 18:28:42 2017

Mojo bindings generator: introduce Stylizer to specify naming rules.

This CL renames the 'name' field to 'mojom_name' on various classes, and introduces Stylizer to map 'mojom_name' to 'name' which now means the stylized name.

The default Stylizer just sets 'name' to the same value as 'mojom_name'. A follow-up CL will add a JavaScriptStylizer.

BUG= 718614 

Review-Url: https://codereview.chromium.org/2888503002
Cr-Commit-Position: refs/heads/master@{#472170}

[modify] https://crrev.com/80101fbdaea7992de9cd435162351b85df4a5d40/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
[modify] https://crrev.com/80101fbdaea7992de9cd435162351b85df4a5d40/mojo/public/tools/bindings/generators/mojom_java_generator.py
[modify] https://crrev.com/80101fbdaea7992de9cd435162351b85df4a5d40/mojo/public/tools/bindings/generators/mojom_js_generator.py
[modify] https://crrev.com/80101fbdaea7992de9cd435162351b85df4a5d40/mojo/public/tools/bindings/mojom_bindings_generator.py
[modify] https://crrev.com/80101fbdaea7992de9cd435162351b85df4a5d40/mojo/public/tools/bindings/pylib/mojom/generate/generator.py
[modify] https://crrev.com/80101fbdaea7992de9cd435162351b85df4a5d40/mojo/public/tools/bindings/pylib/mojom/generate/module.py
[modify] https://crrev.com/80101fbdaea7992de9cd435162351b85df4a5d40/mojo/public/tools/bindings/pylib/mojom/generate/translate.py
[modify] https://crrev.com/80101fbdaea7992de9cd435162351b85df4a5d40/mojo/public/tools/bindings/pylib/mojom/parse/ast.py

Project Member

Comment 5 by bugdroid1@chromium.org, May 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/40b5e68dcd6a93d50931898b2d180195966adac3

commit 40b5e68dcd6a93d50931898b2d180195966adac3
Author: yzshen <yzshen@chromium.org>
Date: Wed May 17 00:20:11 2017

Mojo JavaScript bindings: follow JavaScript naming rules.

This patch makes sure the following names follows the JavaScript naming rules in the use_new_js_bindings mode:
- method names;
- parameter names;
- struct/union field names;
- namespaces.

BUG= 718614 

Review-Url: https://codereview.chromium.org/2889723002
Cr-Commit-Position: refs/heads/master@{#472260}

[modify] https://crrev.com/40b5e68dcd6a93d50931898b2d180195966adac3/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl
[modify] https://crrev.com/40b5e68dcd6a93d50931898b2d180195966adac3/mojo/public/tools/bindings/generators/mojom_js_generator.py

Comment 6 by yzshen@chromium.org, May 17 2017

Status: Fixed (was: Untriaged)
Project Member

Comment 7 by bugdroid1@chromium.org, May 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/02e69c4cd874078942ece36ee76383c1d6965f4b

commit 02e69c4cd874078942ece36ee76383c1d6965f4b
Author: yzshen <yzshen@chromium.org>
Date: Wed May 17 05:48:10 2017

Revert of Mojo JavaScript bindings: follow JavaScript naming rules. (patchset #2 id:20001 of https://codereview.chromium.org/2889723002/ )

Reason for revert:
Caused layout tests failure:

https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Win7/builds/52495

Original issue's description:
> Mojo JavaScript bindings: follow JavaScript naming rules.
>
> This patch makes sure the following names follows the JavaScript naming rules in the use_new_js_bindings mode:
> - method names;
> - parameter names;
> - struct/union field names;
> - namespaces.
>
> BUG= 718614 
>
> Review-Url: https://codereview.chromium.org/2889723002
> Cr-Commit-Position: refs/heads/master@{#472260}
> Committed: https://chromium.googlesource.com/chromium/src/+/40b5e68dcd6a93d50931898b2d180195966adac3

TBR=rockot@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG= 718614 

Review-Url: https://codereview.chromium.org/2893543002
Cr-Commit-Position: refs/heads/master@{#472343}

[modify] https://crrev.com/02e69c4cd874078942ece36ee76383c1d6965f4b/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl
[modify] https://crrev.com/02e69c4cd874078942ece36ee76383c1d6965f4b/mojo/public/tools/bindings/generators/mojom_js_generator.py

Project Member

Comment 8 by bugdroid1@chromium.org, May 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c29cc4ea75913bb687853ef0722ca45084c72a61

commit c29cc4ea75913bb687853ef0722ca45084c72a61
Author: yzshen <yzshen@chromium.org>
Date: Wed May 17 19:54:19 2017

Mojo JavaScript bindings: follow JavaScript naming rules.

This patch makes sure the following names follows the JavaScript naming rules in the use_new_js_bindings mode:
- method names;
- parameter names;
- struct/union field names;
- namespaces.

BUG= 718614 

Review-Url: https://codereview.chromium.org/2889723002
Cr-Original-Commit-Position: refs/heads/master@{#472260}
Committed: https://chromium.googlesource.com/chromium/src/+/40b5e68dcd6a93d50931898b2d180195966adac3
Review-Url: https://codereview.chromium.org/2889723002
Cr-Commit-Position: refs/heads/master@{#472541}

[modify] https://crrev.com/c29cc4ea75913bb687853ef0722ca45084c72a61/mojo/public/js/new_bindings/lib/control_message_handler.js
[modify] https://crrev.com/c29cc4ea75913bb687853ef0722ca45084c72a61/mojo/public/js/new_bindings/lib/control_message_proxy.js
[modify] https://crrev.com/c29cc4ea75913bb687853ef0722ca45084c72a61/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl
[modify] https://crrev.com/c29cc4ea75913bb687853ef0722ca45084c72a61/mojo/public/tools/bindings/generators/mojom_js_generator.py

Sign in to add a comment