|
|
DescriptionMove WebappRegistry warmup to async task.
On Android N the constructor results in a StrictMode violation due to
WebappRegistry#openSharedPreferences. Use initialization on demand
holder idiom to avoid synchronization issues.
BUG=656035
Committed: https://crrev.com/f21ab9c1569a73162ed57c7f09dc7d7e1ec80e24
Cr-Commit-Position: refs/heads/master@{#426823}
Patch Set 1 #Patch Set 2 : Use Holder idiom. #
Total comments: 4
Patch Set 3 : Update comments. #
Messages
Total messages: 30 (18 generated)
The CQ bit was checked by wnwen@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
wnwen@chromium.org changed reviewers: + dominickn@chromium.org
I don't think the constructor has to be on the main thread, it's just creating a hash map and initializing the shared pref right?
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
lgtm (omg my patch actually stuck this time) On 2016/10/14 16:26:15, Peter Wen wrote: > I don't think the constructor has to be on the main thread, it's just creating a > hash map and initializing the shared pref right? Previously FindBugs gave me an error on the background thread call to getInstance() because it could initialise the static WebappRegistry instance, but that should have gone away now that the instance is marked volatile.
Description was changed from ========== Move WebappRegistry warmup to async task. On Android N the constructor results in a StrictMode violation due to WebappRegistry#openSharedPreferences. BUG=656035 ========== to ========== Move WebappRegistry warmup to async task. On Android N the constructor results in a StrictMode violation due to WebappRegistry#openSharedPreferences. Use initialization on demand holder idiom to avoid synchronization issues. BUG=656035 ==========
On 2016/10/15 00:13:19, dominickn wrote: > lgtm (omg my patch actually stuck this time) > > On 2016/10/14 16:26:15, Peter Wen wrote: > > I don't think the constructor has to be on the main thread, it's just creating > a > > hash map and initializing the shared pref right? > > Previously FindBugs gave me an error on the background thread call to > getInstance() because it could initialise the static WebappRegistry instance, > but that should have gone away now that the instance is marked volatile. Updated WebappRegistry with Holder idiom to avoid synchronization issues, since even though the variable was volatile there could still be races that re-initialize sInstance. Thanks for catching that.
The CQ bit was checked by wnwen@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
wnwen@chromium.org changed reviewers: + dtrainor@chromium.org
+dtrainor@ for chrome/android OWNERS.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2421833003/diff/20001/chrome/android/java/src... File chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappRegistry.java (right): https://codereview.chromium.org/2421833003/diff/20001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappRegistry.java:82: * Warm up the WebappRegistry and a specific WebappDataStorage SharedPreferences. This static Nit: this method can initialize sInstance now right? Update comment? https://codereview.chromium.org/2421833003/diff/20001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappRegistry.java:91: * Warm up the WebappRegistry and all WebappDataStorage SharedPreferences. This static method Nit: this method can initialize sInstance now right? Update comment?
The CQ bit was checked by wnwen@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Thanks for catching those comments! https://codereview.chromium.org/2421833003/diff/20001/chrome/android/java/src... File chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappRegistry.java (right): https://codereview.chromium.org/2421833003/diff/20001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappRegistry.java:82: * Warm up the WebappRegistry and a specific WebappDataStorage SharedPreferences. This static On 2016/10/17 23:15:58, dominickn wrote: > Nit: this method can initialize sInstance now right? Update comment? Done. https://codereview.chromium.org/2421833003/diff/20001/chrome/android/java/src... chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappRegistry.java:91: * Warm up the WebappRegistry and all WebappDataStorage SharedPreferences. This static method On 2016/10/17 23:15:58, dominickn wrote: > Nit: this method can initialize sInstance now right? Update comment? Done.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
@dtrainor - friendly ping for DeferredStartupHandler.java OWNERS. :)
Sorry about this! I was at a conference this week and missed the review after. lgtm.
The CQ bit was checked by wnwen@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from dominickn@chromium.org Link to the patchset: https://codereview.chromium.org/2421833003/#ps40001 (title: "Update comments.")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
On 2016/10/21 16:05:32, David Trainor wrote: > Sorry about this! I was at a conference this week and missed the review after. > lgtm. No problem, I should've checked calendar first. Thanks for the review! :)
Message was sent while issue was closed.
Committed patchset #3 (id:40001)
Message was sent while issue was closed.
Description was changed from ========== Move WebappRegistry warmup to async task. On Android N the constructor results in a StrictMode violation due to WebappRegistry#openSharedPreferences. Use initialization on demand holder idiom to avoid synchronization issues. BUG=656035 ========== to ========== Move WebappRegistry warmup to async task. On Android N the constructor results in a StrictMode violation due to WebappRegistry#openSharedPreferences. Use initialization on demand holder idiom to avoid synchronization issues. BUG=656035 Committed: https://crrev.com/f21ab9c1569a73162ed57c7f09dc7d7e1ec80e24 Cr-Commit-Position: refs/heads/master@{#426823} ==========
Message was sent while issue was closed.
Patchset 3 (id:??) landed as https://crrev.com/f21ab9c1569a73162ed57c7f09dc7d7e1ec80e24 Cr-Commit-Position: refs/heads/master@{#426823} |