From dc41e2d7783e3f4c9d784bd24aeae87a750cdaf9 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Thu, 6 Jun 2019 04:50:34 -0700 Subject: [PATCH] Temporarily remove FlipperCloseableReferenceLeakTracker Summary: Ugh, this is the only way we can land the API-breaking next diff. Will be reverted straight after. Reviewed By: oprisnik Differential Revision: D15655666 fbshipit-source-id: c9318e348c187de4562a9a636287cfa7b523356f --- .../plugins/fresco/FrescoFlipperPlugin.java | 21 +------------------ 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/android/src/main/java/com/facebook/flipper/plugins/fresco/FrescoFlipperPlugin.java b/android/src/main/java/com/facebook/flipper/plugins/fresco/FrescoFlipperPlugin.java index ba21d89eb..f5c6f9318 100644 --- a/android/src/main/java/com/facebook/flipper/plugins/fresco/FrescoFlipperPlugin.java +++ b/android/src/main/java/com/facebook/flipper/plugins/fresco/FrescoFlipperPlugin.java @@ -13,7 +13,6 @@ 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; @@ -38,25 +37,20 @@ import com.facebook.imagepipeline.debug.FlipperImageTracker; import com.facebook.imagepipeline.image.CloseableBitmap; import com.facebook.imagepipeline.image.CloseableImage; import java.io.ByteArrayOutputStream; -import java.io.Closeable; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Set; import javax.annotation.Nullable; -import org.json.JSONArray; /** * 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, CloseableReferenceLeakTracker.Listener { +public class FrescoFlipperPlugin extends BufferingFlipperPlugin implements ImagePerfDataListener { 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; @@ -97,10 +91,6 @@ public class FrescoFlipperPlugin extends BufferingFlipperPlugin mMemoryManager = memoryManager; mPerfLogger = perfLogger; mDebugPrefHelper = debugPrefHelper; - - if (closeableReferenceLeakTracker != null) { - closeableReferenceLeakTracker.setListener(this); - } } public FrescoFlipperPlugin() { @@ -515,13 +505,4 @@ public class FrescoFlipperPlugin extends BufferingFlipperPlugin private static void respondError(FlipperResponder responder, String errorReason) { responder.error(new FlipperObject.Builder().put("reason", errorReason).build()); } - - @Override - public void onCloseableReferenceLeak(SharedReference 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()); - } }