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

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: change return type from const string to string as it makes no difference 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 ba4ecf650be61d8126b7f6174e5fe9b0e73a22c7..5c4d65b1023f40e7bba584af83843c3758522b34 100644
--- a/chrome/browser/profiles/profile_io_data.cc
+++ b/chrome/browser/profiles/profile_io_data.cc
@@ -499,7 +499,8 @@ void ProfileIOData::InitializeOnUIThread(Profile* profile) {
signin_allowed_.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);
@@ -865,8 +866,9 @@ HostContentSettingsMap* ProfileIOData::GetHostContentSettingsMap() const {
return host_content_settings_map_.get();
}
-ResourceContext::SaltCallback ProfileIOData::GetMediaDeviceIDSalt() const {
- return base::Bind(&MediaDeviceIDSalt::GetSalt, media_device_id_salt_);
+std::string ProfileIOData::GetMediaDeviceIDSalt() const {
+ DCHECK(media_device_id_salt_);
+ return media_device_id_salt_->GetSalt();
}
bool ProfileIOData::IsOffTheRecord() const {
@@ -1003,9 +1005,11 @@ void ProfileIOData::ResourceContext::CreateKeygenHandler(
#endif
}
-ResourceContext::SaltCallback
-ProfileIOData::ResourceContext::GetMediaDeviceIDSalt() {
- return io_data_->GetMediaDeviceIDSalt();
+std::string ProfileIOData::ResourceContext::GetMediaDeviceIDSalt() {
+ if (io_data_->HasMediaDeviceIDSalt())
+ return io_data_->GetMediaDeviceIDSalt();
+
+ return content::ResourceContext::GetMediaDeviceIDSalt();
}
void ProfileIOData::Init(
« no previous file with comments | « chrome/browser/profiles/profile_io_data.h ('k') | content/browser/renderer_host/media/audio_renderer_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698