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

Unified Diff: components/gcm_driver/instance_id/instance_id_impl.cc

Issue 2111973002: Add support for GCM subtypes to desktop Instance ID implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@iid9push
Patch Set: address most of peter's concerns Created 4 years, 5 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_impl.cc
diff --git a/components/gcm_driver/instance_id/instance_id_impl.cc b/components/gcm_driver/instance_id/instance_id_impl.cc
index 74c708a560ac0f07ae46f9e6bb3b6a89d5076b30..90a59513238fcad175df720026128fac18bb4f48 100644
--- a/components/gcm_driver/instance_id/instance_id_impl.cc
+++ b/components/gcm_driver/instance_id/instance_id_impl.cc
@@ -49,14 +49,19 @@ InstanceID::Result GCMClientResultToInstanceIDResult(
} // namespace
// static
-std::unique_ptr<InstanceID> InstanceID::Create(const std::string& app_id,
- gcm::GCMDriver* gcm_driver) {
- return base::WrapUnique(new InstanceIDImpl(app_id, gcm_driver));
+std::unique_ptr<InstanceID> InstanceID::CreateInternal(
+ const std::string& app_id,
+ bool use_subtype,
+ gcm::GCMDriver* gcm_driver) {
+ return base::WrapUnique(new InstanceIDImpl(app_id, use_subtype, gcm_driver));
}
InstanceIDImpl::InstanceIDImpl(const std::string& app_id,
+ bool use_subtype,
gcm::GCMDriver* gcm_driver)
- : InstanceID(app_id, gcm_driver), weak_ptr_factory_(this) {
+ : InstanceID(app_id, gcm_driver),
+ use_subtype_(use_subtype),
+ weak_ptr_factory_(this) {
Handler()->GetInstanceIDData(
app_id, base::Bind(&InstanceIDImpl::GetInstanceIDDataCompleted,
weak_ptr_factory_.GetWeakPtr()));
@@ -128,7 +133,7 @@ void InstanceIDImpl::DoGetToken(
const GetTokenCallback& callback) {
EnsureIDGenerated();
- Handler()->GetToken(app_id(), authorized_entity, scope, options,
+ Handler()->GetToken(app_id(), use_subtype_, authorized_entity, scope, options,
base::Bind(&InstanceIDImpl::OnGetTokenCompleted,
weak_ptr_factory_.GetWeakPtr(), callback));
}
@@ -162,9 +167,9 @@ void InstanceIDImpl::DoDeleteToken(
return;
}
- Handler()->DeleteToken(app_id(), authorized_entity, scope,
- base::Bind(&InstanceIDImpl::OnDeleteTokenCompleted,
- weak_ptr_factory_.GetWeakPtr(), callback));
+ Handler()->DeleteToken(app_id(), use_subtype_, authorized_entity, scope,
+ base::Bind(&InstanceIDImpl::OnDeleteTokenCompleted,
+ weak_ptr_factory_.GetWeakPtr(), callback));
}
void InstanceIDImpl::DeleteIDImpl(const DeleteIDCallback& callback) {
@@ -187,8 +192,9 @@ void InstanceIDImpl::DoDeleteID(const DeleteIDCallback& callback) {
}
Handler()->DeleteAllTokensForApp(
- app_id(), base::Bind(&InstanceIDImpl::OnDeleteIDCompleted,
- weak_ptr_factory_.GetWeakPtr(), callback));
+ app_id(), use_subtype_,
+ base::Bind(&InstanceIDImpl::OnDeleteIDCompleted,
+ weak_ptr_factory_.GetWeakPtr(), callback));
Handler()->RemoveInstanceIDData(app_id());

Powered by Google App Engine
This is Rietveld 408576698