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

Unified Diff: content/browser/renderer_host/media/device_request_message_filter.cc

Issue 88283002: Reland review 34393006: Refactor MediaStreamManager to not output real device id. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 1 month 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: content/browser/renderer_host/media/device_request_message_filter.cc
diff --git a/content/browser/renderer_host/media/device_request_message_filter.cc b/content/browser/renderer_host/media/device_request_message_filter.cc
index 5eaf7c6bb3f6a946263446b3571d85de3c5e91e4..d5ca524ec5a426e6d8a436e30ac0cb91bb8a65f0 100644
--- a/content/browser/renderer_host/media/device_request_message_filter.cc
+++ b/content/browser/renderer_host/media/device_request_message_filter.cc
@@ -7,7 +7,6 @@
#include "content/browser/browser_main_loop.h"
#include "content/browser/renderer_host/media/media_stream_manager.h"
#include "content/common/media/media_stream_messages.h"
-#include "content/public/browser/media_device_id.h"
#include "content/public/browser/resource_context.h"
// Clears the MediaStreamDevice.name from all devices in |device_list|.
@@ -97,12 +96,12 @@ void DeviceRequestMessageFilter::DevicesEnumerated(
if (label == request_it->audio_devices_label) {
request_it->has_audio_returned = true;
DCHECK(audio_devices->empty());
- HmacDeviceIds(request_it->origin, new_devices, audio_devices);
+ *audio_devices = new_devices;
} else {
DCHECK(label == request_it->video_devices_label);
request_it->has_video_returned = true;
DCHECK(video_devices->empty());
- HmacDeviceIds(request_it->origin, new_devices, video_devices);
+ *video_devices = new_devices;
}
if (!request_it->has_audio_returned || !request_it->has_video_returned) {
@@ -151,23 +150,6 @@ void DeviceRequestMessageFilter::OnChannelClosing() {
requests_.clear();
}
-void DeviceRequestMessageFilter::HmacDeviceIds(
- const GURL& origin,
- const StreamDeviceInfoArray& raw_devices,
- StreamDeviceInfoArray* devices_with_guids) {
- DCHECK(devices_with_guids);
-
- // Replace raw ids with hmac'd ids before returning to renderer process.
- for (StreamDeviceInfoArray::const_iterator device_itr = raw_devices.begin();
- device_itr != raw_devices.end();
- ++device_itr) {
- StreamDeviceInfo current_device_info = *device_itr;
- current_device_info.device.id =
- content::GetHMACForMediaDeviceID(origin, device_itr->device.id);
- devices_with_guids->push_back(current_device_info);
- }
-}
-
void DeviceRequestMessageFilter::OnGetSources(int request_id,
const GURL& security_origin) {
// Make request to get audio devices.

Powered by Google App Engine
This is Rietveld 408576698