8000 chore: cherry-pick 6a6361c9f31c from chromium by ppontes · Pull Request #28703 · electron/electron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

chore: cherry-pick 6a6361c9f31c from chromium #28703

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
8000 Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions patches/chromium/.patches
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,5 @@ cherry-pick-37210e5ab006.patch
reland_reland_fsa_add_issafepathcomponent_checks_to.patch
css_make_fetches_from_inline_css_use_the_document_s_url_as_referrer.patch
cherry-pick-3c80bb2a594f.patch
cherry-pick-6a6361c9f31c.patch
cherry-pick-012e9baf46c9.patch
48 changes: 48 additions & 0 deletions patches/chromium/cherry-pick-6a6361c9f31c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Palak Agarwal <agpalak@chromium.org>
Date: Wed, 31 Mar 2021 16:10:26 +0000
Subject: WebContents bug fix: Device capture only if web contents is valid

(cherry picked from commit a462be0883486431086c5f07cdafbd3607005a59)

(cherry picked from commit e6f11cafde08981e47ba77e71abf99a271f7a042)

Bug: 1181228
Change-Id: I0a4c9718a3c0ccb52cefa4565b9787e6912554c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2752235
Reviewed-by: Guido Urdaneta <guidou@chromium.org>
Commit-Queue: Palak Agarwal <agpalak@chromium.org>
Cr-Original-Original-Commit-Position: refs/heads/master@{#863828}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2782122
Auto-Submit: Guido Urdaneta <guidou@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Original-Commit-Position: refs/branch-heads/4389@{#1586}
Cr-Original-Branched-From: 9251c5db2b6d5a59fe4eac7aafa5fed37c139bb7-refs/heads/master@{#843830}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2795101
Reviewed-by: Victor-Gabriel Savu <vsavu@google.com>
Reviewed-by: Artem Sumaneev <asumaneev@google.com>
Auto-Submit: Artem Sumaneev <asumaneev@google.com>
Commit-Queue: Guido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/branch-heads/4240@{#1585}
Cr-Branched-From: f297677702651916bbf65e59c0d4bbd4ce57d1ee-refs/heads/master@{#800218}

diff --git a/chrome/browser/media/webrtc/desktop_capture_access_handler.cc b/chrome/browser/media/webrtc/desktop_capture_access_handler.cc
index e3f7e784f0339581a1c8a50301f8dbfd465abbfd..1f0811610e155715cc5cd72bbaa7e703728a1fe5 100644
--- a/chrome/browser/media/webrtc/desktop_capture_access_handler.cc
+++ b/chrome/browser/media/webrtc/desktop_capture_access_handler.cc
@@ -248,6 +248,14 @@ void DesktopCaptureAccessHandler::ProcessScreenCaptureAccessRequest(
const bool display_notification =
display_notification_ && ShouldDisplayNotification(extension);

+ if (!content::WebContents::FromRenderFrameHost(
+ content::RenderFrameHost::FromID(request.render_process_id,
+ request.render_frame_id))) {
+ std::move(callback).Run(
+ devices, blink::mojom::MediaStreamRequestResult::INVALID_STATE,
+ std::move(ui));
+ return;
+ }
ui = GetDevicesForDesktopCapture(
web_contents, &devices, screen_id,
blink::mojom::MediaStreamType::GUM_DESKTOP_VIDEO_CAPTURE,
0