| Alex Deymo | aea4c1c | 2015-08-19 20:24:43 -0700 | [diff] [blame] | 1 | // | 
|  | 2 | // Copyright (C) 2014 The Android Open Source Project | 
|  | 3 | // | 
|  | 4 | // Licensed under the Apache License, Version 2.0 (the "License"); | 
|  | 5 | // you may not use this file except in compliance with the License. | 
|  | 6 | // You may obtain a copy of the License at | 
|  | 7 | // | 
|  | 8 | //      http://www.apache.org/licenses/LICENSE-2.0 | 
|  | 9 | // | 
|  | 10 | // Unless required by applicable law or agreed to in writing, software | 
|  | 11 | // distributed under the License is distributed on an "AS IS" BASIS, | 
|  | 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
|  | 13 | // See the License for the specific language governing permissions and | 
|  | 14 | // limitations under the License. | 
|  | 15 | // | 
| Alex Deymo | bb019fe | 2014-02-03 20:12:17 -0800 | [diff] [blame] | 16 |  | 
| Gilad Arnold | 48415f1 | 2014-06-27 07:10:58 -0700 | [diff] [blame] | 17 | #ifndef UPDATE_ENGINE_UPDATE_MANAGER_REAL_RANDOM_PROVIDER_H_ | 
|  | 18 | #define UPDATE_ENGINE_UPDATE_MANAGER_REAL_RANDOM_PROVIDER_H_ | 
| Alex Deymo | bb019fe | 2014-02-03 20:12:17 -0800 | [diff] [blame] | 19 |  | 
| Ben Chan | 02f7c1d | 2014-10-18 15:18:02 -0700 | [diff] [blame] | 20 | #include <memory> | 
| Alex Deymo | 1f01291 | 2014-04-24 19:08:04 -0700 | [diff] [blame] | 21 |  | 
| Alex Deymo | 63784a5 | 2014-05-28 10:46:14 -0700 | [diff] [blame] | 22 | #include "update_engine/update_manager/random_provider.h" | 
| Alex Deymo | bb019fe | 2014-02-03 20:12:17 -0800 | [diff] [blame] | 23 |  | 
| Alex Deymo | 63784a5 | 2014-05-28 10:46:14 -0700 | [diff] [blame] | 24 | namespace chromeos_update_manager { | 
| Alex Deymo | bb019fe | 2014-02-03 20:12:17 -0800 | [diff] [blame] | 25 |  | 
|  | 26 | // RandomProvider implementation class. | 
|  | 27 | class RealRandomProvider : public RandomProvider { | 
|  | 28 | public: | 
|  | 29 | RealRandomProvider() {} | 
|  | 30 |  | 
| Alex Vakulenko | 157fe30 | 2014-08-11 15:59:58 -0700 | [diff] [blame] | 31 | Variable<uint64_t>* var_seed() override { return var_seed_.get(); } | 
| Alex Deymo | bb019fe | 2014-02-03 20:12:17 -0800 | [diff] [blame] | 32 |  | 
| Alex Deymo | 42c30c3 | 2014-04-24 18:41:18 -0700 | [diff] [blame] | 33 | // Initializes the provider and returns whether it succeeded. | 
|  | 34 | bool Init(); | 
| David Zeuthen | 21716e2 | 2014-04-23 15:42:05 -0700 | [diff] [blame] | 35 |  | 
| Alex Deymo | 42c30c3 | 2014-04-24 18:41:18 -0700 | [diff] [blame] | 36 | private: | 
| David Zeuthen | 21716e2 | 2014-04-23 15:42:05 -0700 | [diff] [blame] | 37 | // The seed() scoped variable. | 
| Ben Chan | 02f7c1d | 2014-10-18 15:18:02 -0700 | [diff] [blame] | 38 | std::unique_ptr<Variable<uint64_t>> var_seed_; | 
| David Zeuthen | 21716e2 | 2014-04-23 15:42:05 -0700 | [diff] [blame] | 39 |  | 
| Alex Deymo | bb019fe | 2014-02-03 20:12:17 -0800 | [diff] [blame] | 40 | DISALLOW_COPY_AND_ASSIGN(RealRandomProvider); | 
|  | 41 | }; | 
|  | 42 |  | 
| Alex Deymo | 63784a5 | 2014-05-28 10:46:14 -0700 | [diff] [blame] | 43 | }  // namespace chromeos_update_manager | 
| Alex Deymo | bb019fe | 2014-02-03 20:12:17 -0800 | [diff] [blame] | 44 |  | 
| Gilad Arnold | 48415f1 | 2014-06-27 07:10:58 -0700 | [diff] [blame] | 45 | #endif  // UPDATE_ENGINE_UPDATE_MANAGER_REAL_RANDOM_PROVIDER_H_ |