WebContent: Added IPC calls for getting source

This commit is contained in:
Brandon Scott 2021-02-23 06:14:12 -06:00 committed by Andreas Kling
parent a032c836c4
commit 306501fd4a
Notes: sideshowbarker 2024-07-18 21:59:40 +09:00
4 changed files with 10 additions and 0 deletions

View file

@ -209,4 +209,11 @@ void ClientConnection::handle(const Messages::WebContentServer::DebugRequest& me
}
}
void ClientConnection::handle(const Messages::WebContentServer::GetSource&)
{
if (auto* doc = page().main_frame().document()) {
post_message(Messages::WebContentClient::DidGetSource(doc->url(), doc->source()));
}
}
}

View file

@ -64,6 +64,7 @@ private:
virtual void handle(const Messages::WebContentServer::AddBackingStore&) override;
virtual void handle(const Messages::WebContentServer::RemoveBackingStore&) override;
virtual void handle(const Messages::WebContentServer::DebugRequest&) override;
virtual void handle(const Messages::WebContentServer::GetSource&) override;
void flush_pending_paint_requests();

View file

@ -17,4 +17,5 @@ endpoint WebContentClient = 90
DidRequestAlert(String message) => ()
DidRequestConfirm(String message) => (bool result)
DidRequestPrompt(String message, String default_) => (String response)
DidGetSource(URL url, String source) =|
}

View file

@ -21,4 +21,5 @@ endpoint WebContentServer = 89
KeyDown(i32 key, unsigned modifiers, u32 code_point) =|
DebugRequest(String request, String argument) =|
GetSource() =|
}