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

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

Issue 1873293002: Report if video capturing meets output protection requirement. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments. Created 4 years, 8 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
Index: content/browser/renderer_host/media/media_stream_manager.cc
diff --git a/content/browser/renderer_host/media/media_stream_manager.cc b/content/browser/renderer_host/media/media_stream_manager.cc
index 7b75f93f6a87b341b49b576eb33ea6cda62207a0..ff59879729214485f5fb337bbd5210dc93169366 100644
--- a/content/browser/renderer_host/media/media_stream_manager.cc
+++ b/content/browser/renderer_host/media/media_stream_manager.cc
@@ -312,6 +312,17 @@ class MediaStreamManager::DeviceRequest {
return state_[stream_type];
}
+ void SetCapturingLinkSecured(bool is_secure) {
+ MediaObserver* media_observer =
+ GetContentClient()->browser()->GetMediaObserver();
+ if (!media_observer)
+ return;
+
+ media_observer->OnSetCapturingLinkSecured(target_process_id_,
+ target_frame_id_, page_request_id,
+ video_type_, is_secure);
+ }
+
MediaStreamRequester* const requester; // Can be NULL.
@@ -2118,4 +2129,23 @@ bool MediaStreamManager::DoesMediaDeviceIDMatchHMAC(
return guid_from_raw_device_id == device_guid;
}
+void MediaStreamManager::SetCapturingLinkSecured(
+ int session_id,
+ const std::string& stream_device_id,
+ bool is_secure) {
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
+
+ for (LabeledDeviceRequest& labeled_request : requests_) {
+ DeviceRequest* request = labeled_request.second;
+ for (const StreamDeviceInfo& device_info : request->devices) {
+ if (device_info.session_id == session_id &&
+ device_info.device.id == stream_device_id) {
+ DCHECK(device_info.device.type == content::MEDIA_TAB_VIDEO_CAPTURE ||
+ device_info.device.type == content::MEDIA_DESKTOP_VIDEO_CAPTURE);
+ request->SetCapturingLinkSecured(is_secure);
+ }
+ }
+ }
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698