[go: nahoru, domu]

Reland of Make default media device ID salts random by default (patchset #1 id:1 of https://codereview.chromium.org/2065383003/ )

Reason for revert:
Creating reland. The problem was a test that gets the salt on the IO thread. It should be changed to the UI thread.

Original issue's description:
> Revert of Make default media device ID salts random by default (patchset #13 id:260001 of https://codereview.chromium.org/1987643002/ )
>
> Reason for revert:
> Reverting because it is breaking the WebRTC MacTester bot.
> https://build.chromium.org/p/chromium.webrtc/builders/Mac%20Tester/builds/55969/
>
> Original issue's description:
> > This results in different hashed device IDs on each session on embedders that don't have a specialized implementation of device ID salts such as WebView, Blimp and Content Shell. The new default helps prevent user fingerprinting on these embedders.
> >
> > Since the new default logic is basically the same as for Chrome incognito mode, Chrome's implementation of salts has been updated to defer to the new default on incognito mode.
> >
> > BUG=315022
> >
> > Committed: https://crrev.com/4db1329e005388540eb07429ac97827ca9bc422b
> > Cr-Commit-Position: refs/heads/master@{#399883}
>
> TBR=jam@chromium.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=315022
>
> Committed: https://crrev.com/f72bda81d0c3e6f256826e9ecdf6d745e4ad76c8
> Cr-Commit-Position: refs/heads/master@{#399887}

TBR=jam@chromium.org
BUG=315022

Review-Url: https://codereview.chromium.org/2068103003
Cr-Commit-Position: refs/heads/master@{#399902}
diff --git a/chrome/browser/media/media_device_id_salt.h b/chrome/browser/media/media_device_id_salt.h
index 5e1ec8f..8db2731 100644
--- a/chrome/browser/media/media_device_id_salt.h
+++ b/chrome/browser/media/media_device_id_salt.h
@@ -22,7 +22,7 @@
 // callback returned by ResourceContext::GetMediaDeviceIDSalt.
 class MediaDeviceIDSalt : public base::RefCountedThreadSafe<MediaDeviceIDSalt> {
  public:
-  MediaDeviceIDSalt(PrefService* pref_service, bool incognito);
+  explicit MediaDeviceIDSalt(PrefService* pref_service);
   void ShutdownOnUIThread();
 
   std::string GetSalt() const;
@@ -34,9 +34,6 @@
   friend class base::RefCountedThreadSafe<MediaDeviceIDSalt>;
   ~MediaDeviceIDSalt();
 
-  // |incognito_salt_| is initialized in ctor on UI thread but only read
-  //  on the IO thread.
-  std::string incognito_salt_;
   mutable StringPrefMember media_device_id_salt_;
 
   DISALLOW_COPY_AND_ASSIGN(MediaDeviceIDSalt);