Bug 1277214 - Add javadoc to explain SafeIntent. r=grisha draft
authorMichael Comella <michael.l.comella@gmail.com>
Wed, 01 Jun 2016 15:21:36 -0700
changeset 374141 ff54f55a0eafd51ee91e07aa1b5bc6200af2adb7
parent 373911 4b66897490ab2ab196c44ad9485dd529fe96441c
child 374142 c6ab0adc687381281fb819c836c74897252b3daf
push id19946
push usermichael.l.comella@gmail.com
push dateWed, 01 Jun 2016 23:55:51 +0000
reviewersgrisha
bugs1277214
milestone49.0a1
Bug 1277214 - Add javadoc to explain SafeIntent. r=grisha MozReview-Commit-ID: LqQm6yAKbr5
mobile/android/base/java/org/mozilla/gecko/mozglue/SafeIntentUtils.java
--- a/mobile/android/base/java/org/mozilla/gecko/mozglue/SafeIntentUtils.java
+++ b/mobile/android/base/java/org/mozilla/gecko/mozglue/SafeIntentUtils.java
@@ -19,16 +19,21 @@ public class SafeIntentUtils {
     public static String getStringExtra(final Intent intent, final String name) {
         return new SafeIntent(intent).getStringExtra(name);
     }
 
     public static boolean getBooleanExtra(Intent intent, String name, boolean defaultValue) {
         return new SafeIntent(intent).getBooleanExtra(name, defaultValue);
     }
 
+    /**
+     * External applications can pass values into Intents that can cause us to crash: in defense,
+     * we wrap {@link Intent} and catch the exceptions they may force us to throw. See bug 1090385
+     * for more.
+     */
     public static class SafeIntent {
         private final Intent intent;
 
         public SafeIntent(final Intent intent) {
             this.intent = intent;
         }
 
         public boolean getBooleanExtra(final String name, final boolean defaultValue) {