Metrics for grey box time

Differential Revision: D2619368

fb-gh-sync-id: 4c8105ecff3f4bd0df57042b49ae8b8e722d6b3e
This commit is contained in:
Mike Armstrong 2015-11-04 17:39:20 -08:00 committed by facebook-github-bot-6
parent d3599d0a88
commit 97135ee575

View File

@ -12,6 +12,7 @@ package com.facebook.react.modules.fresco;
import java.util.HashSet;
import android.content.Context;
import android.support.annotation.Nullable;
import com.facebook.cache.common.CacheKey;
import com.facebook.common.internal.AndroidPredicates;
@ -37,10 +38,16 @@ import com.squareup.okhttp.OkHttpClient;
public class FrescoModule extends ReactContextBaseJavaModule implements
ModuleDataCleaner.Cleanable {
@Nullable RequestListener mRequestListener;
public FrescoModule(ReactApplicationContext reactContext) {
super(reactContext);
}
public FrescoModule(ReactApplicationContext reactContext, RequestListener listener) {
super(reactContext);
mRequestListener = listener;
}
@Override
public void initialize() {
@ -57,6 +64,9 @@ public class FrescoModule extends ReactContextBaseJavaModule implements
HashSet<RequestListener> requestListeners = new HashSet<>();
requestListeners.add(new SystraceRequestListener());
if (mRequestListener != null) {
requestListeners.add(mRequestListener);
}
Context context = this.getReactApplicationContext().getApplicationContext();
OkHttpClient okHttpClient = OkHttpClientProvider.getOkHttpClient();