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

Unified Diff: ui/android/java/src/org/chromium/ui/resources/ResourceManager.java

Issue 2578233002: Remove title resources when they are no longer used (Closed)
Patch Set: address comments Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/android/java/src/org/chromium/ui/resources/ResourceManager.java
diff --git a/ui/android/java/src/org/chromium/ui/resources/ResourceManager.java b/ui/android/java/src/org/chromium/ui/resources/ResourceManager.java
index 9a8f1dc5b8b6750581c7120729a8411008c1a71a..0063df238bfba00a270a4019cd13bac8aef9f173 100644
--- a/ui/android/java/src/org/chromium/ui/resources/ResourceManager.java
+++ b/ui/android/java/src/org/chromium/ui/resources/ResourceManager.java
@@ -167,6 +167,14 @@ public class ResourceManager implements ResourceLoaderCallback {
aperture.left, aperture.top, aperture.right, aperture.bottom);
}
+ @Override
+ public void onResourceUnregistered(int resType, int resId) {
+ // Only remove dynamic bitmaps that were unregistered.
+ if (resType != AndroidResourceType.DYNAMIC_BITMAP) return;
+
+ nativeRemoveResource(mNativeResourceManagerPtr, resType, resId);
+ }
+
/**
* Clear the cache of tinted assets that the native manager holds.
*/
@@ -234,6 +242,8 @@ public class ResourceManager implements ResourceLoaderCallback {
int unscaledSpriteHeight, float scaledSpriteWidth, float scaledSpriteHeight);
private native void nativeOnCrushedSpriteResourceReloaded(long nativeResourceManagerImpl,
int bitmapResId, Bitmap bitmap);
+ private native void nativeRemoveResource(long nativeResourceManagerImpl, int resType,
+ int resId);
private native void nativeClearTintedResourceCache(long nativeResourceManagerImpl);
}

Powered by Google App Engine
This is Rietveld 408576698