summaryrefslogtreecommitdiffstats
path: root/sync/tools
diff options
context:
space:
mode:
authorpavely <pavely@chromium.org>2015-12-22 22:47:19 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-23 06:48:40 +0000
commit7623e624861d45f61632aaba650b4182c5d022ff (patch)
tree10321308c997c3260154245c7a268667e85ddbc0 /sync/tools
parente7259757073db5b53542ce4896d65ea208c8060d (diff)
downloadchromium_src-7623e624861d45f61632aaba650b4182c5d022ff.zip
chromium_src-7623e624861d45f61632aaba650b4182c5d022ff.tar.gz
chromium_src-7623e624861d45f61632aaba650b4182c5d022ff.tar.bz2
[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}
Diffstat (limited to 'sync/tools')
-rw-r--r--sync/tools/sync_client.cc1
1 files changed, 1 insertions, 0 deletions
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