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

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

Issue 1243253004: Pass user gesture bit when chrome handles an intent fired by itself (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix findbugs warning Created 5 years, 4 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 401e2692aeb6307060d0c31794132ca55b41cbe3..a66722fbb97b993774db422ae11a334216a4972f 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
@@ -173,6 +173,19 @@ public class IntentUtils {
}
/**
+ * Just like {@link Intent#getByteArrayExtra(String)} but doesn't throw exceptions.
+ */
+ public static byte[] safeGetByteArrayExtra(Intent intent, String name) {
+ try {
+ return intent.getByteArrayExtra(name);
+ } catch (Throwable t) {
+ // Catches un-parceling exceptions.
+ Log.e(TAG, "getByteArrayExtra failed on intent " + intent);
+ return null;
+ }
+ }
+
+ /**
* @return a Binder from an Intent, or null.
*
* Creates a temporary copy of the extra Bundle, which is required as

Powered by Google App Engine
This is Rietveld 408576698