From 7623e624861d45f61632aaba650b4182c5d022ff Mon Sep 17 00:00:00 2001 From: pavely Date: Tue, 22 Dec 2015 22:47:19 -0800 Subject: [Sync] Use account_id instead of username in a few places in sync Currently sync gets username from SigninManagerBase::GetAuthenticatedAccountInfo(). In some cases it returns empty result which prevents sync backend from starting. Username is used in following places: - passed to sync directory database to be stored as share id - passed to server in ClientToServerMessage.share - passed to attachment uploader/downloader to be used as account_id when requesting access tokens The change is to switch to more stable SigninManagerBase::GetAuthenticatedAccountId(). account_id will be passed to directory and attachment uploader/downloader. Username is still used in communications with server but it is not enforced to be nonempty. BUG=554551 R=zea@chromium.org Review URL: https://codereview.chromium.org/1544893002 Cr-Commit-Position: refs/heads/master@{#366721} --- sync/tools/sync_client.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'sync/tools') diff --git a/sync/tools/sync_client.cc b/sync/tools/sync_client.cc index 1c60222..3781899 100644 --- a/sync/tools/sync_client.cc +++ b/sync/tools/sync_client.cc @@ -310,6 +310,7 @@ int SyncClientMain(int argc, char* argv[]) { const base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess(); SyncCredentials credentials; + credentials.account_id = command_line.GetSwitchValueASCII(kEmailSwitch); credentials.email = command_line.GetSwitchValueASCII(kEmailSwitch); credentials.sync_token = command_line.GetSwitchValueASCII(kTokenSwitch); // TODO(akalin): Write a wrapper script that gets a token for an -- cgit v1.1