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

Unified Diff: components/gcm_driver/instance_id/instance_id_android.h

Issue 1899753002: Make InstanceIDBridge fully async to fix strict mode violations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@iid3test
Patch Set: Rebase & tweak lifetime comments Created 4 years, 8 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/instance_id/instance_id_android.h
diff --git a/components/gcm_driver/instance_id/instance_id_android.h b/components/gcm_driver/instance_id/instance_id_android.h
index c5cce21ef01f0f05d29388a860655ee8a51953be..c8e03f8cb0cbfbf8c609f984f0e34714280e7139 100644
--- a/components/gcm_driver/instance_id/instance_id_android.h
+++ b/components/gcm_driver/instance_id/instance_id_android.h
@@ -21,7 +21,8 @@
namespace instance_id {
-// InstanceID implementation for Android.
+// InstanceID implementation for Android. Callbacks other than DeleteIDCallback
+// mustn't synchronously delete this (using InstanceIDDriver::RemoveInstanceID).
jianli 2016/04/26 20:50:55 I don't think we want to allow synchronous deletin
johnme 2016/04/27 09:41:56 Ok, done. DeleteID no longer supports synchronous
class InstanceIDAndroid : public InstanceID {
public:
// Tests depending on InstanceID that run without a nested Java message loop
@@ -56,6 +57,14 @@ class InstanceIDAndroid : public InstanceID {
void DeleteID(const DeleteIDCallback& callback) override;
// Methods called from Java via JNI:
+ void DidGetID(JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj,
+ jint request_id,
+ const base::android::JavaParamRef<jstring>& jid);
+ void DidGetCreationTime(JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj,
+ jint request_id,
+ jlong creation_time_unix_ms);
void DidGetToken(JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj,
jint request_id,
@@ -72,6 +81,8 @@ class InstanceIDAndroid : public InstanceID {
private:
base::android::ScopedJavaGlobalRef<jobject> java_ref_;
+ IDMap<GetIDCallback, IDMapOwnPointer> get_id_callbacks_;
+ IDMap<GetCreationTimeCallback, IDMapOwnPointer> get_creation_time_callbacks_;
IDMap<GetTokenCallback, IDMapOwnPointer> get_token_callbacks_;
IDMap<DeleteTokenCallback, IDMapOwnPointer> delete_token_callbacks_;
IDMap<DeleteIDCallback, IDMapOwnPointer> delete_id_callbacks_;

Powered by Google App Engine
This is Rietveld 408576698