Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(749)

Unified Diff: chrome/android/java/proguard.flags

Issue 2150533005: Annotated functions/classes more cleanly kept (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: keeping all native functions Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/android/chrome_public_apk_tmpl.gni ('k') | chrome/android/webapk/shell_apk/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/proguard.flags
diff --git a/chrome/android/java/proguard.flags b/chrome/android/java/proguard.flags
index f4d478ee23fcbf69da7e2bbbdd588e5938a05fc8..f3e6c117344447dea964b0ea1935ba90e6279a45 100644
--- a/chrome/android/java/proguard.flags
+++ b/chrome/android/java/proguard.flags
@@ -1,9 +1,3 @@
-# Keep line number information, useful for stack traces.
--keepattributes SourceFile,LineNumberTable
-
-# Keep the annotations.
--keep @interface ***
-
# Disable obfuscation for the following two packages.
-keepnames,allowoptimization class com.google.android.apps.chrome.**,org.chromium.** {
*;
@@ -14,74 +8,6 @@
-keep public class com.google.android.apps.chrome** extends android.app.Fragment
-keep public class org.chromium** extends android.app.Fragment
-# Keeps for class level annotations.
--keep @**.UsedByReflection class *
--keep @**.VisibleForTesting class *
-
-# Keeps for method level annotations.
--keepclasseswithmembers class com.google.android.apps.chrome.** {
- @**.AccessedByNative <fields>;
-}
--keepclasseswithmembers class com.google.android.apps.chrome.** {
- @**.CalledByNative <methods>;
-}
--keepclasseswithmembers class com.google.android.apps.chrome.** {
- @**.CalledByNativeUnchecked <methods>;
-}
--keepclasseswithmembers class com.google.android.apps.chrome.** {
- @**.JavascriptInterface <methods>;
-}
--keepclasseswithmembers class com.google.android.apps.chrome.** {
- @**.NativeCall <methods>;
-}
--keepclasseswithmembers class com.google.android.apps.chrome.** {
- @**.UsedByReflection <methods>;
-}
--keepclasseswithmembers class com.google.android.apps.chrome.** {
- @**.VisibleForTesting <methods>;
-}
--keepclasseswithmembers class com.google.android.apps.chrome.** {
- native <methods>;
-}
--keepclasseswithmembers class org.chromium.** {
- @**.AccessedByNative <fields>;
-}
--keepclasseswithmembers class org.chromium.** {
- @**.CalledByNative <methods>;
-}
--keepclasseswithmembers class org.chromium.** {
- @**.CalledByNativeUnchecked <methods>;
-}
--keepclasseswithmembers class org.chromium.** {
- @**.JavascriptInterface <methods>;
-}
--keepclasseswithmembers class org.chromium.** {
- @**.NativeCall <methods>;
-}
--keepclasseswithmembers class org.chromium.** {
- @**.UsedByReflection <methods>;
-}
--keepclasseswithmembers class org.chromium.** {
- @**.VisibleForTesting <methods>;
-}
--keepclasseswithmembers class org.chromium.** {
- native <methods>;
-}
-
-# Class merging provides negligible .dex size reduction and method count
-# reduction (about 0.3% improvement on method count, and 0.1% savings on size),
-# and it messes up stack traces if the classes are optimized. Thus, it is in our
-# best interests to turn it off. See crbug.com/620323
--optimizations !class/merging/*
-
-# Keep all runtime visible annotations
--keepattributes RuntimeVisibleAnnotations
-
-# Remove methods annotated with this if their return value is unused
--assumenosideeffects class ** {
- @org.chromium.base.annotations.RemovableInRelease <methods>;
-}
-
# TODO(aurimas): figure out why we need to keep these classes.
-keep class org.chromium.base.test.** {
*;
@@ -103,14 +29,6 @@
*;
}
-# Keep all enum values and valueOf methods. See
-# http://proguard.sourceforge.net/index.html#manual/examples.html
-# for the reason for this. Also, see http://crbug.com/248037.
--keepclassmembers enum * {
- public static **[] values();
- public static ** valueOf(java.lang.String);
-}
-
# Keep all Parcelables as they might be marshalled outside Chrome.
-keepnames class * implements android.os.Parcelable {
public static final ** CREATOR;
@@ -137,19 +55,6 @@
!static final <fields>;
}
-# Allowing Proguard to change modifiers. This change shrinks the .dex size by
-# ~1.1%, and reduces the method count by ~4.3%.
--allowaccessmodification
-
-# Allows Proguard freedom in removing these log related calls. We ask for debug
-# and verbose logs to be stripped out in base.Log, so we are just ensuring we
-# get rid of all other debug/verbose logs.
--assumenosideeffects class android.util.Log {
- static *** d(...);
- static *** v(...);
- static *** isLoggable(...);
-}
-
# Everything below this is kept because they are referenced by the test APK.
-keep class android.support.v7.mediarouter.R* {
*;
@@ -191,6 +96,13 @@
public *;
}
+# Keeping @VisibleForTesting and its annotated classes + methods
+-keep @interface org.chromium.base.VisibleForTesting
+-keep @org.chromium.base.VisibleForTesting class **
+-keepclasseswithmembers class * {
+ @org.chromium.base.VisibleForTesting <methods>;
+}
+
# Used in tests.
-keep class android.support.v4.view.ViewCompat {
public static int getLayoutDirection(android.view.View);
« no previous file with comments | « chrome/android/chrome_public_apk_tmpl.gni ('k') | chrome/android/webapk/shell_apk/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698