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

Unified Diff: components/gcm_driver/gcm_client.h

Issue 1137463003: Support getting and deleting token for Instance ID. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add new files Created 5 years, 7 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_client.h
diff --git a/components/gcm_driver/gcm_client.h b/components/gcm_driver/gcm_client.h
index cd804b2a520300cf9011700f10d3d902f609a32a..743614c02405987c7b6b4c617c8b1bf86d2fc18e 100644
--- a/components/gcm_driver/gcm_client.h
+++ b/components/gcm_driver/gcm_client.h
@@ -10,8 +10,10 @@
#include <vector>
#include "base/basictypes.h"
+#include "base/memory/linked_ptr.h"
#include "base/memory/scoped_ptr.h"
#include "components/gcm_driver/gcm_activity.h"
+#include "components/gcm_driver/registration_info.h"
template <class T> class scoped_refptr;
@@ -163,18 +165,22 @@ class GCMClient {
class Delegate {
public:
// Called when the registration completed successfully or an error occurs.
- // |app_id|: application ID.
+ // |registration_info|: the specific information required for the
+ // registration.
// |registration_id|: non-empty if the registration completed successfully.
// |result|: the type of the error if an error occured, success otherwise.
- virtual void OnRegisterFinished(const std::string& app_id,
- const std::string& registration_id,
- Result result) = 0;
+ virtual void OnRegisterFinished(
+ const linked_ptr<RegistrationInfo>& registration_info,
+ const std::string& registration_id,
+ Result result) = 0;
// Called when the unregistration completed.
- // |app_id|: application ID.
+ // |registration_info|: the specific information required for the
+ // registration.
// |result|: result of the unregistration.
- virtual void OnUnregisterFinished(const std::string& app_id,
- GCMClient::Result result) = 0;
+ virtual void OnUnregisterFinished(
+ const linked_ptr<RegistrationInfo>& registration_info,
+ GCMClient::Result result) = 0;
// Called when the message is scheduled to send successfully or an error
// occurs.
@@ -258,20 +264,24 @@ class GCMClient {
// Stops using the GCM service. This will not erase the persisted data.
virtual void Stop() = 0;
- // Registers the application for GCM. Delegate::OnRegisterFinished will be
- // called asynchronously upon completion.
- // |app_id|: application ID.
- // |sender_ids|: list of IDs of the servers that are allowed to send the
- // messages to the application. These IDs are assigned by the
- // Google API Console.
- virtual void Register(const std::string& app_id,
- const std::vector<std::string>& sender_ids) = 0;
+ // Registers with the server to access the provided service.
+ // Delegate::OnRegisterFinished will be called asynchronously upon completion.
+ // |registration_info|: the specific information required for the
+ // registration. For GCM, it will contain app id and
+ // sender IDs. For InstanceID, it will contain app_id,
+ // authorized entity and scope.
+ virtual void Register(
+ const linked_ptr<RegistrationInfo>& registration_info) = 0;
- // Unregisters the application from GCM when it is uninstalled.
+ // Unregisters from the server to stop accessing the provided service.
// Delegate::OnUnregisterFinished will be called asynchronously upon
// completion.
- // |app_id|: application ID.
- virtual void Unregister(const std::string& app_id) = 0;
+ // |registration_info|: the specific information required for the
+ // registration. For GCM, it will contain app id (sender
+ // IDs can be ingored). For InstanceID, it will contain
+ // app id, authorized entity and scope.
+ virtual void Unregister(
+ const linked_ptr<RegistrationInfo>& registration_info) = 0;
// Sends a message to a given receiver. Delegate::OnSendFinished will be
// called asynchronously upon completion.

Powered by Google App Engine
This is Rietveld 408576698