Commit d829cb6e authored by Ilya Nikolaevskiy's avatar Ilya Nikolaevskiy Committed by Chromium LUCI CQ

Revert "Minor UI logic changes to prevent a UAF bug when starting tab capture."

This reverts commit 3ca3d70c.

Reason for revert: Broke "Share this tab instead" button.

Original change's description:
> Minor UI logic changes to prevent a UAF bug when starting tab capture.
>
> See discussion in crbug 1155426 for details. Changes:
>
> MediaStreamCaptureIndicator::UIDelegate: Ignore multiple calls to
> OnStarted().
>
> TabSharingUIViews: Unconditionally execute clean-up tasks in destructor.
>
> Bug: 1155426
> Change-Id: I392fba38118ce51744ba36b4dec19ebfe39f1fbe
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2581028
> Reviewed-by: Guido Urdaneta <guidou@chromium.org>
> Reviewed-by: Marina Ciocea <marinaciocea@chromium.org>
> Commit-Queue: Yuri Wiitala <miu@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#835736}

TBR=miu@chromium.org,guidou@chromium.org,marinaciocea@chromium.org,chromium-scoped@luci-project-accounts.iam.gserviceaccount.com

# Not skipping CQ checks because original CL landed > 1 day ago.

TBR=marinaciocea@chromium.org

Bug: 1155426, 1165947
Change-Id: I9df25d596cb4df7b5e98db78f019b2665b01e8b5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2627848
Commit-Queue: Ilya Nikolaevskiy <ilnik@chromium.org>
Reviewed-by: default avatarIlya Nikolaevskiy <ilnik@chromium.org>
Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#843148}
parent a1bf255b
......@@ -213,12 +213,7 @@ class MediaStreamCaptureIndicator::UIDelegate : public content::MediaStreamUI {
const std::string& label,
std::vector<content::DesktopMediaID> screen_capture_ids,
StateChangeCallback state_change_callback) override {
if (started_) {
// Ignore possibly-compromised renderers that might call
// MediaStreamDispatcherHost::OnStreamStarted() more than once.
// See: https://crbug.com/1155426
return 0;
}
DCHECK(!started_);
started_ = true;
if (device_usage_) {
......
......@@ -135,9 +135,7 @@ TabSharingUIViews::TabSharingUIViews(const content::DesktopMediaID& media_id,
}
TabSharingUIViews::~TabSharingUIViews() {
// Unconditionally call StopSharing(), to ensure all clean-up has been
// performed if tasks race (e.g., OnStarted() is called after
// OnInfoBarRemoved()). See: https://crbug.com/1155426
if (!infobars_.empty())
StopSharing();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment