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

Side by Side Diff: content/browser/renderer_host/media/media_stream_dispatcher_host.cc

Issue 34393006: Refactor MediaStreamManager to never output real device id. It now always output sourceId in the fo… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased to latest code base. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/media/media_stream_dispatcher_host.h" 5 #include "content/browser/renderer_host/media/media_stream_dispatcher_host.h"
6 6
7 #include "content/browser/browser_main_loop.h" 7 #include "content/browser/browser_main_loop.h"
8 #include "content/browser/renderer_host/media/web_contents_capture_util.h" 8 #include "content/browser/renderer_host/media/web_contents_capture_util.h"
9 #include "content/common/media/media_stream_messages.h" 9 #include "content/common/media/media_stream_messages.h"
10 #include "content/common/media/media_stream_options.h" 10 #include "content/common/media/media_stream_options.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 << render_view_id << ", " 126 << render_view_id << ", "
127 << page_request_id << ", [" 127 << page_request_id << ", ["
128 << " audio:" << components.audio_type 128 << " audio:" << components.audio_type
129 << " video:" << components.video_type 129 << " video:" << components.video_type
130 << " ], " 130 << " ], "
131 << security_origin.spec() << ")"; 131 << security_origin.spec() << ")";
132 132
133 const std::string& label = media_stream_manager_->GenerateStream( 133 const std::string& label = media_stream_manager_->GenerateStream(
134 this, render_process_id_, render_view_id, page_request_id, 134 this, render_process_id_, render_view_id, page_request_id,
135 components, security_origin); 135 components, security_origin);
136 if (label.empty()) { 136 CHECK(!label.empty());
137 Send(new MediaStreamMsg_StreamGenerationFailed(render_view_id, 137 StoreRequest(render_view_id, page_request_id, label);
138 page_request_id));
139 } else {
140 StoreRequest(render_view_id, page_request_id, label);
141 }
142 } 138 }
143 139
144 void MediaStreamDispatcherHost::OnCancelGenerateStream(int render_view_id, 140 void MediaStreamDispatcherHost::OnCancelGenerateStream(int render_view_id,
145 int page_request_id) { 141 int page_request_id) {
146 DVLOG(1) << "MediaStreamDispatcherHost::OnCancelGenerateStream(" 142 DVLOG(1) << "MediaStreamDispatcherHost::OnCancelGenerateStream("
147 << render_view_id << ", " 143 << render_view_id << ", "
148 << page_request_id << ")"; 144 << page_request_id << ")";
149 145
150 for (StreamMap::iterator it = streams_.begin(); it != streams_.end(); ++it) { 146 for (StreamMap::iterator it = streams_.begin(); it != streams_.end(); ++it) {
151 if (it->second.render_view_id == render_view_id && 147 if (it->second.render_view_id == render_view_id &&
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 MediaStreamDispatcherHost::StreamRequest 233 MediaStreamDispatcherHost::StreamRequest
238 MediaStreamDispatcherHost::PopRequest(const std::string& label) { 234 MediaStreamDispatcherHost::PopRequest(const std::string& label) {
239 StreamMap::iterator it = streams_.find(label); 235 StreamMap::iterator it = streams_.find(label);
240 CHECK(it != streams_.end()); 236 CHECK(it != streams_.end());
241 StreamRequest request = it->second; 237 StreamRequest request = it->second;
242 streams_.erase(it); 238 streams_.erase(it);
243 return request; 239 return request;
244 } 240 }
245 241
246 } // namespace content 242 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698