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

Unified Diff: components/media_device_id_salt/media_device_id_salt.cc

Issue 1981913002: *DRAFT* Move MediaDeviceIDSalt from chrome/ to components/ and use it in Android WebView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « components/media_device_id_salt/media_device_id_salt.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/media_device_id_salt/media_device_id_salt.cc
diff --git a/chrome/browser/media/media_device_id_salt.cc b/components/media_device_id_salt/media_device_id_salt.cc
similarity index 82%
rename from chrome/browser/media/media_device_id_salt.cc
rename to components/media_device_id_salt/media_device_id_salt.cc
index 2220418e031c0f21a713d886d5eacaaa2903f2f9..0c6e7ab9d14b43aa8fcf55ea297314ee484371c0 100644
--- a/chrome/browser/media/media_device_id_salt.cc
+++ b/components/media_device_id_salt/media_device_id_salt.cc
@@ -1,17 +1,23 @@
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/media/media_device_id_salt.h"
+#include "components/media_device_id_salt/media_device_id_salt.h"
#include "base/base64.h"
#include "base/rand_util.h"
-#include "chrome/browser/profiles/profile_io_data.h"
-#include "chrome/common/pref_names.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/browser_thread.h"
using content::BrowserThread;
+namespace media_device_id_salt {
+
+namespace prefs {
+
+const char kMediaDeviceIdSalt[] = "media.device_id_salt";
+
+} // namespace prefs
+
namespace {
std::string CreateSalt() {
@@ -40,8 +46,7 @@ MediaDeviceIDSalt::MediaDeviceIDSalt(PrefService* pref_service,
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
}
-MediaDeviceIDSalt::~MediaDeviceIDSalt() {
-}
+MediaDeviceIDSalt::~MediaDeviceIDSalt() {}
void MediaDeviceIDSalt::ShutdownOnUIThread() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@@ -62,6 +67,7 @@ void MediaDeviceIDSalt::RegisterProfilePrefs(
}
void MediaDeviceIDSalt::Reset(PrefService* pref_service) {
- pref_service->SetString(prefs::kMediaDeviceIdSalt,
- CreateSalt());
+ pref_service->SetString(prefs::kMediaDeviceIdSalt, CreateSalt());
}
+
+} // namespace media_device_id_salt
« no previous file with comments | « components/media_device_id_salt/media_device_id_salt.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698