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

Unified Diff: chrome/browser/media/desktop_capture_access_handler.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. Rebased. 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: chrome/browser/media/desktop_capture_access_handler.cc
diff --git a/chrome/browser/media/desktop_capture_access_handler.cc b/chrome/browser/media/desktop_capture_access_handler.cc
index ff396ebabc724c6ddf1b1bcb2487d11b971737b2..bc407050918ea547303e08352788d2d54cb84e10 100644
--- a/chrome/browser/media/desktop_capture_access_handler.cc
+++ b/chrome/browser/media/desktop_capture_access_handler.cc
@@ -445,40 +445,14 @@ void DesktopCaptureAccessHandler::HandleRequest(
GetApplicationTitle(web_contents, extension),
base::UTF8ToUTF16(original_extension_name));
- callback.Run(devices, content::MEDIA_DEVICE_OK, std::move(ui));
-}
-
-void DesktopCaptureAccessHandler::UpdateMediaRequestState(
- int render_process_id,
- int render_frame_id,
- int page_request_id,
- content::MediaStreamType stream_type,
- content::MediaRequestState state) {
- DCHECK_CURRENTLY_ON(BrowserThread::UI);
- // Track desktop capture sessions. Tracking is necessary to avoid unbalanced
- // session counts since not all requests will reach MEDIA_REQUEST_STATE_DONE,
- // but they will all reach MEDIA_REQUEST_STATE_CLOSING.
- if (stream_type != content::MEDIA_DESKTOP_VIDEO_CAPTURE)
- return;
+ bool is_extension_trusted =
miu 2016/04/26 01:25:13 Consider rolling this into CaptureAccessHandlerBas
xjz 2016/04/29 00:11:42 Done.
+ MediaCaptureDevicesDispatcher::IsOriginForCasting(
+ request.security_origin) ||
+ IsExtensionWhitelistedForScreenCapture(extension) ||
+ IsBuiltInExtension(request.security_origin);
+ UpdateExtensionTrusted(request.render_process_id, request.render_frame_id,
+ request.page_request_id, is_extension_trusted);
- if (state == content::MEDIA_REQUEST_STATE_DONE) {
- DesktopCaptureSession session = {
- render_process_id, render_frame_id, page_request_id};
- desktop_capture_sessions_.push_back(session);
- } else if (state == content::MEDIA_REQUEST_STATE_CLOSING) {
- for (DesktopCaptureSessions::iterator it =
- desktop_capture_sessions_.begin();
- it != desktop_capture_sessions_.end(); ++it) {
- if (it->render_process_id == render_process_id &&
- it->render_frame_id == render_frame_id &&
- it->page_request_id == page_request_id) {
- desktop_capture_sessions_.erase(it);
- break;
- }
- }
- }
+ callback.Run(devices, content::MEDIA_DEVICE_OK, std::move(ui));
}
-bool DesktopCaptureAccessHandler::IsCaptureInProgress() {
- return desktop_capture_sessions_.size() > 0;
-}

Powered by Google App Engine
This is Rietveld 408576698