media_device_id_salt.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Copyright 2013 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.
  4. #ifndef BRIGHTRAY_BROWSER_MEDIA_MEDIA_DEVICE_ID_SALT_H_
  5. #define BRIGHTRAY_BROWSER_MEDIA_MEDIA_DEVICE_ID_SALT_H_
  6. #include <string>
  7. #include "base/macros.h"
  8. #include "components/prefs/pref_member.h"
  9. class PrefRegistrySimple;
  10. class PrefService;
  11. namespace brightray {
  12. // MediaDeviceIDSalt is responsible for creating and retrieving a salt string
  13. // that is used for creating MediaSource IDs that can be cached by a web
  14. // service. If the cache is cleared, the MediaSourceIds are invalidated.
  15. class MediaDeviceIDSalt {
  16. public:
  17. explicit MediaDeviceIDSalt(PrefService* pref_service);
  18. ~MediaDeviceIDSalt();
  19. std::string GetSalt();
  20. static void RegisterPrefs(PrefRegistrySimple* pref_registry);
  21. static void Reset(PrefService* pref_service);
  22. private:
  23. StringPrefMember media_device_id_salt_;
  24. DISALLOW_COPY_AND_ASSIGN(MediaDeviceIDSalt);
  25. };
  26. } // namespace brightray
  27. #endif // BRIGHTRAY_BROWSER_MEDIA_MEDIA_DEVICE_ID_SALT_H_