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

Unified Diff: content/renderer/media/media_stream_impl.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: Changes since the revert. 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/renderer/media/media_stream_impl.cc
diff --git a/content/renderer/media/media_stream_impl.cc b/content/renderer/media/media_stream_impl.cc
index c6c1454c5caf21ab4268052fcaa7e6f40ba2d845..7b9e09254b46f5502c9341be2d1f2f79da85a677 100644
--- a/content/renderer/media/media_stream_impl.cc
+++ b/content/renderer/media/media_stream_impl.cc
@@ -449,12 +449,6 @@ void MediaStreamImpl::CreateWebKitSourceVector(
blink::WebVector<blink::WebMediaStreamSource>& webkit_sources) {
CHECK_EQ(devices.size(), webkit_sources.size());
for (size_t i = 0; i < devices.size(); ++i) {
- const char* track_type =
- (type == blink::WebMediaStreamSource::TypeAudio) ? "a" : "v";
- std::string source_id = base::StringPrintf("%s%s%u", label.c_str(),
- track_type,
- static_cast<unsigned int>(i));
-
const blink::WebMediaStreamSource* existing_source =
FindLocalSource(devices[i]);
if (existing_source) {
@@ -464,7 +458,7 @@ void MediaStreamImpl::CreateWebKitSourceVector(
continue;
}
webkit_sources[i].initialize(
- UTF8ToUTF16(source_id),
+ UTF8ToUTF16(devices[i].device.id),
type,
UTF8ToUTF16(devices[i].device.name));
MediaStreamSourceExtraData* source_extra_data(
@@ -560,7 +554,7 @@ const blink::WebMediaStreamSource* MediaStreamImpl::FindLocalSource(
it->source.extraData());
const StreamDeviceInfo& active_device = extra_data->device_info();
if (active_device.device.id == device.device.id &&
- active_device.session_id == device.session_id) {
+ active_device.device.type == device.device.type) {
return &it->source;
}
}

Powered by Google App Engine
This is Rietveld 408576698