Upgrade to Fresco 1.14.2

Summary: Includes the LeakTracker interface change. Restores the temporarily deleted tracker, wires it back up. Requires Fresco 0.14.2 being released which has yet to happen.

Reviewed By: oprisnik

Differential Revision: D15655667

fbshipit-source-id: ab4361be35101efe7564dfdd7a69cba93135eb7e
This commit is contained in:
Pascal Hartig
2019-06-06 07:58:33 -07:00
committed by Facebook Github Bot
parent dc41e2d778
commit afe7c8bf25
2 changed files with 17 additions and 4 deletions

View File

@@ -13,6 +13,7 @@ import com.facebook.common.internal.Predicate;
import com.facebook.common.memory.manager.DebugMemoryManager;
import com.facebook.common.memory.manager.NoOpDebugMemoryManager;
import com.facebook.common.references.CloseableReference;
import com.facebook.common.references.SharedReference;
import com.facebook.drawee.backends.pipeline.Fresco;
import com.facebook.drawee.backends.pipeline.info.ImageLoadStatus;
import com.facebook.drawee.backends.pipeline.info.ImageOriginUtils;
@@ -47,10 +48,13 @@ import javax.annotation.Nullable;
* Allows Sonar to display the contents of Fresco's caches. This is useful for developers to debug
* what images are being held in cache as they navigate through their app.
*/
public class FrescoFlipperPlugin extends BufferingFlipperPlugin implements ImagePerfDataListener {
public class FrescoFlipperPlugin extends BufferingFlipperPlugin
implements ImagePerfDataListener, CloseableReferenceLeakTracker.Listener {
private static final String FRESCO_EVENT = "events";
private static final String FRESCO_DEBUGOVERLAY_EVENT = "debug_overlay_event";
private static final String FRESCO_CLOSEABLE_REFERENCE_LEAK_EVENT =
"closeable_reference_leak_event";
private static final int BITMAP_PREVIEW_WIDTH = 150;
private static final int BITMAP_PREVIEW_HEIGHT = 150;
@@ -505,4 +509,13 @@ public class FrescoFlipperPlugin extends BufferingFlipperPlugin implements Image
private static void respondError(FlipperResponder responder, String errorReason) {
responder.error(new FlipperObject.Builder().put("reason", errorReason).build());
}
@Override
public void onCloseableReferenceLeak(SharedReference<Object> reference) {
final FlipperObject.Builder builder =
new FlipperObject.Builder()
.put("identityHashCode", System.identityHashCode(reference))
.put("className", reference.get().getClass().getName());
send(FRESCO_CLOSEABLE_REFERENCE_LEAK_EVENT, builder.build());
}
}

View File

@@ -89,7 +89,7 @@ ext.deps = [
testCore : 'androidx.test:core:1.1.0',
testRules : 'androidx.test:rules:1.1.0',
// Plugin dependencies
frescoFlipper : 'com.facebook.fresco:flipper:1.14.1',
frescoStetho : 'com.facebook.fresco:stetho:1.14.1',
fresco : 'com.facebook.fresco:fresco:1.14.1'
frescoFlipper : 'com.facebook.fresco:flipper:1.14.2',
frescoStetho : 'com.facebook.fresco:stetho:1.14.2',
fresco : 'com.facebook.fresco:fresco:1.14.2'
]