mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 17:19:13 +00:00
LibWeb: Make EventLoopPlugin::deferred_invoke take a HeapFunction
This commit is contained in:
parent
7487a782db
commit
29cea5bd24
Notes:
github-actions[bot]
2024-10-30 19:57:08 +00:00
Author: https://github.com/shannonbooth
Commit: 29cea5bd24
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2062
Reviewed-by: https://github.com/kalenikaliaksandr ✅
21 changed files with 75 additions and 73 deletions
|
@ -92,10 +92,10 @@ static WebIDL::ExceptionOr<JS::NonnullGCPtr<DOM::Document>> load_html_document(H
|
|||
else {
|
||||
// FIXME: Parse as we receive the document data, instead of waiting for the whole document to be fetched first.
|
||||
auto process_body = JS::create_heap_function(document->heap(), [document, url = navigation_params.response->url().value(), mime_type = navigation_params.response->header_list()->extract_mime_type()](ByteBuffer data) {
|
||||
Platform::EventLoopPlugin::the().deferred_invoke([document = document, data = move(data), url = url, mime_type] {
|
||||
Platform::EventLoopPlugin::the().deferred_invoke(JS::create_heap_function(document->heap(), [document = document, data = move(data), url = url, mime_type] {
|
||||
auto parser = HTML::HTMLParser::create_with_uncertain_encoding(document, data, mime_type);
|
||||
parser->run(url);
|
||||
});
|
||||
}));
|
||||
});
|
||||
|
||||
auto process_body_error = JS::create_heap_function(document->heap(), [](JS::Value) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue