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

Unified Diff: components/gcm_driver/gcm_driver.h

Issue 324913004: Skeleton GCMAppHandler for Push API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile Created 6 years, 6 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 | « components/gcm_driver/gcm_app_handler.h ('k') | 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 e2fe882532c28d68fd2494c96387cebb949af421..921c4123dc3f0bcb4f7c0902c2ce673bb60caf0e 100644
--- a/components/gcm_driver/gcm_driver.h
+++ b/components/gcm_driver/gcm_driver.h
@@ -6,6 +6,7 @@
#define COMPONENTS_GCM_DRIVER_GCM_DRIVER_H_
#include <map>
+#include <set>
#include <string>
#include <vector>
@@ -23,6 +24,7 @@ class GCMAppHandler;
class GCMDriver {
public:
typedef std::map<std::string, GCMAppHandler*> GCMAppHandlerMap;
+ typedef std::set<GCMWildcardAppHandler*> GCMWildcardAppHandlerSet;
typedef base::Callback<void(const std::string& registration_id,
GCMClient::Result result)> RegisterCallback;
typedef base::Callback<void(const std::string& message_id,
@@ -62,17 +64,23 @@ class GCMDriver {
const SendCallback& callback);
const GCMAppHandlerMap& app_handlers() const { return app_handlers_; }
+ const GCMWildcardAppHandlerSet& wildcard_app_handlers() const {
+ return wildcard_app_handlers_;
+ }
// This method must be called before destroying the GCMDriver. Once it has
// been called, no other GCMDriver methods may be used.
virtual void Shutdown();
- // Adds a handler for a given app.
+ // Add/remove the handler for a given app.
virtual void AddAppHandler(const std::string& app_id, GCMAppHandler* handler);
-
- // Remove the handler for a given app.
virtual void RemoveAppHandler(const std::string& app_id);
+ // Add/remove a wildcard app handler. These will be asked if they match when
+ // there is no matching non-wildcard handler for a given app.
+ virtual void AddWildcardAppHandler(GCMWildcardAppHandler* handler);
jianli 2014/06/13 22:51:47 Having 2 versions of adding app handlers seems to
+ virtual void RemoveWildcardAppHandler(GCMWildcardAppHandler* handler);
+
// Enables/disables GCM service.
virtual void Enable() = 0;
virtual void Disable() = 0;
@@ -154,6 +162,9 @@ class GCMDriver {
// The handler is not owned.
GCMAppHandlerMap app_handlers_;
+ // Wildcard app handlers set. These are not owned either.
+ GCMWildcardAppHandlerSet wildcard_app_handlers_;
+
// The default handler when no app handler can be found in the map.
DefaultGCMAppHandler default_app_handler_;
« no previous file with comments | « components/gcm_driver/gcm_app_handler.h ('k') | components/gcm_driver/gcm_driver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698