Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(357)

Unified Diff: chrome/browser/profiles/profile_io_data.cc

Issue 1987643002: Make default media device ID salts random by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: better fix for compile error Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/profiles/profile_io_data.cc
diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc
index 11c06609c13b0d6c625f2246853ebf6ea48610b1..cbbfef26a9af9c6df78d953b35dcc3d166dd797e 100644
--- a/chrome/browser/profiles/profile_io_data.cc
+++ b/chrome/browser/profiles/profile_io_data.cc
@@ -504,7 +504,8 @@ void ProfileIOData::InitializeOnUIThread(Profile* profile) {
local_state_pref_service);
quick_check_enabled_.MoveToThread(io_task_runner);
- media_device_id_salt_ = new MediaDeviceIDSalt(pref_service, IsOffTheRecord());
+ if (!IsOffTheRecord())
+ media_device_id_salt_ = new MediaDeviceIDSalt(pref_service);
network_prediction_options_.Init(prefs::kNetworkPredictionOptions,
pref_service);
@@ -871,6 +872,7 @@ HostContentSettingsMap* ProfileIOData::GetHostContentSettingsMap() const {
}
ResourceContext::SaltCallback ProfileIOData::GetMediaDeviceIDSalt() const {
+ DCHECK(media_device_id_salt_);
return base::Bind(&MediaDeviceIDSalt::GetSalt, media_device_id_salt_);
}
@@ -1010,7 +1012,10 @@ void ProfileIOData::ResourceContext::CreateKeygenHandler(
ResourceContext::SaltCallback
ProfileIOData::ResourceContext::GetMediaDeviceIDSalt() {
- return io_data_->GetMediaDeviceIDSalt();
+ if (io_data_->HasMediaDeviceIDSalt())
+ return io_data_->GetMediaDeviceIDSalt();
+
+ return content::ResourceContext::GetMediaDeviceIDSalt();
}
void ProfileIOData::Init(

Powered by Google App Engine
This is Rietveld 408576698