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

Unified Diff: components/gcm_driver/gcm_driver_android.cc

Issue 2697793004: Push API: Validate storage before returning cached subscriptions (Closed)
Patch Set: Comment out PUSH_GETREGISTRATION_STATUS_PUBLIC_KEY_UNAVAILABLE Created 3 years, 10 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: components/gcm_driver/gcm_driver_android.cc
diff --git a/components/gcm_driver/gcm_driver_android.cc b/components/gcm_driver/gcm_driver_android.cc
index a512e8248d9a045c091c9c2440ec80577d1b26d8..a0fedd5cf650ea7b0d940baba5007154aff8f961 100644
--- a/components/gcm_driver/gcm_driver_android.cc
+++ b/components/gcm_driver/gcm_driver_android.cc
@@ -13,6 +13,7 @@
#include "base/android/jni_string.h"
#include "base/compiler_specific.h"
#include "base/logging.h"
+#include "base/threading/thread_task_runner_handle.h"
#include "jni/GCMDriver_jni.h"
using base::android::AppendJavaStringArrayToStringVector;
@@ -117,6 +118,16 @@ bool GCMDriverAndroid::RegisterJni(JNIEnv* env) {
return RegisterNativesImpl(env);
}
+void GCMDriverAndroid::ValidateRegistration(
+ const std::string& app_id,
+ const std::vector<std::string>& sender_ids,
+ const std::string& registration_id,
+ const ValidateRegistrationCallback& callback) {
+ // gcm_driver doesn't store registration IDs on Android, so assume it's valid.
Peter Beverloo 2017/03/20 23:50:13 Is there something we could do here long-term, lik
johnme 2017/03/30 18:36:38 No, GMSCore has a cache, but it expires, and there
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(callback, true /* is_valid */));
+}
+
void GCMDriverAndroid::OnSignedIn() {
}

Powered by Google App Engine
This is Rietveld 408576698