Persist media device IDs across navigation and restart (fixes issue #2064)

Media device IDs will now be persisted across navigation and reload by default.
The device IDs will also be persisted across restart if --cache-path=<path> and
--persist-user-preferences settings are specified.
This commit is contained in:
Marshall Greenblatt
2020-09-14 16:26:31 -04:00
parent cc56720bd2
commit 8796d3cd95
5 changed files with 31 additions and 0 deletions

View File

@@ -21,6 +21,7 @@
#include "base/logging.h"
#include "base/strings/string_util.h"
#include "chrome/browser/font_family_cache.h"
#include "chrome/browser/media/media_device_id_salt.h"
#include "chrome/browser/plugins/chrome_plugin_service_filter.h"
#include "chrome/browser/profiles/profile_key.h"
#include "chrome/browser/ui/zoom/chrome_zoom_level_prefs.h"
@@ -168,6 +169,8 @@ void AlloyBrowserContext::Initialize() {
extension_system_->Init();
ChromePluginServiceFilter::GetInstance()->RegisterProfile(this);
media_device_id_salt_ = new MediaDeviceIDSalt(pref_service);
}
void AlloyBrowserContext::Shutdown() {
@@ -397,6 +400,10 @@ AlloyBrowserContext::GetBrowsingDataRemoverDelegate() {
return nullptr;
}
std::string AlloyBrowserContext::GetMediaDeviceIDSalt() {
return media_device_id_salt_->GetSalt();
}
PrefService* AlloyBrowserContext::GetPrefs() {
return pref_service_.get();
}