libservo: Convert intercept_web_resource_load into load_web_resource (#35564)

Rework the `WebViewDelegate::intercept_web_resource_load` into
`WebViewDelegate::load_web_resource` and clean up internal messaging.
The main thing here is adding objects which manage the response to these
delegate methods. Now we have `WebResourceLoad` and
`InterceptedWebResourceLoad` which make it much harder to misuse the
API.

In addition, the internal messaging for this is cleaned up. Canceling
and finishing the load are unrelated to the HTTP body so they are no
longer subtypes of an HttpBodyData message. Processing of messages is
made a bit more efficient by collecting all body chunks in a vector and
only flattening the chunks at the end.

Finally, "interceptor" is a much more common spelling than "intercepter"
so I've gone ahead and made this change everywhere.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Martin Robinson 2025-02-21 15:36:42 +01:00 committed by GitHub
parent f6e2e3d418
commit cf2b93f18a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 245 additions and 208 deletions

View file

@ -18,7 +18,7 @@ pub mod image_cache;
pub mod local_directory_listing;
pub mod mime_classifier;
pub mod protocols;
pub mod request_intercepter;
pub mod request_interceptor;
pub mod resource_thread;
mod storage_thread;
pub mod subresource_integrity;