![trop[bot]](/assets/img/avatar_default.png)
* chore: bump chromium to 126.0.6445.0 31-x-y * chore: bump chromium in DEPS to 125.0.6421.0 * chore: bump chromium in DEPS to 125.0.6422.0 * Add ENABLE_BASE_TRACING flags for compatibility with enable_base_tracing = false on Windows5434658
* chore: update patches * fixup: Add ENABLE_BASE_TRACING flags for compatibility with enable_base_tracing = false on Windows * chore: bump chromium in DEPS to 126.0.6423.0 * chore: update patches * 5426599: Next generation control of unsafe-buffers-usage plugin5426599
* chore: bump chromium in DEPS to 126.0.6425.0 * chore: update patches * Roll clang+rust llvmorg-19-init-7229-g315c88c5-2 : llvmorg-19-init-8091-gab037c4f-1 / ceab6128fa48a616bfd3e3adf4bc80133b8ee223-1 : ab71ee7a9214c2793108a41efb065aa77aeb7326-15444328
Also see https://issues.chromium.org/issues/332931387 * 5445074: [Views AX] Move AXEventNotificationDetails to ui/accessibility/5445074
Also 5455993: [Views AX] Rename AXEventNotificationDetails to AXUpdatesAndEvents |5455993
* Pass IsolationInfo to ContentBrowserClient::WillCreateURLLoaderFactory()5405301
* chore: bump chromium in DEPS to 126.0.6427.0 * chore: update patches * chore: remove no longer needed patch perfetto is now turned on so this patch is no longer needed. * chore: bump chromium in DEPS to 126.0.6429.0 * chore: bump chromium in DEPS to 126.0.6431.0 * chore: bump chromium in DEPS to 126.0.6433.0 * 5466654: Do not create a console if logging to a handle5466654
* chore: fixup patch indices * Address Linux NonClientFrameView Changes -5180720
-5367794
* chore: bump chromium in DEPS to 126.0.6435.0 * chore: bump chromium in DEPS to 126.0.6437.0 * chore: update patches * chore: bump chromium in DEPS to 126.0.6439.0 * chore: bump chromium in DEPS to 126.0.6441.0 * 5477689: components/crash/content/tools: Format with yapf |5477689
* 5485006: Remove enable_print_content_analysis GN flag |5485006
* chore: update chromium patches * chore: bump chromium in DEPS to 126.0.6443.0 * 5465608: Convert DCHECKs near RenderWidgetHost, DelegatedFrameHost to CHECK |5465608
* 5492605: Migrate TODOs referencing old crbug IDs to the new issue tracker IDs |5492605
* chore: update patches * chore: bump chromium in DEPS to 126.0.6445.0 * chore: update patches * 5468588: Fullscreen: Encapsulate ExclusiveAccessBubble params in a struct |5468588
* fixup! 5485006: Remove enable_print_content_analysis GN flag |5485006
* 5461340: `size_t` in `mojo::DataPipe[Consumer|Producer]Handle`: /components. |5461340
* 5480213: Add an EvictIds struct to FrameEvictorClient |5480213
* 4341506: [api] Deprecate Isolate::IdleNotificationDeadline |4341506
* 5300826: [v8-tasks] Add source location to v8::TaskRunner, step 4/4. |5300826
* partially revert is_newly_created to allow for browser initiated about:blank loads * add dep on app_launch_prefetch Ref:5420149
* install sysroots from electron not from chrome We should add a new var upstream for `download_sysroots` so that we can skip downloading chromes at all. Ref:5462469
* refactor: make UpdateFrameHints an override Ref:5473548
* fix ppapi * refactor: update namespace for pwm switches Ref:5444617
* 5459367: WebSQL: Restrict WebSQL service creation to Android only |5459367
* 5455853: Revert "[Clipboard] Don't add meta charset tag for async write() method on Mac." |5455853
* fixup! refactor: update namespace for pwm switches edd9e26 Ref:5444617
* 5147611: [heap] Add checks for ensuring position info slow path is not used in heap snapshot |5147611
* fixup! 5412666: [heap] Also avoid heap allocation for allocation tracked functions |5412666
* chore: add websql removal to breaking-changes.md --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> Co-authored-by: VerteDinde <vertedinde@electronjs.org> Co-authored-by: Keeley Hammond <khammond@slack-corp.com> Co-authored-by: Samuel Attard <marshallofsound@electronjs.org> Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> * chore: update .patches after trop * chore: update patches --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> Co-authored-by: PatchUp <73610968+patchup[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 fd5f81970957d970b7d234f45c4948395a461a7a..386599be509389c9bf850c330e76e449dd685318 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() {
|
|
@@ -429,6 +437,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 =
|
|
@@ -439,6 +448,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();
|
|
|