Commit 547c3a05 authored by Tanmoy Mollik's avatar Tanmoy Mollik Committed by Commit Bot

SyncEncryptionKeysTabHelper::EncryptionKeyApi::SetEncryptionKeys() should pass...

SyncEncryptionKeysTabHelper::EncryptionKeyApi::SetEncryptionKeys() should pass gaia_id to AddTrustedVaultDecryptionKeys()

SyncUserSettings::AddTrustedVaultDecryptionKeys() expects gaia_id as per the implementation
https://cs.chromium.org/chromium/src/components/sync/driver/sync_service_crypto.cc?l=324&rcl=6b95460e56dc3cf417134e8eb1baed68daa55a34
It should not be getting a CoreAccountId object.


Change-Id: I1e3dddd14539d256e0083c8cb59e81ffeda45d24
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1886827Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Reviewed-by: default avatarNasko Oskov <nasko@chromium.org>
Reviewed-by: default avatarMikel Astiz <mastiz@chromium.org>
Commit-Queue: Tanmoy Mollik <triploblastic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711198}
parent be8a3b0a
......@@ -54,13 +54,13 @@ class SyncEncryptionKeysTabHelper::EncryptionKeyApi
// chrome::mojom::SyncEncryptionKeysExtension:
void SetEncryptionKeys(const std::vector<std::string>& encryption_keys,
const std::string& account_id,
const std::string& gaia_id,
SetEncryptionKeysCallback callback) override {
CHECK_EQ(bindings_.GetCurrentTargetFrame()->GetLastCommittedOrigin(),
GetAllowedOrigin());
sync_service_->GetUserSettings()->AddTrustedVaultDecryptionKeys(
CoreAccountId(account_id), encryption_keys);
gaia_id, encryption_keys);
std::move(callback).Run();
}
......
......@@ -11,5 +11,5 @@ interface SyncEncryptionKeysExtension {
// Provides sync encryption keys to the browser process. Returns true if no
// further encryption keys are needed (which includes the case, among others,
// of encryption keys not being needed even prior to this call).
SetEncryptionKeys(array<string> encryption_keys, string account_id) => ();
SetEncryptionKeys(array<string> encryption_keys, string gaia_id) => ();
};
......@@ -108,8 +108,8 @@ void SyncEncryptionKeysExtension::SetSyncEncryptionKeys(gin::Arguments* args) {
return;
}
std::string account_id;
if (!args->GetNext(&account_id)) {
std::string gaia_id;
if (!args->GetNext(&gaia_id)) {
DLOG(ERROR) << "No account ID";
args->ThrowError();
return;
......@@ -130,7 +130,7 @@ void SyncEncryptionKeysExtension::SetSyncEncryptionKeys(gin::Arguments* args) {
}
remote_->SetEncryptionKeys(
encryption_keys, account_id,
encryption_keys, gaia_id,
base::BindOnce(&SyncEncryptionKeysExtension::RunCompletionCallback,
weak_ptr_factory_.GetWeakPtr(),
std::move(global_callback)));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment