Remove code for accounts from GCM
Account tracking was disabled in crrev.com/c/4516239, this CL removes the remaining code from some GCM files. This is a part of a chain of CLs to remove account tracking from the gcm_driver component. Bug: 40067875 Change-Id: I649d25a74e333d34fc179ec97767d2a33492d67b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6197084 Auto-Submit: Rushan Suleymanov <rushans@google.com> Reviewed-by: Peter Beverloo <peter@chromium.org> Commit-Queue: Peter Beverloo <peter@chromium.org> Cr-Commit-Position: refs/heads/main@{#1411618}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
e3b5860aa2
commit
59c708b845
@ -249,20 +249,10 @@ GCMClientImpl::CheckinInfo::CheckinInfo()
|
||||
|
||||
GCMClientImpl::CheckinInfo::~CheckinInfo() = default;
|
||||
|
||||
void GCMClientImpl::CheckinInfo::SnapshotCheckinAccounts() {
|
||||
last_checkin_accounts.clear();
|
||||
for (auto iter = account_tokens.begin(); iter != account_tokens.end();
|
||||
++iter) {
|
||||
last_checkin_accounts.insert(iter->first);
|
||||
}
|
||||
}
|
||||
|
||||
void GCMClientImpl::CheckinInfo::Reset() {
|
||||
android_id = 0;
|
||||
secret = 0;
|
||||
accounts_set = false;
|
||||
account_tokens.clear();
|
||||
last_checkin_accounts.clear();
|
||||
}
|
||||
|
||||
GCMClientImpl::GCMClientImpl(
|
||||
@ -370,14 +360,7 @@ void GCMClientImpl::OnLoadCompleted(
|
||||
|
||||
device_checkin_info_.android_id = result->device_android_id;
|
||||
device_checkin_info_.secret = result->device_security_token;
|
||||
device_checkin_info_.last_checkin_accounts = result->last_checkin_accounts;
|
||||
// A case where there were previously no accounts reported with checkin is
|
||||
// considered to be the same as when the list of accounts is empty. It enables
|
||||
// scheduling a periodic checkin for devices with no signed in users
|
||||
// immediately after restart, while keeping |accounts_set == false| delays the
|
||||
// checkin until the list of accounts is set explicitly.
|
||||
if (result->last_checkin_accounts.size() == 0)
|
||||
device_checkin_info_.accounts_set = true;
|
||||
device_checkin_info_.accounts_set = true;
|
||||
last_checkin_time_ = result->last_checkin_time;
|
||||
gservices_settings_.UpdateFromLoadResult(*result);
|
||||
|
||||
@ -530,12 +513,6 @@ void GCMClientImpl::SetAccountTokens(
|
||||
const std::vector<AccountTokenInfo>& account_tokens) {
|
||||
DCHECK(io_task_runner_->RunsTasksInCurrentSequence());
|
||||
|
||||
device_checkin_info_.account_tokens.clear();
|
||||
for (auto iter = account_tokens.begin(); iter != account_tokens.end();
|
||||
++iter) {
|
||||
device_checkin_info_.account_tokens[iter->email] = iter->access_token;
|
||||
}
|
||||
|
||||
bool accounts_set_before = device_checkin_info_.accounts_set;
|
||||
device_checkin_info_.accounts_set = true;
|
||||
|
||||
@ -545,26 +522,7 @@ void GCMClientImpl::SetAccountTokens(
|
||||
if (state_ != READY && state_ != INITIAL_DEVICE_CHECKIN)
|
||||
return;
|
||||
|
||||
bool account_removed = false;
|
||||
for (auto iter = device_checkin_info_.last_checkin_accounts.begin();
|
||||
iter != device_checkin_info_.last_checkin_accounts.end(); ++iter) {
|
||||
if (device_checkin_info_.account_tokens.find(*iter) ==
|
||||
device_checkin_info_.account_tokens.end()) {
|
||||
account_removed = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Checkin will be forced when any of the accounts was removed during the
|
||||
// current Chrome session or if there has been an account removed between the
|
||||
// restarts of Chrome. If there is a checkin in progress, it will be canceled.
|
||||
// We only force checkin when user signs out. When there is a new account
|
||||
// signed in, the periodic checkin will take care of adding the association in
|
||||
// reasonable time.
|
||||
if (account_removed) {
|
||||
DVLOG(1) << "Detected that account has been removed. Forcing checkin.";
|
||||
checkin_request_.reset();
|
||||
StartCheckin();
|
||||
} else if (!accounts_set_before) {
|
||||
if (!accounts_set_before) {
|
||||
SchedulePeriodicCheckin();
|
||||
DVLOG(1) << "Accounts set for the first time. Scheduled periodic checkin.";
|
||||
}
|
||||
@ -661,19 +619,14 @@ void GCMClientImpl::StartCheckin() {
|
||||
checkin_proto::ChromeBuildProto chrome_build_proto;
|
||||
ToCheckinProtoVersion(chrome_build_info_, &chrome_build_proto);
|
||||
|
||||
std::map<std::string, std::string> empty_account_tokens;
|
||||
|
||||
CheckinRequest::RequestInfo request_info(
|
||||
device_checkin_info_.android_id, device_checkin_info_.secret,
|
||||
empty_account_tokens, gservices_settings_.digest(), chrome_build_proto);
|
||||
gservices_settings_.digest(), chrome_build_proto);
|
||||
checkin_request_ = std::make_unique<CheckinRequest>(
|
||||
gservices_settings_.GetCheckinURL(), request_info, GetGCMBackoffPolicy(),
|
||||
base::BindOnce(&GCMClientImpl::OnCheckinCompleted,
|
||||
weak_ptr_factory_.GetWeakPtr()),
|
||||
url_loader_factory_, io_task_runner_, &recorder_);
|
||||
// Taking a snapshot of the accounts count here, as there might be an asynch
|
||||
// update of the account tokens while checkin is in progress.
|
||||
device_checkin_info_.SnapshotCheckinAccounts();
|
||||
checkin_request_->Start();
|
||||
}
|
||||
|
||||
@ -718,7 +671,7 @@ void GCMClientImpl::OnCheckinCompleted(
|
||||
|
||||
last_checkin_time_ = clock_->Now();
|
||||
gcm_store_->SetLastCheckinInfo(
|
||||
last_checkin_time_, device_checkin_info_.last_checkin_accounts,
|
||||
last_checkin_time_,
|
||||
base::BindOnce(&GCMClientImpl::SetLastCheckinInfoCallback,
|
||||
weak_ptr_factory_.GetWeakPtr()));
|
||||
SchedulePeriodicCheckin();
|
||||
|
@ -176,7 +176,6 @@ class GCMClientImpl
|
||||
CheckinInfo();
|
||||
~CheckinInfo();
|
||||
bool IsValid() const { return android_id != 0 && secret != 0; }
|
||||
void SnapshotCheckinAccounts();
|
||||
void Reset();
|
||||
|
||||
// Android ID of the device as assigned by the server.
|
||||
@ -186,11 +185,6 @@ class GCMClientImpl
|
||||
// True if accounts were already provided through SetAccountsForCheckin(),
|
||||
// or when |last_checkin_accounts| was loaded as empty.
|
||||
bool accounts_set;
|
||||
// Map of account email addresses and OAuth2 tokens that will be sent to the
|
||||
// checkin server on a next checkin.
|
||||
std::map<std::string, std::string> account_tokens;
|
||||
// As set of accounts last checkin was completed with.
|
||||
std::set<std::string> last_checkin_accounts;
|
||||
};
|
||||
|
||||
// Reasons for resetting the GCM Store.
|
||||
|
@ -118,16 +118,6 @@ GCMClient::AccountTokenInfo MakeAccountToken(const std::string& email,
|
||||
return account_token;
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> MakeEmailToTokenMap(
|
||||
const std::vector<GCMClient::AccountTokenInfo>& account_tokens) {
|
||||
std::map<std::string, std::string> email_token_map;
|
||||
for (auto iter = account_tokens.begin(); iter != account_tokens.end();
|
||||
++iter) {
|
||||
email_token_map[iter->email] = iter->access_token;
|
||||
}
|
||||
return email_token_map;
|
||||
}
|
||||
|
||||
class FakeMCSClient : public MCSClient {
|
||||
public:
|
||||
FakeMCSClient(base::Clock* clock,
|
||||
@ -719,9 +709,7 @@ TEST_F(GCMClientImplTest, LoadingCompleted) {
|
||||
// Checking freshly loaded CheckinInfo.
|
||||
EXPECT_EQ(kDeviceAndroidId, device_checkin_info().android_id);
|
||||
EXPECT_EQ(kDeviceSecurityToken, device_checkin_info().secret);
|
||||
EXPECT_TRUE(device_checkin_info().last_checkin_accounts.empty());
|
||||
EXPECT_TRUE(device_checkin_info().accounts_set);
|
||||
EXPECT_TRUE(device_checkin_info().account_tokens.empty());
|
||||
}
|
||||
|
||||
TEST_F(GCMClientImplTest, LoadingBusted) {
|
||||
@ -1271,112 +1259,14 @@ TEST_F(GCMClientImplCheckinTest, CheckinWithAccountsEmpty) {
|
||||
account_tokens.push_back(MakeAccountToken("test_user2@gmail.com", "token2"));
|
||||
gcm_client()->SetAccountTokens(account_tokens);
|
||||
|
||||
EXPECT_TRUE(device_checkin_info().last_checkin_accounts.empty());
|
||||
EXPECT_TRUE(device_checkin_info().accounts_set);
|
||||
EXPECT_EQ(MakeEmailToTokenMap(account_tokens),
|
||||
device_checkin_info().account_tokens);
|
||||
|
||||
PumpLoopUntilIdle();
|
||||
ASSERT_NO_FATAL_FAILURE(
|
||||
CompleteCheckin(kDeviceAndroidId, kDeviceSecurityToken,
|
||||
GServicesSettings::CalculateDigest(settings), settings));
|
||||
|
||||
std::set<std::string> accounts;
|
||||
accounts.insert("test_user1@gmail.com");
|
||||
accounts.insert("test_user2@gmail.com");
|
||||
EXPECT_EQ(accounts, device_checkin_info().last_checkin_accounts);
|
||||
EXPECT_TRUE(device_checkin_info().accounts_set);
|
||||
EXPECT_EQ(MakeEmailToTokenMap(account_tokens),
|
||||
device_checkin_info().account_tokens);
|
||||
|
||||
// Make sure the checkin request does not have the account info.
|
||||
EXPECT_TRUE(checkin_request().request_info_.account_tokens.empty());
|
||||
}
|
||||
|
||||
// This test only checks that periodic checkin happens.
|
||||
TEST_F(GCMClientImplCheckinTest, CheckinWhenAccountRemoved) {
|
||||
std::map<std::string, std::string> settings;
|
||||
settings["checkin_interval"] = base::NumberToString(kSettingsCheckinInterval);
|
||||
settings["checkin_url"] = "http://alternative.url/checkin";
|
||||
settings["gcm_hostname"] = "alternative.gcm.host";
|
||||
settings["gcm_secure_port"] = "7777";
|
||||
settings["gcm_registration_url"] = "http://alternative.url/registration";
|
||||
ASSERT_NO_FATAL_FAILURE(
|
||||
CompleteCheckin(kDeviceAndroidId, kDeviceSecurityToken,
|
||||
GServicesSettings::CalculateDigest(settings), settings));
|
||||
|
||||
std::vector<GCMClient::AccountTokenInfo> account_tokens;
|
||||
account_tokens.push_back(MakeAccountToken("test_user1@gmail.com", "token1"));
|
||||
account_tokens.push_back(MakeAccountToken("test_user2@gmail.com", "token2"));
|
||||
gcm_client()->SetAccountTokens(account_tokens);
|
||||
PumpLoopUntilIdle();
|
||||
ASSERT_NO_FATAL_FAILURE(
|
||||
CompleteCheckin(kDeviceAndroidId, kDeviceSecurityToken,
|
||||
GServicesSettings::CalculateDigest(settings), settings));
|
||||
|
||||
EXPECT_EQ(2UL, device_checkin_info().last_checkin_accounts.size());
|
||||
EXPECT_TRUE(device_checkin_info().accounts_set);
|
||||
EXPECT_EQ(MakeEmailToTokenMap(account_tokens),
|
||||
device_checkin_info().account_tokens);
|
||||
|
||||
account_tokens.erase(account_tokens.begin() + 1);
|
||||
gcm_client()->SetAccountTokens(account_tokens);
|
||||
|
||||
PumpLoopUntilIdle();
|
||||
ASSERT_NO_FATAL_FAILURE(
|
||||
CompleteCheckin(kDeviceAndroidId, kDeviceSecurityToken,
|
||||
GServicesSettings::CalculateDigest(settings), settings));
|
||||
|
||||
std::set<std::string> accounts;
|
||||
accounts.insert("test_user1@gmail.com");
|
||||
EXPECT_EQ(accounts, device_checkin_info().last_checkin_accounts);
|
||||
EXPECT_TRUE(device_checkin_info().accounts_set);
|
||||
EXPECT_EQ(MakeEmailToTokenMap(account_tokens),
|
||||
device_checkin_info().account_tokens);
|
||||
}
|
||||
|
||||
// This test only checks that periodic checkin happens.
|
||||
TEST_F(GCMClientImplCheckinTest, CheckinWhenAccountReplaced) {
|
||||
std::map<std::string, std::string> settings;
|
||||
settings["checkin_interval"] = base::NumberToString(kSettingsCheckinInterval);
|
||||
settings["checkin_url"] = "http://alternative.url/checkin";
|
||||
settings["gcm_hostname"] = "alternative.gcm.host";
|
||||
settings["gcm_secure_port"] = "7777";
|
||||
settings["gcm_registration_url"] = "http://alternative.url/registration";
|
||||
ASSERT_NO_FATAL_FAILURE(
|
||||
CompleteCheckin(kDeviceAndroidId, kDeviceSecurityToken,
|
||||
GServicesSettings::CalculateDigest(settings), settings));
|
||||
|
||||
std::vector<GCMClient::AccountTokenInfo> account_tokens;
|
||||
account_tokens.push_back(MakeAccountToken("test_user1@gmail.com", "token1"));
|
||||
gcm_client()->SetAccountTokens(account_tokens);
|
||||
|
||||
PumpLoopUntilIdle();
|
||||
ASSERT_NO_FATAL_FAILURE(
|
||||
CompleteCheckin(kDeviceAndroidId, kDeviceSecurityToken,
|
||||
GServicesSettings::CalculateDigest(settings), settings));
|
||||
|
||||
std::set<std::string> accounts;
|
||||
accounts.insert("test_user1@gmail.com");
|
||||
EXPECT_EQ(accounts, device_checkin_info().last_checkin_accounts);
|
||||
|
||||
// This should trigger another checkin, because the list of accounts is
|
||||
// different.
|
||||
account_tokens.clear();
|
||||
account_tokens.push_back(MakeAccountToken("test_user2@gmail.com", "token2"));
|
||||
gcm_client()->SetAccountTokens(account_tokens);
|
||||
|
||||
PumpLoopUntilIdle();
|
||||
ASSERT_NO_FATAL_FAILURE(
|
||||
CompleteCheckin(kDeviceAndroidId, kDeviceSecurityToken,
|
||||
GServicesSettings::CalculateDigest(settings), settings));
|
||||
|
||||
accounts.clear();
|
||||
accounts.insert("test_user2@gmail.com");
|
||||
EXPECT_EQ(accounts, device_checkin_info().last_checkin_accounts);
|
||||
EXPECT_TRUE(device_checkin_info().accounts_set);
|
||||
EXPECT_EQ(MakeEmailToTokenMap(account_tokens),
|
||||
device_checkin_info().account_tokens);
|
||||
}
|
||||
|
||||
TEST_F(GCMClientImplCheckinTest, ResetStoreWhenCheckinRejected) {
|
||||
|
@ -94,12 +94,10 @@ void RecordCheckinStatusAndReportUMA(CheckinRequestStatus status,
|
||||
CheckinRequest::RequestInfo::RequestInfo(
|
||||
uint64_t android_id,
|
||||
uint64_t security_token,
|
||||
const std::map<std::string, std::string>& account_tokens,
|
||||
const std::string& settings_digest,
|
||||
const checkin_proto::ChromeBuildProto& chrome_build_proto)
|
||||
: android_id(android_id),
|
||||
security_token(security_token),
|
||||
account_tokens(account_tokens),
|
||||
settings_digest(settings_digest),
|
||||
chrome_build_proto(chrome_build_proto) {}
|
||||
|
||||
@ -147,15 +145,6 @@ void CheckinRequest::Start() {
|
||||
checkin->set_type(checkin_proto::DEVICE_CHROME_BROWSER);
|
||||
#endif
|
||||
|
||||
// Pack a map of email -> token mappings into a repeated field, where odd
|
||||
// entries are email addresses, while even ones are respective OAuth2 tokens.
|
||||
for (std::map<std::string, std::string>::const_iterator iter =
|
||||
request_info_.account_tokens.begin();
|
||||
iter != request_info_.account_tokens.end(); ++iter) {
|
||||
request.add_account_cookie(iter->first);
|
||||
request.add_account_cookie(iter->second);
|
||||
}
|
||||
|
||||
std::string upload_data;
|
||||
CHECK(request.SerializeToString(&upload_data));
|
||||
net::NetworkTrafficAnnotationTag traffic_annotation =
|
||||
|
@ -48,7 +48,6 @@ class GCM_EXPORT CheckinRequest {
|
||||
struct GCM_EXPORT RequestInfo {
|
||||
RequestInfo(uint64_t android_id,
|
||||
uint64_t security_token,
|
||||
const std::map<std::string, std::string>& account_tokens,
|
||||
const std::string& settings_digest,
|
||||
const checkin_proto::ChromeBuildProto& chrome_build_proto);
|
||||
RequestInfo(const RequestInfo& other);
|
||||
@ -58,8 +57,6 @@ class GCM_EXPORT CheckinRequest {
|
||||
uint64_t android_id;
|
||||
// Security token of the device.
|
||||
uint64_t security_token;
|
||||
// Map of account OAuth2 tokens keyed by emails.
|
||||
std::map<std::string, std::string> account_tokens;
|
||||
// Digest of GServices settings on the device.
|
||||
std::string settings_digest;
|
||||
// Information of the Chrome build of this device.
|
||||
|
@ -25,8 +25,6 @@ const char kCheckinURL[] = "http://foo.bar/checkin";
|
||||
const char kChromeVersion[] = "Version String";
|
||||
const uint64_t kSecurityToken = 77;
|
||||
const char kSettingsDigest[] = "settings_digest";
|
||||
const char kEmailAddress[] = "test_user@gmail.com";
|
||||
const char kTokenValue[] = "token_value";
|
||||
|
||||
class CheckinRequestTest : public GCMRequestTestBase {
|
||||
public:
|
||||
@ -89,12 +87,8 @@ void CheckinRequestTest::CreateRequest(uint64_t android_id,
|
||||
checkin_proto::ChromeBuildProto::CHANNEL_CANARY);
|
||||
chrome_build_proto_.set_chrome_version(kChromeVersion);
|
||||
|
||||
std::map<std::string, std::string> account_tokens;
|
||||
account_tokens[kEmailAddress] = kTokenValue;
|
||||
|
||||
CheckinRequest::RequestInfo request_info(android_id,
|
||||
security_token,
|
||||
account_tokens,
|
||||
kSettingsDigest,
|
||||
chrome_build_proto_);
|
||||
// Then create a request with that protobuf and specified android_id,
|
||||
@ -152,9 +146,6 @@ TEST_F(CheckinRequestTest, FetcherDataAndURL) {
|
||||
request_proto.checkin().chrome_build().chrome_version());
|
||||
EXPECT_EQ(chrome_build_proto_.channel(),
|
||||
request_proto.checkin().chrome_build().channel());
|
||||
EXPECT_EQ(2, request_proto.account_cookie_size());
|
||||
EXPECT_EQ(kEmailAddress, request_proto.account_cookie(0));
|
||||
EXPECT_EQ(kTokenValue, request_proto.account_cookie(1));
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
EXPECT_EQ(checkin_proto::DEVICE_CHROME_OS, request_proto.checkin().type());
|
||||
|
@ -25,7 +25,6 @@ void GCMStore::LoadResult::Reset() {
|
||||
gservices_digest.clear();
|
||||
last_checkin_time = base::Time::FromInternalValue(0LL);
|
||||
last_token_fetch_time = base::Time::FromInternalValue(0LL);
|
||||
last_checkin_accounts.clear();
|
||||
account_mappings.clear();
|
||||
heartbeat_intervals.clear();
|
||||
success = false;
|
||||
|
@ -10,7 +10,6 @@
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@ -57,7 +56,6 @@ class GCM_EXPORT GCMStore {
|
||||
std::map<std::string, std::string> gservices_settings;
|
||||
std::string gservices_digest;
|
||||
base::Time last_checkin_time;
|
||||
std::set<std::string> last_checkin_accounts;
|
||||
AccountMappings account_mappings;
|
||||
base::Time last_token_fetch_time;
|
||||
std::map<std::string, int> heartbeat_intervals;
|
||||
@ -127,7 +125,6 @@ class GCM_EXPORT GCMStore {
|
||||
|
||||
// Sets last device's checkin information.
|
||||
virtual void SetLastCheckinInfo(const base::Time& time,
|
||||
const std::set<std::string>& accounts,
|
||||
UpdateCallback callback) = 0;
|
||||
|
||||
// G-service settings handling.
|
||||
|
@ -262,8 +262,7 @@ class GCMStoreImpl::Backend
|
||||
bool LoadRegistrations(std::map<std::string, std::string>* registrations);
|
||||
bool LoadIncomingMessages(std::vector<std::string>* incoming_messages);
|
||||
bool LoadOutgoingMessages(OutgoingMessageMap* outgoing_messages);
|
||||
bool LoadLastCheckinInfo(base::Time* last_checkin_time,
|
||||
std::set<std::string>* accounts);
|
||||
bool LoadLastCheckinInfo(base::Time* last_checkin_time);
|
||||
bool LoadGServicesSettings(std::map<std::string, std::string>* settings,
|
||||
std::string* digest);
|
||||
bool LoadAccountMappingInfo(AccountMappings* account_mappings);
|
||||
@ -335,8 +334,7 @@ LoadStatus GCMStoreImpl::Backend::OpenStoreAndLoadData(StoreOpenMode open_mode,
|
||||
return LOADING_INCOMING_MESSAGES_FAILED;
|
||||
if (!LoadOutgoingMessages(&result->outgoing_messages))
|
||||
return LOADING_OUTGOING_MESSAGES_FAILED;
|
||||
if (!LoadLastCheckinInfo(&result->last_checkin_time,
|
||||
&result->last_checkin_accounts)) {
|
||||
if (!LoadLastCheckinInfo(&result->last_checkin_time)) {
|
||||
return LOADING_LAST_CHECKIN_INFO_FAILED;
|
||||
}
|
||||
if (!LoadGServicesSettings(&result->gservices_settings,
|
||||
@ -1065,9 +1063,7 @@ bool GCMStoreImpl::Backend::LoadOutgoingMessages(
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GCMStoreImpl::Backend::LoadLastCheckinInfo(
|
||||
base::Time* last_checkin_time,
|
||||
std::set<std::string>* accounts) {
|
||||
bool GCMStoreImpl::Backend::LoadLastCheckinInfo(base::Time* last_checkin_time) {
|
||||
leveldb::ReadOptions read_options;
|
||||
read_options.verify_checksums = true;
|
||||
|
||||
@ -1085,15 +1081,6 @@ bool GCMStoreImpl::Backend::LoadLastCheckinInfo(
|
||||
// want that situation to cause the whole load to fail.
|
||||
*last_checkin_time = base::Time::FromInternalValue(time_internal);
|
||||
|
||||
accounts->clear();
|
||||
s = db_->Get(read_options, MakeSlice(kLastCheckinAccountsKey), &result);
|
||||
if (!s.ok())
|
||||
DVLOG(1) << "No accounts where stored during last run.";
|
||||
|
||||
base::StringTokenizer t(result, ",");
|
||||
while (t.GetNext())
|
||||
accounts->insert(t.token());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1370,11 +1357,12 @@ void GCMStoreImpl::RemoveOutgoingMessages(
|
||||
}
|
||||
|
||||
void GCMStoreImpl::SetLastCheckinInfo(const base::Time& time,
|
||||
const std::set<std::string>& accounts,
|
||||
UpdateCallback callback) {
|
||||
blocking_task_runner_->PostTask(
|
||||
FROM_HERE, base::BindOnce(&GCMStoreImpl::Backend::SetLastCheckinInfo,
|
||||
backend_, time, accounts, std::move(callback)));
|
||||
FROM_HERE,
|
||||
base::BindOnce(&GCMStoreImpl::Backend::SetLastCheckinInfo, backend_, time,
|
||||
/*accounts*/ std::set<std::string>(),
|
||||
std::move(callback)));
|
||||
}
|
||||
|
||||
void GCMStoreImpl::SetGServicesSettings(
|
||||
|
@ -82,7 +82,6 @@ class GCM_EXPORT GCMStoreImpl : public GCMStore {
|
||||
|
||||
// Sets last device's checkin information.
|
||||
void SetLastCheckinInfo(const base::Time& time,
|
||||
const std::set<std::string>& accounts,
|
||||
UpdateCallback callback) override;
|
||||
|
||||
// G-service settings handling.
|
||||
|
@ -207,20 +207,15 @@ TEST_F(GCMStoreImplTest, LastCheckinInfo) {
|
||||
LoadGCMStore(gcm_store.get(), &load_result);
|
||||
|
||||
base::Time last_checkin_time = base::Time::Now();
|
||||
std::set<std::string> accounts;
|
||||
accounts.insert("test_user1@gmail.com");
|
||||
accounts.insert("test_user2@gmail.com");
|
||||
|
||||
gcm_store->SetLastCheckinInfo(
|
||||
last_checkin_time, accounts,
|
||||
base::BindOnce(&GCMStoreImplTest::UpdateCallback,
|
||||
base::Unretained(this)));
|
||||
last_checkin_time, base::BindOnce(&GCMStoreImplTest::UpdateCallback,
|
||||
base::Unretained(this)));
|
||||
PumpLoop();
|
||||
|
||||
gcm_store = BuildGCMStore();
|
||||
LoadGCMStore(gcm_store.get(), &load_result);
|
||||
ASSERT_EQ(last_checkin_time, load_result->last_checkin_time);
|
||||
ASSERT_EQ(accounts, load_result->last_checkin_accounts);
|
||||
|
||||
// Negative cases, where the value read is gibberish.
|
||||
gcm_store->SetValueForTesting(
|
||||
|
@ -407,7 +407,6 @@ void MCSProbe::CheckIn() {
|
||||
chrome_build_proto.set_chrome_version(kChromeVersion);
|
||||
|
||||
CheckinRequest::RequestInfo request_info(0, 0,
|
||||
std::map<std::string, std::string>(),
|
||||
std::string(), chrome_build_proto);
|
||||
|
||||
checkin_request_ = std::make_unique<CheckinRequest>(
|
||||
|
Reference in New Issue
Block a user