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

Issue 10542036: Use original WebKit IDL database for dart:html generation. (Closed)

Created:
8 years, 6 months ago by podivilov
Modified:
8 years, 6 months ago
Reviewers:
Anton Muhin, sra1
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Use original WebKit IDL database for dart:html generation. This will allow us to use the same database to generate both frog and native implementations. R=antonm@google.com,sra@google.com Committed: https://code.google.com/p/dart/source/detail?r=8458

Patch Set 1 #

Total comments: 8

Patch Set 2 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+143 lines, -125 lines) Patch
M lib/dom/scripts/dartdomgenerator.py View 3 chunks +16 lines, -67 lines 0 comments Download
M lib/dom/scripts/dartgenerator.py View 1 chunk +1 line, -1 line 0 comments Download
M lib/dom/scripts/generator.py View 1 1 chunk +2 lines, -2 lines 0 comments Download
M lib/dom/scripts/systemfrog.py View 1 1 chunk +10 lines, -5 lines 0 comments Download
M lib/dom/scripts/systemhtml.py View 1 20 chunks +106 lines, -38 lines 0 comments Download
M lib/dom/scripts/systemnative.py View 1 6 chunks +8 lines, -12 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
podivilov
8 years, 6 months ago (2012-06-06 18:57:34 UTC) #1
Anton Muhin
lgtm https://chromiumcodereview.appspot.com/10542036/diff/1/lib/dom/scripts/generator.py File lib/dom/scripts/generator.py (right): https://chromiumcodereview.appspot.com/10542036/diff/1/lib/dom/scripts/generator.py#newcode391 lib/dom/scripts/generator.py:391: def ParametersInterfaceDeclaration(self, rename_type=None): why not rename_type=lambda x: x? ...
8 years, 6 months ago (2012-06-07 11:43:46 UTC) #2
podivilov
8 years, 6 months ago (2012-06-08 18:03:25 UTC) #3
Thanks!

http://codereview.chromium.org/10542036/diff/1/lib/dom/scripts/generator.py
File lib/dom/scripts/generator.py (right):

http://codereview.chromium.org/10542036/diff/1/lib/dom/scripts/generator.py#n...
lib/dom/scripts/generator.py:391: def ParametersInterfaceDeclaration(self,
rename_type=None):
On 2012/06/07 11:43:47, antonmuhin wrote:
> why not rename_type=lambda x: x?

Done.

http://codereview.chromium.org/10542036/diff/1/lib/dom/scripts/systemfrog.py
File lib/dom/scripts/systemfrog.py (right):

http://codereview.chromium.org/10542036/diff/1/lib/dom/scripts/systemfrog.py#...
lib/dom/scripts/systemfrog.py:165: def _ShouldNarrowToImplementationType(self,
type_name):
On 2012/06/07 11:43:47, antonmuhin wrote:
> maybe pass a renamer here instead of doing if and rename?

It might be a good idea, but there too many call sites that need renaming.

http://codereview.chromium.org/10542036/diff/1/lib/dom/scripts/systemhtml.py
File lib/dom/scripts/systemhtml.py (right):

http://codereview.chromium.org/10542036/diff/1/lib/dom/scripts/systemhtml.py#...
lib/dom/scripts/systemhtml.py:613: if (parent.type.id in names_to_match or
On 2012/06/07 11:43:47, antonmuhin wrote:
> up to you, but I find it somewhat hard to read, what about
> 
> if parent.type.id in names_to_match: return True
> if not self._database.HasInterface(parent.type.id): continue
> if self._HasAncestor(self._data....)
> 
> plus I believed we either already have or was dreaming of generic traversal of
> inheritance chain, I'd suggest something like
> 
> def AllParents(interface, database):
>   for parent in interface.parents:
>     yield parent
>     if not database.HasInterface(parent.type.id): continue
>     for child in Parents(database.GetInterface(parent.type.id)):
>       yield child
> 
> Now you can have a very nice _HasAncestor:
> 
> def _HasAncestor(self, interface, names_to_match):
>   return any(parent.type.id in names_to_match for parent in
> AllParents(interface, self._database)

Done.

http://codereview.chromium.org/10542036/diff/1/lib/dom/scripts/systemhtml.py#...
lib/dom/scripts/systemhtml.py:624: if (interface.id.startswith("HTML") and
On 2012/06/07 11:43:47, antonmuhin wrote:
> nit: single quote strings, please

Done.

Powered by Google App Engine
This is Rietveld 408576698