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

Issue 2668183002: Add new pattern for creating downstream objects (Closed)

Created:
3 years, 10 months ago by cco3
Modified:
3 years, 9 months ago
Reviewers:
Maria
CC:
chromium-reviews, agrieve+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add new pattern for creating downstream objects This change introduces a new pattern for instantiating objects of classes that have have differing upstream/downstream implementations. If a class's constructor requires no parameters (as is most frequently the case in this scenario), it can be created with: ChromeApplication.createObject(MyType.class); and registered with no additional change upstream. Only a single line registration of the implementation needs to be provided downstream. Without this change, one must register a new method both upstream and downstream as well as cast an application context to a ChromeApplication before calling that newly registered return type-specifc method. BUG=685383

Patch Set 1 #

Patch Set 2 : Restore createObject method #

Patch Set 3 : ? extends #

Unified diffs Side-by-side diffs Delta from patch set Stats (+40 lines, -0 lines) Patch
M chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java View 1 2 1 chunk +40 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (2 generated)
cco3
I think this will work better. Sorry for the run-around.
3 years, 10 months ago (2017-02-01 02:31:00 UTC) #2
Maria
3 years, 10 months ago (2017-02-01 03:49:09 UTC) #3
lgtm

Powered by Google App Engine
This is Rietveld 408576698