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

Issue 2333713003: Move PathUtils to use ContextUtils. (Closed)

Created:
4 years, 3 months ago by Peter Wen
Modified:
4 years, 2 months ago
CC:
chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Move PathUtils to use ContextUtils. PathUtils used to store its own application context in a static variable, assuming that the one it was initialized with was the application context. This can lead to memory leak bugs and with ContextUtils#getApplicationContext client code does not have to store its own reference to the application context. BUG=644377 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_cronet_tester Committed: https://crrev.com/7200e9f34aa2e9006d8ea5540035de744b13d27d Cr-Commit-Position: refs/heads/master@{#423633}

Patch Set 1 #

Patch Set 2 : Fix tests. #

Patch Set 3 : Fix cronet. #

Patch Set 4 : Fix components browsertests. #

Patch Set 5 : Fix tests. #

Patch Set 6 : Add missing setUp. #

Patch Set 7 : Fix telemetry test. #

Patch Set 8 : Depend on previous CL and remove extra params. #

Patch Set 9 : Set upstream. #

Patch Set 10 : Rebase and merge upstream change. #

Patch Set 11 : Add comments. #

Patch Set 12 : Minimize changes. #

Total comments: 4

Patch Set 13 : Fix per review. #

Total comments: 4

Patch Set 14 : Removed implicit super() and obsolete method. #

Patch Set 15 : Switch to attachBaseContext. #

Patch Set 16 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+83 lines, -77 lines) Patch
M android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java View 1 2 3 4 5 6 7 1 chunk +1 line, -2 lines 0 comments Download
M android_webview/javatests/src/org/chromium/android_webview/test/HttpCacheTest.java View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +3 lines, -5 lines 0 comments Download
M base/android/java/src/org/chromium/base/BaseChromiumApplication.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +2 lines, -1 line 0 comments Download
M base/android/java/src/org/chromium/base/PathUtils.java View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +12 lines, -15 lines 0 comments Download
M blimp/client/app/android/java/src/org/chromium/blimp/BlimpApplication.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +5 lines, -3 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +4 lines, -2 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/init/ChromeBrowserInitializer.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -1 line 0 comments Download
M chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +1 line, -3 lines 0 comments Download
M chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabsConnectionTest.java View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastApplication.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +8 lines, -5 lines 0 comments Download
M components/cronet/android/test/javaperftests/src/org/chromium/net/CronetPerfTestActivity.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 9 chunks +14 lines, -7 lines 0 comments Download
M components/cronet/android/test/javatests/src/org/chromium/net/CronetTestBase.java View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -1 line 0 comments Download
M components/invalidation/impl/android/javatests/src/org/chromium/components/invalidation/InvalidationClientServiceTest.java View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -4 lines 0 comments Download
M components/test/android/browsertests_apk/src/org/chromium/components_browsertests_apk/ComponentsBrowserTestsApplication.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +6 lines, -5 lines 0 comments Download
M content/public/test/android/javatests/src/org/chromium/content/browser/test/NativeLibraryTestBase.java View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -2 lines 0 comments Download
M content/shell/android/browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsApplication.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +5 lines, -8 lines 0 comments Download
M content/shell/android/linker_test_apk/src/org/chromium/chromium_linker_test_apk/ChromiumLinkerTestApplication.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +4 lines, -7 lines 0 comments Download
M content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellApplication.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +6 lines, -3 lines 0 comments Download
M testing/android/native_test/java/src/org/chromium/native_test/NativeUnitTest.java View 1 2 3 4 5 6 7 8 9 10 1 chunk +4 lines, -2 lines 0 comments Download

Messages

Total messages: 91 (72 generated)
Peter Wen
4 years, 2 months ago (2016-10-03 17:18:47 UTC) #51
agrieve
https://codereview.chromium.org/2333713003/diff/220001/base/android/java/src/org/chromium/base/PathUtils.java File base/android/java/src/org/chromium/base/PathUtils.java (right): https://codereview.chromium.org/2333713003/diff/220001/base/android/java/src/org/chromium/base/PathUtils.java#newcode128 base/android/java/src/org/chromium/base/PathUtils.java:128: if (ContextUtils.getApplicationContext() == null) { nit: Make this an ...
4 years, 2 months ago (2016-10-03 18:23:54 UTC) #52
agrieve
lgtm /w nits
4 years, 2 months ago (2016-10-03 18:24:09 UTC) #53
Peter Wen
+tedchoc@ for chrome/android, testing/android, content/, and components/test OWNERS. +slan@ for chromecast/ OWNERS. +xunjieli@ for components/cronet ...
4 years, 2 months ago (2016-10-03 21:23:04 UTC) #59
xunjieli
On 2016/10/03 21:23:04, Peter Wen wrote: > +tedchoc@ for chrome/android, testing/android, content/, and components/test > ...
4 years, 2 months ago (2016-10-03 21:27:36 UTC) #60
Ted C
lgtm https://codereview.chromium.org/2333713003/diff/240001/components/test/android/browsertests_apk/src/org/chromium/components_browsertests_apk/ComponentsBrowserTestsApplication.java File components/test/android/browsertests_apk/src/org/chromium/components_browsertests_apk/ComponentsBrowserTestsApplication.java (right): https://codereview.chromium.org/2333713003/diff/240001/components/test/android/browsertests_apk/src/org/chromium/components_browsertests_apk/ComponentsBrowserTestsApplication.java#newcode18 components/test/android/browsertests_apk/src/org/chromium/components_browsertests_apk/ComponentsBrowserTestsApplication.java:18: super(); shouldn't need this right since it is ...
4 years, 2 months ago (2016-10-03 21:43:54 UTC) #61
nyquist
blimp, components/invalidation lgtm
4 years, 2 months ago (2016-10-04 06:17:34 UTC) #64
Torne
android_webview LGTM
4 years, 2 months ago (2016-10-04 12:34:19 UTC) #65
Peter Wen
https://codereview.chromium.org/2333713003/diff/240001/components/test/android/browsertests_apk/src/org/chromium/components_browsertests_apk/ComponentsBrowserTestsApplication.java File components/test/android/browsertests_apk/src/org/chromium/components_browsertests_apk/ComponentsBrowserTestsApplication.java (right): https://codereview.chromium.org/2333713003/diff/240001/components/test/android/browsertests_apk/src/org/chromium/components_browsertests_apk/ComponentsBrowserTestsApplication.java#newcode18 components/test/android/browsertests_apk/src/org/chromium/components_browsertests_apk/ComponentsBrowserTestsApplication.java:18: super(); On 2016/10/03 21:43:53, Ted C wrote: > shouldn't ...
4 years, 2 months ago (2016-10-04 13:13:20 UTC) #68
agrieve
On 2016/10/04 13:13:20, Peter Wen wrote: > https://codereview.chromium.org/2333713003/diff/240001/components/test/android/browsertests_apk/src/org/chromium/components_browsertests_apk/ComponentsBrowserTestsApplication.java > File > components/test/android/browsertests_apk/src/org/chromium/components_browsertests_apk/ComponentsBrowserTestsApplication.java > (right): > ...
4 years, 2 months ago (2016-10-04 16:16:47 UTC) #71
Peter Wen
On 2016/10/04 16:16:47, agrieve > Related: Just noticed today that calling any context methods result ...
4 years, 2 months ago (2016-10-04 17:05:16 UTC) #72
Ted C
On 2016/10/04 16:16:47, agrieve wrote: > On 2016/10/04 13:13:20, Peter Wen wrote: > > > ...
4 years, 2 months ago (2016-10-04 17:31:35 UTC) #77
Peter Wen
Ended up adding a simple not null assert in BaseChromiumApplication#attachBaseContext. @slan - Friendly ping for ...
4 years, 2 months ago (2016-10-05 15:43:28 UTC) #82
slan
On 2016/10/05 15:43:28, Peter Wen wrote: > Ended up adding a simple not null assert ...
4 years, 2 months ago (2016-10-06 17:42:41 UTC) #83
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/2333713003/300001
4 years, 2 months ago (2016-10-06 17:55:11 UTC) #86
Peter Wen
On 2016/10/06 17:42:41, slan wrote: > On 2016/10/05 15:43:28, Peter Wen wrote: > > Ended ...
4 years, 2 months ago (2016-10-06 17:56:17 UTC) #87
commit-bot: I haz the power
Committed patchset #16 (id:300001)
4 years, 2 months ago (2016-10-06 19:39:19 UTC) #88
commit-bot: I haz the power
Patchset 16 (id:??) landed as https://crrev.com/7200e9f34aa2e9006d8ea5540035de744b13d27d Cr-Commit-Position: refs/heads/master@{#423633}
4 years, 2 months ago (2016-10-06 19:41:57 UTC) #90
sgurun-gerrit only
4 years, 2 months ago (2016-10-10 22:53:16 UTC) #91
Message was sent while issue was closed.
A revert of this CL (patchset #16 id:300001) has been created in
https://codereview.chromium.org/2405043002/ by sgurun@chromium.org.

The reason for reverting is: Breaking monochrome (chrome not booting up).
reverted part of other breaks not to introduce a conflict.

BUG=644377, 653771.

Powered by Google App Engine
This is Rietveld 408576698