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

Issue 9705040: Generate factory providers for systemnative (Closed)

Created:
8 years, 9 months ago by sra1
Modified:
8 years, 9 months ago
Reviewers:
Anton Muhin
CC:
reviews_dartlang.org, dart-dom-team_google.com
Visibility:
Public.

Description

Generate factory providers for systemnative BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=5541

Patch Set 1 #

Patch Set 2 : missing file #

Patch Set 3 : copyright year #

Patch Set 4 : merge #

Unified diffs Side-by-side diffs Delta from patch set Stats (+75 lines, -152 lines) Patch
M client/dom/scripts/systemnative.py View 1 2 3 6 chunks +57 lines, -3 lines 0 comments Download
M client/dom/src/native_FactoryProviders.dart View 1 2 3 chunks +5 lines, -104 lines 0 comments Download
M client/dom/src/native_FactoryProvidersImplementation.dart View 1 2 2 chunks +5 lines, -45 lines 0 comments Download
A client/dom/templates/dom/native/factoryprovider.darttemplate View 1 1 chunk +8 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
sra1
8 years, 9 months ago (2012-03-15 00:39:38 UTC) #1
Anton Muhin
General question (but we should probably commit it as is), why that many levels of ...
8 years, 9 months ago (2012-03-15 13:43:39 UTC) #2
sra1
8 years, 9 months ago (2012-03-15 18:19:40 UTC) #3
On 2012/03/15 13:43:39, antonmuhin wrote:
> General question (but we should probably commit it as is), why that many
levels
> of indirection?
> 
> Couldn't we have something like that:
> 
> DOMInterface default  DOMInterfaceImplementation {
>   DOMInterface();
> }
> 
> DOMInterfaceImplementation {
>   factory DOMInterfaceImplementation() native
> "DOMInterfaceImplementation_constructor_Callback";
> }
> 
> Why we need both factory providers and a static helper class?
> 
> tia for explanations!

The interfaces are generated once for all libraries.  The frog dom (and html)
are single libraries.
In the single library case the factory provider class should be private.  That
prevents it being imported from an impl library, hence the extra hop.

The existing manual code goes to the same degree of effort to put the 'native'
method in the impl library.
I just followed that pattern, but generated one class per static method because
that is simpler.

Do you know for sure if the vm native feature works on factory methods?  I don't
think it does for frog.  Back when dartc was a code generator, it native only
worked properly on static methods.

Powered by Google App Engine
This is Rietveld 408576698