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

Unified Diff: components/gcm_driver/android/java/src/org/chromium/components/gcm_driver/GCMDriver.java

Issue 2265543002: GCM: Handle non-Strings in incoming message Bundle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/gcm_driver/android/java/src/org/chromium/components/gcm_driver/GCMDriver.java
diff --git a/components/gcm_driver/android/java/src/org/chromium/components/gcm_driver/GCMDriver.java b/components/gcm_driver/android/java/src/org/chromium/components/gcm_driver/GCMDriver.java
index a404333602514843fad270295cf63b5781dca2d4..f1a47e3babac0b811ebe5516c72bd05b238395f8 100644
--- a/components/gcm_driver/android/java/src/org/chromium/components/gcm_driver/GCMDriver.java
+++ b/components/gcm_driver/android/java/src/org/chromium/components/gcm_driver/GCMDriver.java
@@ -136,10 +136,15 @@ public class GCMDriver {
// TODO(johnme): Check there aren't other keys that we need to exclude.
if (key.equals(bundleSubtype) || key.equals(bundleSenderId)
|| key.equals(bundleCollapseKey) || key.equals(bundleRawData)
- || key.startsWith(bundleGcmplex))
+ || key.startsWith(bundleGcmplex)) {
continue;
+ }
+ Object value = extras.get(key);
+ if (!(value instanceof String)) {
+ continue;
+ }
dataKeysAndValues.add(key);
- dataKeysAndValues.add(extras.getString(key));
+ dataKeysAndValues.add((String) value);
}
sInstance.nativeOnMessageReceived(sInstance.mNativeGCMDriverAndroid,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698