Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / rlz / win / lib / rlz_value_store_registry.h
blobd058d668653db2bc631027fff6ed2709b7920a56
1 // Copyright (c) 2012 The Chromium 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.
5 #ifndef RLZ_WIN_LIB_RLZ_VALUE_STORE_REGISTRY_H_
6 #define RLZ_WIN_LIB_RLZ_VALUE_STORE_REGISTRY_H_
8 #include "base/compiler_specific.h"
9 #include "rlz/lib/rlz_value_store.h"
11 namespace rlz_lib {
13 // Implements RlzValueStore by storing values in the windows registry.
14 class RlzValueStoreRegistry : public RlzValueStore {
15 public:
16 static std::wstring GetWideLibKeyName();
18 bool HasAccess(AccessType type) override;
20 bool WritePingTime(Product product, int64 time) override;
21 bool ReadPingTime(Product product, int64* time) override;
22 bool ClearPingTime(Product product) override;
24 bool WriteAccessPointRlz(AccessPoint access_point,
25 const char* new_rlz) override;
26 bool ReadAccessPointRlz(AccessPoint access_point,
27 char* rlz,
28 size_t rlz_size) override;
29 bool ClearAccessPointRlz(AccessPoint access_point) override;
31 bool AddProductEvent(Product product, const char* event_rlz) override;
32 bool ReadProductEvents(Product product,
33 std::vector<std::string>* events) override;
34 bool ClearProductEvent(Product product,
35 const char* event_rlz) override;
36 bool ClearAllProductEvents(Product product) override;
38 bool AddStatefulEvent(Product product,
39 const char* event_rlz) override;
40 bool IsStatefulEvent(Product product,
41 const char* event_rlz) override;
42 bool ClearAllStatefulEvents(Product product) override;
44 void CollectGarbage() override;
46 private:
47 RlzValueStoreRegistry() {}
48 DISALLOW_COPY_AND_ASSIGN(RlzValueStoreRegistry);
49 friend class ScopedRlzValueStoreLock;
52 } // namespace rlz_lib
54 #endif // RLZ_WIN_LIB_RLZ_VALUE_STORE_REGISTRY_H_