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

Unified Diff: base/android/java/src/org/chromium/base/UsedByReflection.java

Issue 183333002: Cronet Java wrappers to fallback to HttpUrlConnection if Cronet is not available. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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
Index: base/android/java/src/org/chromium/base/UsedByReflection.java
diff --git a/base/android/java/src/org/chromium/base/UsedByReflection.java b/base/android/java/src/org/chromium/base/UsedByReflection.java
new file mode 100644
index 0000000000000000000000000000000000000000..1ebba44b97f2065f8c56e17d9c44601fb4449db3
--- /dev/null
+++ b/base/android/java/src/org/chromium/base/UsedByReflection.java
@@ -0,0 +1,35 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
mmenke 2014/03/07 17:02:39 Should again maintain the copyright years on these
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.base;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation used for marking methods and fields that are called by reflection. Useful for keeping
+ * components that would otherwise be removed by Proguard. Use the value parameter to mention a file
mmenke 2014/03/07 17:02:39 nit: Fix indent.
+ * that calls this method.
+ *
+ * Note that adding this annotation to a method is not enough to guarantee that
+ * it is kept - either its class must be referenced elsewhere in the program, or
+ * the class must be annotated with this as well.
+ *
+ * Usage example:<br />
+ * {@code
+ * @UsedByReflection("PeopleListItemView.java")
+ public PeopleListItemViewV11(Context context) {
+ super(context);
+ }
+ }
+
mmenke 2014/03/07 17:02:39 This comment is practically illegible.
mmenke 2014/03/07 20:47:28 To clarify: A bunch of lines are missing asterisk
Charles 2014/03/07 21:31:15 You can actually get rid of these annotations, chr
+ */
+@Target({
+ ElementType.METHOD,
+ ElementType.FIELD,
+ ElementType.TYPE,
+ ElementType.CONSTRUCTOR})
+public @interface UsedByReflection {
mef 2014/03/07 20:54:12 The |UsedByReflection| annotation has not been use
Charles 2014/03/07 21:31:15 These should probably be replaced by Chromium's pr
+ String value();
+}

Powered by Google App Engine
This is Rietveld 408576698