Chromium Code Reviews
DescriptionAdd an Implementations class
This class provides a static create() method that allows client code to
generate a class appropriate to the running build. This is superior to
the current approach, which requires a ChromeApplication, which may not
always be available.
To use this create() method, one needs to:
- give the upstream class a public parameterless constructor,
- give the downstream class a public parameterless constructor,
- register the downstream class in the downstream Implementations
getClass() method, and
- invoke this method on the appropriate class
(e.g., Implementations.create(MyType.class)).
In order to pull this off, an ImplementationsMetadata is built into the
package depending on whether or not the downstream should be
responsible for constructing the Implementations instance.
BUG=685383
Patch Set 1 #Patch Set 2 : Use LazyHolder idiom #Patch Set 3 : Simplify the approach #
Messages
Total messages: 10 (2 generated)
|
||||||||||||||||||||||||||||