| 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 3dffaf2bafcda5e7c5ba61545861da6c89435420..451bb1df8e38449ee0b9c3deeaece6243ed1a397 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
|
| @@ -7,6 +7,7 @@ package org.chromium.chrome.browser.util;
|
| import android.content.ActivityNotFoundException;
|
| import android.content.Context;
|
| import android.content.Intent;
|
| +import android.os.BadParcelableException;
|
| import android.os.Binder;
|
| import android.os.Bundle;
|
| import android.os.IBinder;
|
| @@ -365,4 +366,20 @@ public class IntentUtils {
|
| throw e;
|
| }
|
| }
|
| +
|
| + /**
|
| + * Sanitizes an intent. In case the intent cannot be unparcelled, all extras will be removed to
|
| + * make it safe to use.
|
| + * @return A safe to use version of this intent.
|
| + */
|
| + public static Intent sanitizeIntent(final Intent incomingIntent) {
|
| + if (incomingIntent == null) return null;
|
| + try {
|
| + incomingIntent.getBooleanExtra("TriggerUnparcel", false);
|
| + return incomingIntent;
|
| + } catch (BadParcelableException e) {
|
| + Log.e(TAG, "Invalid incoming intent.", e);
|
| + return incomingIntent.replaceExtras((Bundle) null);
|
| + }
|
| + }
|
| }
|
|
|