summaryrefslogtreecommitdiff
path: root/Userland/Services
diff options
context:
space:
mode:
authorBrandon Scott <xeons@users.noreply.github.com>2021-02-23 06:14:12 -0600
committerAndreas Kling <kling@serenityos.org>2021-02-23 16:23:56 +0100
commit306501fd4afa5fb6bf48f15aecd5921597a0d6cc (patch)
tree0a4a87cd8289704dbcea1fed1b348b549a0066d9 /Userland/Services
parenta032c836c43347aae9e082a79ca3ecf681e7b26f (diff)
downloadserenity-306501fd4afa5fb6bf48f15aecd5921597a0d6cc.zip
WebContent: Added IPC calls for getting source
Diffstat (limited to 'Userland/Services')
-rw-r--r--Userland/Services/WebContent/ClientConnection.cpp7
-rw-r--r--Userland/Services/WebContent/ClientConnection.h1
-rw-r--r--Userland/Services/WebContent/WebContentClient.ipc1
-rw-r--r--Userland/Services/WebContent/WebContentServer.ipc1
4 files changed, 10 insertions, 0 deletions
diff --git a/Userland/Services/WebContent/ClientConnection.cpp b/Userland/Services/WebContent/ClientConnection.cpp
index 74c4efb678..88a3bf713e 100644
--- a/Userland/Services/WebContent/ClientConnection.cpp
+++ b/Userland/Services/WebContent/ClientConnection.cpp
@@ -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()));
+ }
+}
+
}
diff --git a/Userland/Services/WebContent/ClientConnection.h b/Userland/Services/WebContent/ClientConnection.h
index 9ea691ae49..123f270f8d 100644
--- a/Userland/Services/WebContent/ClientConnection.h
+++ b/Userland/Services/WebContent/ClientConnection.h
@@ -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();
diff --git a/Userland/Services/WebContent/WebContentClient.ipc b/Userland/Services/WebContent/WebContentClient.ipc
index 9ca013cd1e..32a9c9a854 100644
--- a/Userland/Services/WebContent/WebContentClient.ipc
+++ b/Userland/Services/WebContent/WebContentClient.ipc
@@ -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) =|
}
diff --git a/Userland/Services/WebContent/WebContentServer.ipc b/Userland/Services/WebContent/WebContentServer.ipc
index 3debce25d8..de36e4f07b 100644
--- a/Userland/Services/WebContent/WebContentServer.ipc
+++ b/Userland/Services/WebContent/WebContentServer.ipc
@@ -21,4 +21,5 @@ endpoint WebContentServer = 89
KeyDown(i32 key, unsigned modifiers, u32 code_point) =|
DebugRequest(String request, String argument) =|
+ GetSource() =|
}