diff options
6 files changed, 17 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp b/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp index cffee72b65..26003ae997 100644 --- a/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp +++ b/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp @@ -389,6 +389,13 @@ Vector<Web::Cookie::Cookie> OutOfProcessWebView::notify_server_did_request_all_c return {}; } +Optional<Web::Cookie::Cookie> OutOfProcessWebView::notify_server_did_request_named_cookie(Badge<WebContentClient>, AK::URL const& url, String const& name) +{ + if (on_get_named_cookie) + return on_get_named_cookie(url, name); + return {}; +} + String OutOfProcessWebView::notify_server_did_request_cookie(Badge<WebContentClient>, const AK::URL& url, Web::Cookie::Source source) { if (on_get_cookie) diff --git a/Userland/Libraries/LibWebView/OutOfProcessWebView.h b/Userland/Libraries/LibWebView/OutOfProcessWebView.h index 36ec0dab56..f53e2666af 100644 --- a/Userland/Libraries/LibWebView/OutOfProcessWebView.h +++ b/Userland/Libraries/LibWebView/OutOfProcessWebView.h @@ -93,6 +93,7 @@ public: Function<void(i32 message_id)> on_js_console_new_message; Function<void(i32 start_index, Vector<String> const& message_types, Vector<String> const& messages)> on_get_js_console_messages; Function<Vector<Web::Cookie::Cookie>(AK::URL const& url)> on_get_all_cookies; + Function<Optional<Web::Cookie::Cookie>(AK::URL const& url, String const& name)> on_get_named_cookie; Function<String(const AK::URL& url, Web::Cookie::Source source)> on_get_cookie; Function<void(const AK::URL& url, Web::Cookie::ParsedCookie const& cookie, Web::Cookie::Source source)> on_set_cookie; Function<void(i32 count_waiting)> on_resource_status_change; @@ -156,6 +157,7 @@ private: virtual void notify_server_did_get_js_console_messages(i32 start_index, Vector<String> const& message_types, Vector<String> const& messages) override; virtual void notify_server_did_change_favicon(Gfx::Bitmap const& favicon) override; virtual Vector<Web::Cookie::Cookie> notify_server_did_request_all_cookies(Badge<WebContentClient>, AK::URL const& url) override; + virtual Optional<Web::Cookie::Cookie> notify_server_did_request_named_cookie(Badge<WebContentClient>, AK::URL const& url, String const& name) override; virtual String notify_server_did_request_cookie(Badge<WebContentClient>, const AK::URL& url, Web::Cookie::Source source) override; virtual void notify_server_did_set_cookie(Badge<WebContentClient>, const AK::URL& url, Web::Cookie::ParsedCookie const& cookie, Web::Cookie::Source source) override; virtual void notify_server_did_update_resource_count(i32 count_waiting) override; diff --git a/Userland/Libraries/LibWebView/ViewImplementation.h b/Userland/Libraries/LibWebView/ViewImplementation.h index bdd787a8b3..f0580fb816 100644 --- a/Userland/Libraries/LibWebView/ViewImplementation.h +++ b/Userland/Libraries/LibWebView/ViewImplementation.h @@ -48,6 +48,7 @@ public: virtual void notify_server_did_get_js_console_messages(i32 start_index, Vector<String> const& message_types, Vector<String> const& messages) = 0; virtual void notify_server_did_change_favicon(Gfx::Bitmap const& favicon) = 0; virtual Vector<Web::Cookie::Cookie> notify_server_did_request_all_cookies(Badge<WebContentClient>, AK::URL const& url) = 0; + virtual Optional<Web::Cookie::Cookie> notify_server_did_request_named_cookie(Badge<WebContentClient>, AK::URL const& url, String const& name) = 0; virtual String notify_server_did_request_cookie(Badge<WebContentClient>, const AK::URL& url, Web::Cookie::Source source) = 0; virtual void notify_server_did_set_cookie(Badge<WebContentClient>, const AK::URL& url, Web::Cookie::ParsedCookie const& cookie, Web::Cookie::Source source) = 0; virtual void notify_server_did_update_resource_count(i32 count_waiting) = 0; diff --git a/Userland/Libraries/LibWebView/WebContentClient.cpp b/Userland/Libraries/LibWebView/WebContentClient.cpp index 46d9e83722..b5d8a226b2 100644 --- a/Userland/Libraries/LibWebView/WebContentClient.cpp +++ b/Userland/Libraries/LibWebView/WebContentClient.cpp @@ -190,6 +190,11 @@ Messages::WebContentClient::DidRequestAllCookiesResponse WebContentClient::did_r return m_view.notify_server_did_request_all_cookies({}, url); } +Messages::WebContentClient::DidRequestNamedCookieResponse WebContentClient::did_request_named_cookie(AK::URL const& url, String const& name) +{ + return m_view.notify_server_did_request_named_cookie({}, url, name); +} + Messages::WebContentClient::DidRequestCookieResponse WebContentClient::did_request_cookie(AK::URL const& url, u8 source) { return m_view.notify_server_did_request_cookie({}, url, static_cast<Web::Cookie::Source>(source)); diff --git a/Userland/Libraries/LibWebView/WebContentClient.h b/Userland/Libraries/LibWebView/WebContentClient.h index 7e784b5adf..aa4d3a5988 100644 --- a/Userland/Libraries/LibWebView/WebContentClient.h +++ b/Userland/Libraries/LibWebView/WebContentClient.h @@ -59,6 +59,7 @@ private: virtual Messages::WebContentClient::DidRequestConfirmResponse did_request_confirm(String const&) override; virtual Messages::WebContentClient::DidRequestPromptResponse did_request_prompt(String const&, String const&) override; virtual Messages::WebContentClient::DidRequestAllCookiesResponse did_request_all_cookies(AK::URL const&) override; + virtual Messages::WebContentClient::DidRequestNamedCookieResponse did_request_named_cookie(AK::URL const&, String const&) override; virtual Messages::WebContentClient::DidRequestCookieResponse did_request_cookie(AK::URL const&, u8) override; virtual void did_set_cookie(AK::URL const&, Web::Cookie::ParsedCookie const&, u8) override; virtual void did_update_resource_count(i32 count_waiting) override; diff --git a/Userland/Services/WebContent/WebContentClient.ipc b/Userland/Services/WebContent/WebContentClient.ipc index 72eb9ad973..3754e7bbaa 100644 --- a/Userland/Services/WebContent/WebContentClient.ipc +++ b/Userland/Services/WebContent/WebContentClient.ipc @@ -37,6 +37,7 @@ endpoint WebContentClient did_get_dom_node_properties(i32 node_id, String specified_style, String computed_style, String custom_properties, String node_box_sizing_json) =| did_change_favicon(Gfx::ShareableBitmap favicon) =| did_request_all_cookies(URL url) => (Vector<Web::Cookie::Cookie> cookies) + did_request_named_cookie(URL url, String name) => (Optional<Web::Cookie::Cookie> cookie) did_request_cookie(URL url, u8 source) => (String cookie) did_set_cookie(URL url, Web::Cookie::ParsedCookie cookie, u8 source) =| did_update_resource_count(i32 count_waiting) =| |