libservo: Flesh out permissions API (#35396)

- Update the script crate to better reflect the modern Permission
  specifcation -- removing the necessity for an `Insecure` variant of
  the permissions prompt.
- Have all allow/deny type requests in the internal API use an
  `AllowOrDeny` enum for clarity.
- Expose `PermissionsRequest` and `PermissionFeature` data types to the
  API and use them in the delegate method.
- Update both servoshell implementations to use the API.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
This commit is contained in:
Martin Robinson 2025-02-10 16:50:33 +01:00 committed by GitHub
parent b72932bc88
commit f51a5661f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 211 additions and 207 deletions

View file

@ -26,7 +26,7 @@ use devtools_traits::{
DevtoolsControlMsg, DevtoolsPageInfo, LogLevel, NavigationState, NetworkEvent, PageError,
ScriptToDevtoolsControlMsg, WorkerId,
};
use embedder_traits::{EmbedderMsg, EmbedderProxy};
use embedder_traits::{AllowOrDeny, EmbedderMsg, EmbedderProxy};
use ipc_channel::ipc::{self, IpcSender};
use log::{debug, trace, warn};
use serde::Serialize;
@ -764,5 +764,5 @@ fn allow_devtools_client(stream: &mut TcpStream, embedder: &EmbedderProxy, token
// No token found. Prompt user
let (request_sender, request_receiver) = ipc::channel().expect("Failed to create IPC channel!");
embedder.send(EmbedderMsg::RequestDevtoolsConnection(request_sender));
request_receiver.recv().unwrap()
request_receiver.recv().unwrap() == AllowOrDeny::Allow
}