3 more `ReactMarker`s for unpacking bundle to disk.

Reviewed By: martinbigio

Differential Revision: D4147688

fbshipit-source-id: 44099bbfaa573cf9f187cc55438b56d929438efc
This commit is contained in:
Michał Gregorczyk 2016-11-08 13:16:37 -08:00 committed by Facebook Github Bot
parent bd3be5bd24
commit 75d940d541
2 changed files with 13 additions and 0 deletions

View File

@ -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";
}

View File

@ -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 {