Consolidate credential_storage callback functions. Move all callback struct definitions in a central header file compiled as part of internal/platform/implementation:comm library.

PiperOrigin-RevId: 476186596
This commit is contained in:
Anthony Rueda
2022-09-22 13:46:47 -07:00
committed by Copybara-Service
parent 0e6e22b4db
commit fd59e9aede
12 changed files with 429 additions and 245 deletions
+16 -13
View File
@@ -16,9 +16,11 @@
#define THIRD_PARTY_NEARBY_INTERNAL_PLATFORM_CREDENTIAL_STORAGE_IMPL_H_
#include <memory>
#include <utility>
#include <vector>
#include "absl/strings/string_view.h"
#include "internal/platform/implementation/credential_callbacks.h"
#include "internal/platform/implementation/credential_storage.h"
#include "internal/platform/implementation/platform.h"
@@ -39,25 +41,26 @@ class CredentialStorageImpl : public api::CredentialStorage {
CredentialStorageImpl(CredentialStorageImpl&& other) = default;
CredentialStorageImpl& operator=(CredentialStorageImpl&& other) = default;
void SaveCredentials(absl::string_view manager_app_id,
absl::string_view account_name,
const std::vector<::nearby::internal::PrivateCredential>&
private_credentials,
const std::vector<::nearby::internal::PublicCredential>&
public_credentials,
api::PublicCredentialType public_credential_type,
api::SaveCredentialsResultCallback callback) override;
void SaveCredentials(
absl::string_view manager_app_id, absl::string_view account_name,
const std::vector<::nearby::internal::PrivateCredential>&
private_credentials,
const std::vector<::nearby::internal::PublicCredential>&
public_credentials,
::nearby::presence::PublicCredentialType public_credential_type,
::nearby::presence::GenerateCredentialsCallback callback) override;
// Used to fetch private creds when broadcasting.
void GetPrivateCredentials(
const api::CredentialSelector& credential_selector,
api::GetPrivateCredentialsResultCallback callback) override;
const ::nearby::presence::CredentialSelector& credential_selector,
::nearby::presence::GetPrivateCredentialsResultCallback callback)
override;
// Used to fetch remote public creds when scanning.
void GetPublicCredentials(
const api::CredentialSelector& credential_selector,
api::PublicCredentialType public_credential_type,
api::GetPublicCredentialsResultCallback callback) override;
const ::nearby::presence::CredentialSelector& credential_selector,
::nearby::presence::PublicCredentialType public_credential_type,
::nearby::presence::GetPublicCredentialsResultCallback callback) override;
private:
std::unique_ptr<api::CredentialStorage> impl_;