blob: cc27c0721c8ebff6474353022e992a11092771d2 [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 Arnold2cbb3852014-03-07 12:40:50 -08005#ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_REAL_RANDOM_PROVIDER_H_
6#define CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_REAL_RANDOM_PROVIDER_H_
Alex Deymobb019fe2014-02-03 20:12:17 -08007
Alex Deymo6e97bb22014-02-05 16:46:16 -08008#include "update_engine/policy_manager/random_provider.h"
Alex Deymobb019fe2014-02-03 20:12:17 -08009
10namespace chromeos_policy_manager {
11
12// RandomProvider implementation class.
13class RealRandomProvider : public RandomProvider {
14 public:
15 RealRandomProvider() {}
16
David Zeuthen21716e22014-04-23 15:42:05 -070017 virtual Variable<uint64_t>* var_seed() override { return var_seed_.get(); }
Alex Deymobb019fe2014-02-03 20:12:17 -080018
Alex Deymo42c30c32014-04-24 18:41:18 -070019 // Initializes the provider and returns whether it succeeded.
20 bool Init();
David Zeuthen21716e22014-04-23 15:42:05 -070021
Alex Deymo42c30c32014-04-24 18:41:18 -070022 private:
David Zeuthen21716e22014-04-23 15:42:05 -070023 // The seed() scoped variable.
24 scoped_ptr<Variable<uint64_t>> var_seed_;
25
Alex Deymobb019fe2014-02-03 20:12:17 -080026 DISALLOW_COPY_AND_ASSIGN(RealRandomProvider);
27};
28
29} // namespace chromeos_policy_manager
30
Gilad Arnold2cbb3852014-03-07 12:40:50 -080031#endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_REAL_RANDOM_PROVIDER_H_