![electron-roller[bot]](/assets/img/avatar_default.png)
* chore: bump chromium in DEPS to 134.0.6998.1 * chore: bump chromium in DEPS to 134.0.6998.5 * chore: bump chromium in DEPS to 134.0.6998.3 * chore: bump chromium to 134.0.6988.0 (main) (#45334) * chore: bump chromium in DEPS to 134.0.6976.0 * chore: update mas_avoid_private_macos_api_usage.patch.patch6171046
process_info_mac.cc -> process_info_mac.mm * chore: update build_do_not_depend_on_packed_resource_integrity.patch6196857
* chore: update feat_add_support_for_missing_dialog_features_to_shell_dialogs.patch6182296
6183404
6187853
A lot changed in the upstream implementation. There's a good chance I got this wrong as threading has changed and moved some variables into globals. * chore: remove build_remove_vr_directx_helpers_dependency.patch6186102
This landed upstream * chore: e patches all * chore: update net::CookieInclusionStatus::ExclusionReason enum6183252
6185544
* chore: update content::WebAuthenticationDelegate import6189769
* Revert "chore: disable focus handling test due to win32/ia32 regression" This reverts commit 1a57ba5d59848d0c841ddda59c9299a4f957452a. * chore: bump chromium in DEPS to 134.0.6978.0 * chore: bump chromium in DEPS to 134.0.6980.0 * chore: bump chromium in DEPS to 134.0.6982.0 * chore: bump chromium in DEPS to 134.0.6984.0 * 6196281: Allow direct embedder IsPdfInternalPluginAllowedOrigin() interaction6196281
* 6196283: Delete PdfInternalPluginDelegate6196283
* chore: update patches * chore: bump chromium in DEPS to 134.0.6986.0 * chore: update patches * 6205762: Support option to use window.showSaveFilePicker() in PDF attachment code6205762
See also: * https://issues.chromium.org/issues/373852607 * 5939153: [PDF] Add PdfUseShowSaveFilePicker feature flag |5939153
* 6205761: Delete spurious Ink-specific code in pdf_viewer.ts |6205761
* 6209609: Remove WebVector: Automatic changes6209609
* 6205488: UI: make QT5 optional6205488
* 6178281: Rename pak files from branding strings6178281
* fixup! 6209609: Remove WebVector: Automatic changes6209609
* 6193249: Switch from safe_browsing::EventResult to enterprise_connectors:EventResult6193249
* 6197457: Remove Pause/ResumeReadingBodyFromNet IPCs6197457
* 6191230: Record total time spent on a picture in picture window6191230
* chore: bump chromium in DEPS to 134.0.6988.0 * chore: update patches * 6215440: Remove base/ranges/.6215440
* Disable unsafe buffers error Not sure what changed, but we're now seeing unsafe buffer errors in Chromium code, at least when using reclient. Will update this comment if we find out the cause. * 6187853: SelectFileDialogLinuxPortal: Use dbus_xdg::Request and DbusType6187853
* fix `setDisplayMediaRequestHandler` test Given how this test is written, I would expect this assertion to be false. It seems the oppositue was true before, but that was also acknowledged to be suprising. Seems that the underlying implementation is now fixed and works as expected. * fixup! 6187853: SelectFileDialogLinuxPortal: Use dbus_xdg::Request and DbusType6187853
* chore: udpate patches * Multiple PRS:6185544
|6183252
* fix: cast enum class to numeric type * fix: add 1 to MAX_EXCLUSION_REASON because enum values are zero-based, and we want the total count of reasons. * Reapply "chore: disable focus handling test due to win32/ia32 regression" This reverts commit 760b1a519b5919b483c66bc3096eeefb4d7011f4. * refactor: use ExclusionReasonBitset::kValueCount for size --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Samuel Maddock <smaddock@slack-corp.com> Co-authored-by: clavin <clavin@electronjs.org> Co-authored-by: alice <alice@makenotion.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> (cherry picked from commit213165a467
) --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
104 lines
4.7 KiB
Diff
104 lines
4.7 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Jeremy Rose <japthorp@slack-corp.com>
|
|
Date: Tue, 12 Jul 2022 16:51:43 -0700
|
|
Subject: short-circuit permissions checks in MediaStreamDevicesController
|
|
|
|
The //components/permissions architecture is complicated and not that
|
|
widely used in Chromium, and mostly oriented around showing permissions
|
|
UI and/or remembering per-site permissions, which we're not interested
|
|
in.
|
|
|
|
Since we do a permissions check prior to invoking the
|
|
MediaStreamDevicesController, and don't (yet) provide the ability to set
|
|
granular permissions (e.g. allow video but not audio), just
|
|
short-circuit all the permissions checks in MSDC for now to allow us to
|
|
unduplicate this code.
|
|
|
|
diff --git a/components/webrtc/media_stream_devices_controller.cc b/components/webrtc/media_stream_devices_controller.cc
|
|
index 13929e4f6c1997a9071a2d1e3982a8c8feac84e4..a9719f72b9994537665c7f6a433ea8499b42122d 100644
|
|
--- a/components/webrtc/media_stream_devices_controller.cc
|
|
+++ b/components/webrtc/media_stream_devices_controller.cc
|
|
@@ -57,7 +57,8 @@ bool PermissionIsRequested(blink::PermissionType permission,
|
|
void MediaStreamDevicesController::RequestPermissions(
|
|
const content::MediaStreamRequest& request,
|
|
MediaStreamDeviceEnumerator* enumerator,
|
|
- ResultCallback callback) {
|
|
+ ResultCallback callback,
|
|
+ bool previously_approved) {
|
|
content::RenderFrameHost* rfh = content::RenderFrameHost::FromID(
|
|
request.render_process_id, request.render_frame_id);
|
|
// The RFH may have been destroyed by the time the request is processed.
|
|
@@ -92,7 +93,7 @@ void MediaStreamDevicesController::RequestPermissions(
|
|
std::move(callback)));
|
|
|
|
std::vector<blink::PermissionType> permission_types;
|
|
-
|
|
+#if 0
|
|
content::PermissionController* permission_controller =
|
|
web_contents->GetBrowserContext()->GetPermissionController();
|
|
|
|
@@ -165,19 +166,26 @@ void MediaStreamDevicesController::RequestPermissions(
|
|
requested_audio_capture_device_ids;
|
|
permission_request_description.requested_video_capture_device_ids =
|
|
requested_video_capture_device_ids;
|
|
-
|
|
+#endif
|
|
// It is OK to ignore `request.security_origin` because it will be calculated
|
|
// from `render_frame_host` and we always ignore `requesting_origin` for
|
|
// `AUDIO_CAPTURE` and `VIDEO_CAPTURE`.
|
|
// `render_frame_host->GetMainFrame()->GetLastCommittedOrigin()` will be used
|
|
// instead.
|
|
- rfh->GetBrowserContext()
|
|
- ->GetPermissionController()
|
|
- ->RequestPermissionsFromCurrentDocument(
|
|
- rfh, permission_request_description,
|
|
- base::BindOnce(
|
|
- &MediaStreamDevicesController::PromptAnsweredGroupedRequest,
|
|
- std::move(controller)));
|
|
+ if (previously_approved) {
|
|
+ controller->PromptAnsweredGroupedRequest({blink::mojom::PermissionStatus::GRANTED /*audio*/,
|
|
+ blink::mojom::PermissionStatus::GRANTED /*video*/});
|
|
+ } else {
|
|
+ rfh->GetBrowserContext()
|
|
+ ->GetPermissionController()
|
|
+ ->RequestPermissionsFromCurrentDocument(
|
|
+ rfh,
|
|
+ content::PermissionRequestDescription(permission_types,
|
|
+ request.user_gesture),
|
|
+ base::BindOnce(
|
|
+ &MediaStreamDevicesController::PromptAnsweredGroupedRequest,
|
|
+ std::move(controller)));
|
|
+ }
|
|
}
|
|
|
|
MediaStreamDevicesController::~MediaStreamDevicesController() {
|
|
@@ -426,6 +434,7 @@ bool MediaStreamDevicesController::PermissionIsBlockedForReason(
|
|
return false;
|
|
}
|
|
|
|
+#if 0
|
|
// TODO(raymes): This function wouldn't be needed if
|
|
// PermissionManager::RequestPermissions returned a denial reason.
|
|
content::PermissionResult result =
|
|
@@ -436,6 +445,7 @@ bool MediaStreamDevicesController::PermissionIsBlockedForReason(
|
|
DCHECK_EQ(blink::mojom::PermissionStatus::DENIED, result.status);
|
|
return true;
|
|
}
|
|
+#endif
|
|
return false;
|
|
}
|
|
|
|
diff --git a/components/webrtc/media_stream_devices_controller.h b/components/webrtc/media_stream_devices_controller.h
|
|
index 4d3bf184243a4c1296f41070e934730a3bd2620e..78610ff9fb93cfa1c9aae898d6f8c83520fc860a 100644
|
|
--- a/components/webrtc/media_stream_devices_controller.h
|
|
+++ b/components/webrtc/media_stream_devices_controller.h
|
|
@@ -48,7 +48,8 @@ class MediaStreamDevicesController {
|
|
// synchronously or asynchronously returned via |callback|.
|
|
static void RequestPermissions(const content::MediaStreamRequest& request,
|
|
MediaStreamDeviceEnumerator* enumerator,
|
|
- ResultCallback callback);
|
|
+ ResultCallback callback,
|
|
+ bool previously_approved = false);
|
|
|
|
~MediaStreamDevicesController();
|
|
|