mirror of
https://github.com/status-im/react-native.git
synced 2025-01-28 02:04:55 +00:00
Metrics for grey box time
Differential Revision: D2619368 fb-gh-sync-id: 4c8105ecff3f4bd0df57042b49ae8b8e722d6b3e
This commit is contained in:
parent
d3599d0a88
commit
97135ee575
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user