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

Unified Diff: components/gcm_driver/gcm_driver.h

Issue 683913005: [GCM] Support registration before unregistration finishes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add more comments Created 6 years, 2 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 | components/gcm_driver/gcm_driver.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/gcm_driver/gcm_driver.h
diff --git a/components/gcm_driver/gcm_driver.h b/components/gcm_driver/gcm_driver.h
index d099f1bfa1287a2245277d40f2a444e611db81d2..354d6a0ba2bc69334fad91c5661563a21e2b736b 100644
--- a/components/gcm_driver/gcm_driver.h
+++ b/components/gcm_driver/gcm_driver.h
@@ -11,6 +11,7 @@
#include "base/callback.h"
#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
#include "base/threading/thread_checker.h"
#include "components/gcm_driver/default_gcm_app_handler.h"
#include "components/gcm_driver/gcm_client.h"
@@ -172,9 +173,13 @@ class GCMDriver {
void ClearCallbacks();
private:
- // Should be called when an app with |app_id| is trying to un/register.
- // Checks whether another un/registration is in progress.
- bool IsAsyncOperationPending(const std::string& app_id) const;
+ // Called after unregistration completes in order to trigger the pending
+ // registration.
+ void RegisterAfterUnregister(
+ const std::string& app_id,
+ const std::vector<std::string>& normalized_sender_ids,
+ const UnregisterCallback& unregister_callback,
+ GCMClient::Result result);
// Callback map (from app_id to callback) for Register.
std::map<std::string, RegisterCallback> register_callbacks_;
@@ -192,6 +197,8 @@ class GCMDriver {
// The default handler when no app handler can be found in the map.
DefaultGCMAppHandler default_app_handler_;
+ base::WeakPtrFactory<GCMDriver> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(GCMDriver);
};
« no previous file with comments | « no previous file | components/gcm_driver/gcm_driver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698