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

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

Issue 2847923002: [Chromecast] Add method to CastCdm for the session expiration updating. (Closed)
Patch Set: Add InstanceIDFactory class to help with testing. Created 3 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_driver.cc
diff --git a/components/gcm_driver/instance_id/instance_id_driver.cc b/components/gcm_driver/instance_id/instance_id_driver.cc
index 8e0345b04d6ba853ce84aaef64f5840305cd0639..6916097d6225000a8201b82e5679230c997aae60 100644
--- a/components/gcm_driver/instance_id/instance_id_driver.cc
+++ b/components/gcm_driver/instance_id/instance_id_driver.cc
@@ -9,6 +9,7 @@
#include "build/build_config.h"
#include "components/gcm_driver/gcm_driver.h"
#include "components/gcm_driver/instance_id/instance_id.h"
+#include "components/gcm_driver/instance_id/instance_id_factory.h"
namespace instance_id {
@@ -25,8 +26,10 @@ bool InstanceIDDriver::IsInstanceIDEnabled() {
base::CompareCase::INSENSITIVE_ASCII);
}
-InstanceIDDriver::InstanceIDDriver(gcm::GCMDriver* gcm_driver)
- : gcm_driver_(gcm_driver) {
+InstanceIDDriver::InstanceIDDriver(gcm::GCMDriver* gcm_driver,
+ InstanceIDFactory* factory)
+ : gcm_driver_(gcm_driver), factory_(factory) {
+ DCHECK(factory_);
}
InstanceIDDriver::~InstanceIDDriver() {
@@ -38,7 +41,7 @@ InstanceID* InstanceIDDriver::GetInstanceID(const std::string& app_id) {
return iter->second.get();
std::unique_ptr<InstanceID> instance_id =
- InstanceID::CreateInternal(app_id, gcm_driver_);
+ factory_->Create(app_id, gcm_driver_);
InstanceID* instance_id_ptr = instance_id.get();
instance_id_map_.insert(std::make_pair(app_id, std::move(instance_id)));
return instance_id_ptr;

Powered by Google App Engine
This is Rietveld 408576698