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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/util/IntentUtils.java

Issue 2411903003: Fix tab redirect to apps in Herb mode. (Closed)
Patch Set: Created 4 years, 2 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: chrome/android/java/src/org/chromium/chrome/browser/util/IntentUtils.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/util/IntentUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/util/IntentUtils.java
index 40952d5cb02d28a8a561b094b7ef413893a1ed13..033beade4ba8411efb8caa105324db5fbfd56572 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/util/IntentUtils.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/util/IntentUtils.java
@@ -43,6 +43,18 @@ public class IntentUtils {
}
/**
+ * Just like {@link Intent#removeExtra(String)} but doesn't throw exceptions.
+ */
+ public static void safeRemoveExtra(Intent intent, String name) {
+ try {
+ intent.removeExtra(name);
+ } catch (Throwable t) {
+ // Catches un-parceling exceptions.
+ Log.e(TAG, "removeExtra failed on intent " + intent);
+ }
+ }
+
+ /**
* Just like {@link Intent#getBooleanExtra(String, boolean)} but doesn't throw exceptions.
*/
public static boolean safeGetBooleanExtra(Intent intent, String name, boolean defaultValue) {

Powered by Google App Engine
This is Rietveld 408576698