Bug 1277214 - Add javadoc to explain SafeIntent. r=grisha
authorMichael Comella <michael.l.comella@gmail.com>
Wed, 01 Jun 2016 15:21:36 -0700
changeset 300111 2fe563989bc6f23109d602fc3887cec710709f64
parent 300110 91879ebba4d61fde72af13223708faa01109a4d9
child 300112 107b913db90a41026ea3e0fed50ea24742e8f859
push id30308
push usercbook@mozilla.com
push dateFri, 03 Jun 2016 09:58:06 +0000
treeherdermozilla-central@718e392bad42 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgrisha
bugs1277214
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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) {