blob: b774cd6a85352c648eef32a41909dea2502d0b0e [file] [log] [blame]
alanlxl30f15bd2020-08-11 21:26:12 +10001// Copyright 2020 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "federated/storage_manager_impl.h"
6
7#include <base/logging.h>
8#include <base/no_destructor.h>
9
10namespace federated {
11
12bool StorageManagerImpl::OnExampleReceived(
13 const std::string& client_name, const std::string& serialized_example) {
14 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
15 // TODO(alanlxl): Insert data into DB
16 return true;
17}
18
19bool StorageManagerImpl::PrepareStreamingForClient(
20 const std::string& client_name) {
21 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
22 // TODO(alanlxl): Query DB if there're examples for the given client.
23 return true;
24}
25
26bool StorageManagerImpl::GetNextExample(std::string* example) {
27 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
28 // TODO(alanlxl): query DB for the next example.
29 return true;
30}
31
32bool StorageManagerImpl::CloseStreaming() {
33 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
34
35 // TODO(alanlxl): we can clean the used examples here.
36 return true;
37}
38
39StorageManager* StorageManager::GetInstance() {
40 static base::NoDestructor<StorageManagerImpl> storage_manager;
41 return storage_manager.get();
42}
43
44} // namespace federated