Commit 8dc40d0b authored by Anna Malova's avatar Anna Malova Committed by Commit Bot

[WV Support Library] Add a crash key that indicates androidx.webkit version.

Android side: https://android-review.googlesource.com/c/platform/frameworks/support/+/1138298

Bug: 1012753
Change-Id: I6cc6e045fad9044f72cda7f751390abb39fea94a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1848701Reviewed-by: default avatarTobias Sargeant <tobiasjs@chromium.org>
Commit-Queue: Anna Malova <amalova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#710340}
parent 85753fec
...@@ -185,4 +185,12 @@ static void JNI_AwDebug_SetNonWhiteListedKeyForTesting(JNIEnv* env) { ...@@ -185,4 +185,12 @@ static void JNI_AwDebug_SetNonWhiteListedKeyForTesting(JNIEnv* env) {
crash_key.Set("AW_DEBUG_VALUE"); crash_key.Set("AW_DEBUG_VALUE");
} }
static void JNI_AwDebug_SetSupportLibraryWebkitVersionCrashKey(
JNIEnv* env,
const base::android::JavaParamRef<jstring>& version) {
static ::crash_reporter::CrashKeyString<32> crash_key(
crash_keys::kSupportLibraryWebkitVersion);
crash_key.Set(ConvertJavaStringToUTF8(env, version));
}
} // namespace android_webview } // namespace android_webview
...@@ -15,12 +15,15 @@ const char kAppPackageVersionCode[] = "app-package-version-code"; ...@@ -15,12 +15,15 @@ const char kAppPackageVersionCode[] = "app-package-version-code";
const char kAndroidSdkInt[] = "android-sdk-int"; const char kAndroidSdkInt[] = "android-sdk-int";
const char kSupportLibraryWebkitVersion[] = "androidx-webkit-version";
// clang-format off // clang-format off
const char* const kWebViewCrashKeyWhiteList[] = { const char* const kWebViewCrashKeyWhiteList[] = {
"AW_WHITELISTED_DEBUG_KEY", "AW_WHITELISTED_DEBUG_KEY",
kAppPackageName, kAppPackageName,
kAppPackageVersionCode, kAppPackageVersionCode,
kAndroidSdkInt, kAndroidSdkInt,
kSupportLibraryWebkitVersion,
// process type // process type
"ptype", "ptype",
......
...@@ -22,6 +22,8 @@ extern const char kAppPackageVersionCode[]; ...@@ -22,6 +22,8 @@ extern const char kAppPackageVersionCode[];
extern const char kAndroidSdkInt[]; extern const char kAndroidSdkInt[];
extern const char kSupportLibraryWebkitVersion[];
} // namespace crash_keys } // namespace crash_keys
} // namespace android_webview } // namespace android_webview
......
...@@ -55,11 +55,16 @@ public class AwDebug { ...@@ -55,11 +55,16 @@ public class AwDebug {
AwDebugJni.get().setNonWhiteListedKeyForTesting(); AwDebugJni.get().setNonWhiteListedKeyForTesting();
} }
public static void setSupportLibraryWebkitVersionCrashKey(String version) {
AwDebugJni.get().setSupportLibraryWebkitVersionCrashKey(version);
}
@NativeMethods @NativeMethods
interface Natives { interface Natives {
boolean dumpWithoutCrashing(String dumpPath); boolean dumpWithoutCrashing(String dumpPath);
void initCrashKeysForWebViewTesting(); void initCrashKeysForWebViewTesting();
void setWhiteListedKeyForTesting(); void setWhiteListedKeyForTesting();
void setNonWhiteListedKeyForTesting(); void setNonWhiteListedKeyForTesting();
void setSupportLibraryWebkitVersionCrashKey(String version);
} }
} }
...@@ -18,4 +18,5 @@ public interface WebViewProviderFactoryBoundaryInterface { ...@@ -18,4 +18,5 @@ public interface WebViewProviderFactoryBoundaryInterface {
/* SupportLibraryServiceWorkerController */ InvocationHandler getServiceWorkerController(); /* SupportLibraryServiceWorkerController */ InvocationHandler getServiceWorkerController();
/* SupportLibraryTracingController */ InvocationHandler getTracingController(); /* SupportLibraryTracingController */ InvocationHandler getTracingController();
/* SupportLibraryProxyController */ InvocationHandler getProxyController(); /* SupportLibraryProxyController */ InvocationHandler getProxyController();
void setSupportLibraryVersion(String version);
} }
...@@ -173,4 +173,7 @@ public class Features { ...@@ -173,4 +173,7 @@ public class Features {
// WebViewCompat.addWebMessageListener // WebViewCompat.addWebMessageListener
// WebViewCompat.removeWebMessageListener // WebViewCompat.removeWebMessageListener
public static final String WEB_MESSAGE_LISTENER = "WEB_MESSAGE_LISTENER"; public static final String WEB_MESSAGE_LISTENER = "WEB_MESSAGE_LISTENER";
// WebViewProviderFactoryAdapter.setSupportLibraryVersion
public static final String SET_SUPPORT_LIBRARY_VERSION = "SET_SUPPORT_LIBRARY_VERSION";
} }
...@@ -15,6 +15,7 @@ import com.android.webview.chromium.SharedTracingControllerAdapter; ...@@ -15,6 +15,7 @@ import com.android.webview.chromium.SharedTracingControllerAdapter;
import com.android.webview.chromium.WebViewChromiumAwInit; import com.android.webview.chromium.WebViewChromiumAwInit;
import com.android.webview.chromium.WebkitToSharedGlueConverter; import com.android.webview.chromium.WebkitToSharedGlueConverter;
import org.chromium.android_webview.AwDebug;
import org.chromium.support_lib_boundary.StaticsBoundaryInterface; import org.chromium.support_lib_boundary.StaticsBoundaryInterface;
import org.chromium.support_lib_boundary.WebViewProviderFactoryBoundaryInterface; import org.chromium.support_lib_boundary.WebViewProviderFactoryBoundaryInterface;
import org.chromium.support_lib_boundary.util.BoundaryInterfaceReflectionUtil; import org.chromium.support_lib_boundary.util.BoundaryInterfaceReflectionUtil;
...@@ -74,6 +75,7 @@ class SupportLibWebViewChromiumFactory implements WebViewProviderFactoryBoundary ...@@ -74,6 +75,7 @@ class SupportLibWebViewChromiumFactory implements WebViewProviderFactoryBoundary
Features.FORCE_DARK, Features.FORCE_DARK,
Features.FORCE_DARK_BEHAVIOR + Features.DEV_SUFFIX, Features.FORCE_DARK_BEHAVIOR + Features.DEV_SUFFIX,
Features.WEB_MESSAGE_LISTENER + Features.DEV_SUFFIX, Features.WEB_MESSAGE_LISTENER + Features.DEV_SUFFIX,
Features.SET_SUPPORT_LIBRARY_VERSION + Features.DEV_SUFFIX,
}; };
// clang-format on // clang-format on
...@@ -182,4 +184,9 @@ class SupportLibWebViewChromiumFactory implements WebViewProviderFactoryBoundary ...@@ -182,4 +184,9 @@ class SupportLibWebViewChromiumFactory implements WebViewProviderFactoryBoundary
} }
return mProxyController; return mProxyController;
} }
@Override
public void setSupportLibraryVersion(String version) {
AwDebug.setSupportLibraryWebkitVersionCrashKey(version);
}
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment