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

Issue 2578233002: Remove title resources when they are no longer used (Closed)

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

Description

Remove title resources when they are no longer used Previously, layer titles found their way into the resource manager as ANDROID_RESOURCE_TYPE_DYNAMIC_BITMAP and were left there forever. Over time, these recources accumulated (easily reproducable by entering and exiting the tab switcher) and is more than likely the cause of memory related crashes when entering the tab switcher. The title layer itself was removed from the LayerTitleCache but the resources that constitute the title were never correctly managed. This change adds a function to the ResourceManager that allows the LayerTitleCache to remove associated resources. Specifically, only dynamic bitmaps can be manually removed. BUG=669348 Review-Url: https://codereview.chromium.org/2578233002 Cr-Commit-Position: refs/heads/master@{#441773} Committed: https://chromium.googlesource.com/chromium/src/+/e69847f70e6461ae430b28f8c8912513890648c5

Patch Set 1 #

Patch Set 2 : nit #

Patch Set 3 : responsibility change #

Total comments: 8

Patch Set 4 : address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+44 lines, -1 line) Patch
M ui/android/java/src/org/chromium/ui/resources/ResourceLoader.java View 1 2 3 2 chunks +19 lines, -0 lines 0 comments Download
M ui/android/java/src/org/chromium/ui/resources/ResourceManager.java View 1 2 3 2 chunks +10 lines, -0 lines 0 comments Download
M ui/android/java/src/org/chromium/ui/resources/dynamics/DynamicResourceLoader.java View 1 2 3 2 chunks +2 lines, -1 line 0 comments Download
M ui/android/resources/resource_manager_impl.h View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M ui/android/resources/resource_manager_impl.cc View 1 2 3 1 chunk +8 lines, -0 lines 0 comments Download

Messages

Total messages: 15 (6 generated)
mdjones
An argument can probably be made to have the eviction logic somewhere else, but I ...
4 years ago (2016-12-15 19:30:39 UTC) #2
aelias_OOO_until_Jul13
lgtm
4 years ago (2016-12-15 21:08:22 UTC) #3
mdjones
As per discussion with dtrainor, I updated the implementation so that LayerTitleCache is responsible for ...
4 years ago (2016-12-16 22:36:09 UTC) #4
mdjones
https://codereview.chromium.org/2578233002/diff/40001/ui/android/java/src/org/chromium/ui/resources/dynamics/DynamicResourceLoader.java File ui/android/java/src/org/chromium/ui/resources/dynamics/DynamicResourceLoader.java (right): https://codereview.chromium.org/2578233002/diff/40001/ui/android/java/src/org/chromium/ui/resources/dynamics/DynamicResourceLoader.java#newcode47 ui/android/java/src/org/chromium/ui/resources/dynamics/DynamicResourceLoader.java:47: mCallback.onResourceUnregistered(AndroidResourceType.DYNAMIC_BITMAP, resId); Should I instead have this in ResourceManager?
4 years ago (2016-12-16 22:38:36 UTC) #6
David Trainor- moved to gerrit
https://codereview.chromium.org/2578233002/diff/40001/ui/android/java/src/org/chromium/ui/resources/ResourceLoader.java File ui/android/java/src/org/chromium/ui/resources/ResourceLoader.java (right): https://codereview.chromium.org/2578233002/diff/40001/ui/android/java/src/org/chromium/ui/resources/ResourceLoader.java#newcode27 ui/android/java/src/org/chromium/ui/resources/ResourceLoader.java:27: * Called when a resource is unregistered (unneeded). Since ...
3 years, 11 months ago (2017-01-03 19:26:21 UTC) #7
mdjones
https://codereview.chromium.org/2578233002/diff/40001/ui/android/java/src/org/chromium/ui/resources/ResourceLoader.java File ui/android/java/src/org/chromium/ui/resources/ResourceLoader.java (right): https://codereview.chromium.org/2578233002/diff/40001/ui/android/java/src/org/chromium/ui/resources/ResourceLoader.java#newcode27 ui/android/java/src/org/chromium/ui/resources/ResourceLoader.java:27: * Called when a resource is unregistered (unneeded). On ...
3 years, 11 months ago (2017-01-04 17:40:10 UTC) #8
David Trainor- moved to gerrit
lgtm https://codereview.chromium.org/2578233002/diff/40001/ui/android/java/src/org/chromium/ui/resources/dynamics/DynamicResourceLoader.java File ui/android/java/src/org/chromium/ui/resources/dynamics/DynamicResourceLoader.java (right): https://codereview.chromium.org/2578233002/diff/40001/ui/android/java/src/org/chromium/ui/resources/dynamics/DynamicResourceLoader.java#newcode47 ui/android/java/src/org/chromium/ui/resources/dynamics/DynamicResourceLoader.java:47: mCallback.onResourceUnregistered(AndroidResourceType.DYNAMIC_BITMAP, resId); On 2017/01/04 17:40:10, mdjones wrote: > ...
3 years, 11 months ago (2017-01-05 21:25:31 UTC) #9
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/2578233002/60001
3 years, 11 months ago (2017-01-05 21:43:01 UTC) #12
commit-bot: I haz the power
3 years, 11 months ago (2017-01-05 22:22:29 UTC) #15
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as
https://chromium.googlesource.com/chromium/src/+/e69847f70e6461ae430b28f8c891...

Powered by Google App Engine
This is Rietveld 408576698