From 75d940d5410c3885cc3d558f5e75ffa72dd5f9c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Gregorczyk?= Date: Tue, 8 Nov 2016 13:16:37 -0800 Subject: [PATCH] 3 more `ReactMarker`s for unpacking bundle to disk. Reviewed By: martinbigio Differential Revision: D4147688 fbshipit-source-id: 44099bbfaa573cf9f187cc55438b56d929438efc --- .../facebook/react/bridge/ReactMarkerConstants.java | 3 +++ .../react/cxxbridge/UnpackingJSBundleLoader.java | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactMarkerConstants.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactMarkerConstants.java index 8aab2c73c..f1fbae600 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactMarkerConstants.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactMarkerConstants.java @@ -35,4 +35,7 @@ public class ReactMarkerConstants { "CREATE_UI_MANAGER_MODULE_CONSTANTS_END"; public static final String CREATE_MODULE_START = "CREATE_MODULE_START"; public static final String CREATE_MODULE_END = "CREATE_MODULE_END"; + public static final String UNPACKER_CHECK_START = "UNPACKER_CHECK_START"; + public static final String UNPACKER_CHECK_END = "UNPACKER_CHECK_END"; + public static final String UNPACKER_BUNDLE_EXTRACTED = "UNPACKER_BUNDLE_EXTRACTED"; } diff --git a/ReactAndroid/src/main/java/com/facebook/react/cxxbridge/UnpackingJSBundleLoader.java b/ReactAndroid/src/main/java/com/facebook/react/cxxbridge/UnpackingJSBundleLoader.java index e667c5d35..a70f82ada 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/cxxbridge/UnpackingJSBundleLoader.java +++ b/ReactAndroid/src/main/java/com/facebook/react/cxxbridge/UnpackingJSBundleLoader.java @@ -13,6 +13,8 @@ import android.content.Context; import android.content.res.AssetManager; import com.facebook.infer.annotation.Assertions; +import com.facebook.react.bridge.ReactMarker; +import com.facebook.react.bridge.ReactMarkerConstants; import com.facebook.soloader.FileLocker; import com.facebook.soloader.SysUtil; import com.facebook.systrace.Systrace; @@ -101,6 +103,8 @@ public class UnpackingJSBundleLoader extends JSBundleLoader { * directory and unpacks everything again. */ /* package */ void prepare() { + ReactMarker.logMarker(ReactMarkerConstants.UNPACKER_CHECK_START); + boolean unpacked = false; try { lock(); @@ -118,9 +122,15 @@ public class UnpackingJSBundleLoader extends JSBundleLoader { throw new RuntimeException(e); } + if (unpacked) { + ReactMarker.logMarker(ReactMarkerConstants.UNPACKER_BUNDLE_EXTRACTED); + } + if (unpacked && mOnUnpackedCallback != null) { mOnUnpackedCallback.run(); } + + ReactMarker.logMarker(ReactMarkerConstants.UNPACKER_CHECK_END); } private boolean prepareLocked() throws IOException {