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

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

Created:
3 years, 11 months ago by cco3
Modified:
3 years, 11 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, and only a small implementation (that does not require creating additional methods) 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 Review-Url: https://codereview.chromium.org/2655463008 Cr-Commit-Position: refs/heads/master@{#446394} Committed: https://chromium.googlesource.com/chromium/src/+/5b52d760b18cc7b955ee0bf35cdfe7239f9ba0c7

Patch Set 1 #

Patch Set 2 : Update BUG ID #

Total comments: 2

Patch Set 3 : Include class name in runtime exception #

Total comments: 4

Patch Set 4 : Add javadoc #

Patch Set 5 : Rebase #

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

Messages

Total messages: 13 (6 generated)
cco3
Hi Maria, would you be able to take a look at this change? I've also ...
3 years, 11 months ago (2017-01-25 22:23:38 UTC) #2
Maria
https://codereview.chromium.org/2655463008/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java File chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java (right): https://codereview.chromium.org/2655463008/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java#newcode440 chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java:440: throw new RuntimeException("Asked to create unexpected class."); add the ...
3 years, 11 months ago (2017-01-26 00:46:02 UTC) #4
cco3
https://codereview.chromium.org/2655463008/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java File chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java (right): https://codereview.chromium.org/2655463008/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java#newcode440 chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java:440: throw new RuntimeException("Asked to create unexpected class."); On 2017/01/26 ...
3 years, 11 months ago (2017-01-26 01:00:02 UTC) #5
Maria
lgtm % small comments https://codereview.chromium.org/2655463008/diff/40001/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java File chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java (right): https://codereview.chromium.org/2655463008/diff/40001/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java#newcode432 chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java:432: public static <T> T createObject(Class<T> ...
3 years, 11 months ago (2017-01-26 02:23:25 UTC) #6
cco3
https://codereview.chromium.org/2655463008/diff/40001/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java File chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java (right): https://codereview.chromium.org/2655463008/diff/40001/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java#newcode432 chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java:432: public static <T> T createObject(Class<T> klass) { On 2017/01/26 ...
3 years, 11 months ago (2017-01-26 18:06:58 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2655463008/80001
3 years, 11 months ago (2017-01-26 18:48:11 UTC) #10
commit-bot: I haz the power
3 years, 11 months ago (2017-01-26 19:36:14 UTC) #13
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://chromium.googlesource.com/chromium/src/+/5b52d760b18cc7b955ee0bf35cdf...

Powered by Google App Engine
This is Rietveld 408576698