blob: d15993342ba1cd75f9cddd9bb7dc3cf02298cc8c [file] [log] [blame]
Alex Deymobb019fe2014-02-03 20:12:17 -08001// Copyright (c) 2014 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
Gilad Arnold48415f12014-06-27 07:10:58 -07005#ifndef UPDATE_ENGINE_UPDATE_MANAGER_REAL_RANDOM_PROVIDER_H_
6#define UPDATE_ENGINE_UPDATE_MANAGER_REAL_RANDOM_PROVIDER_H_
Alex Deymobb019fe2014-02-03 20:12:17 -08007
Ben Chan02f7c1d2014-10-18 15:18:02 -07008#include <memory>
Alex Deymo1f012912014-04-24 19:08:04 -07009
Alex Deymo63784a52014-05-28 10:46:14 -070010#include "update_engine/update_manager/random_provider.h"
Alex Deymobb019fe2014-02-03 20:12:17 -080011
Alex Deymo63784a52014-05-28 10:46:14 -070012namespace chromeos_update_manager {
Alex Deymobb019fe2014-02-03 20:12:17 -080013
14// RandomProvider implementation class.
15class RealRandomProvider : public RandomProvider {
16 public:
17 RealRandomProvider() {}
18
Alex Vakulenko157fe302014-08-11 15:59:58 -070019 Variable<uint64_t>* var_seed() override { return var_seed_.get(); }
Alex Deymobb019fe2014-02-03 20:12:17 -080020
Alex Deymo42c30c32014-04-24 18:41:18 -070021 // Initializes the provider and returns whether it succeeded.
22 bool Init();
David Zeuthen21716e22014-04-23 15:42:05 -070023
Alex Deymo42c30c32014-04-24 18:41:18 -070024 private:
David Zeuthen21716e22014-04-23 15:42:05 -070025 // The seed() scoped variable.
Ben Chan02f7c1d2014-10-18 15:18:02 -070026 std::unique_ptr<Variable<uint64_t>> var_seed_;
David Zeuthen21716e22014-04-23 15:42:05 -070027
Alex Deymobb019fe2014-02-03 20:12:17 -080028 DISALLOW_COPY_AND_ASSIGN(RealRandomProvider);
29};
30
Alex Deymo63784a52014-05-28 10:46:14 -070031} // namespace chromeos_update_manager
Alex Deymobb019fe2014-02-03 20:12:17 -080032
Gilad Arnold48415f12014-06-27 07:10:58 -070033#endif // UPDATE_ENGINE_UPDATE_MANAGER_REAL_RANDOM_PROVIDER_H_