blob: 07b6e47d6f432e55d45181671ae84fedfd1d7715 [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 Deymo1f012912014-04-24 19:08:04 -07008#include <base/memory/scoped_ptr.h>
9
Alex Deymo6e97bb22014-02-05 16:46:16 -080010#include "update_engine/policy_manager/random_provider.h"
Alex Deymobb019fe2014-02-03 20:12:17 -080011
12namespace chromeos_policy_manager {
13
14// RandomProvider implementation class.
15class RealRandomProvider : public RandomProvider {
16 public:
17 RealRandomProvider() {}
18
David Zeuthen21716e22014-04-23 15:42:05 -070019 virtual 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.
26 scoped_ptr<Variable<uint64_t>> var_seed_;
27
Alex Deymobb019fe2014-02-03 20:12:17 -080028 DISALLOW_COPY_AND_ASSIGN(RealRandomProvider);
29};
30
31} // namespace chromeos_policy_manager
32
Gilad Arnold2cbb3852014-03-07 12:40:50 -080033#endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_REAL_RANDOM_PROVIDER_H_