mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +00:00
LibWeb+WebContent: Port the did_request_named_cookie
IPC to String
This commit is contained in:
parent
9b957ead13
commit
c4820838bf
|
@ -263,7 +263,7 @@ public:
|
||||||
virtual void page_did_request_accept_dialog() { }
|
virtual void page_did_request_accept_dialog() { }
|
||||||
virtual void page_did_request_dismiss_dialog() { }
|
virtual void page_did_request_dismiss_dialog() { }
|
||||||
virtual Vector<Web::Cookie::Cookie> page_did_request_all_cookies(AK::URL const&) { return {}; }
|
virtual Vector<Web::Cookie::Cookie> page_did_request_all_cookies(AK::URL const&) { return {}; }
|
||||||
virtual Optional<Web::Cookie::Cookie> page_did_request_named_cookie(AK::URL const&, ByteString const&) { return {}; }
|
virtual Optional<Web::Cookie::Cookie> page_did_request_named_cookie(AK::URL const&, String const&) { return {}; }
|
||||||
virtual String page_did_request_cookie(const AK::URL&, Cookie::Source) { return {}; }
|
virtual String page_did_request_cookie(const AK::URL&, Cookie::Source) { return {}; }
|
||||||
virtual void page_did_set_cookie(const AK::URL&, Cookie::ParsedCookie const&, Cookie::Source) { }
|
virtual void page_did_set_cookie(const AK::URL&, Cookie::ParsedCookie const&, Cookie::Source) { }
|
||||||
virtual void page_did_update_cookie(Web::Cookie::Cookie) { }
|
virtual void page_did_update_cookie(Web::Cookie::Cookie) { }
|
||||||
|
|
|
@ -152,7 +152,7 @@ public:
|
||||||
Function<void(i32 message_id)> on_received_console_message;
|
Function<void(i32 message_id)> on_received_console_message;
|
||||||
Function<void(i32 start_index, Vector<ByteString> const& message_types, Vector<ByteString> const& messages)> on_received_console_messages;
|
Function<void(i32 start_index, Vector<ByteString> const& message_types, Vector<ByteString> const& messages)> on_received_console_messages;
|
||||||
Function<Vector<Web::Cookie::Cookie>(AK::URL const& url)> on_get_all_cookies;
|
Function<Vector<Web::Cookie::Cookie>(AK::URL const& url)> on_get_all_cookies;
|
||||||
Function<Optional<Web::Cookie::Cookie>(AK::URL const& url, ByteString const& name)> on_get_named_cookie;
|
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<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(const AK::URL& url, Web::Cookie::ParsedCookie const& cookie, Web::Cookie::Source source)> on_set_cookie;
|
||||||
Function<void(Web::Cookie::Cookie const& cookie)> on_update_cookie;
|
Function<void(Web::Cookie::Cookie const& cookie)> on_update_cookie;
|
||||||
|
|
|
@ -302,7 +302,7 @@ Messages::WebContentClient::DidRequestAllCookiesResponse WebContentClient::did_r
|
||||||
return Vector<Web::Cookie::Cookie> {};
|
return Vector<Web::Cookie::Cookie> {};
|
||||||
}
|
}
|
||||||
|
|
||||||
Messages::WebContentClient::DidRequestNamedCookieResponse WebContentClient::did_request_named_cookie(AK::URL const& url, ByteString const& name)
|
Messages::WebContentClient::DidRequestNamedCookieResponse WebContentClient::did_request_named_cookie(AK::URL const& url, String const& name)
|
||||||
{
|
{
|
||||||
if (m_view.on_get_named_cookie)
|
if (m_view.on_get_named_cookie)
|
||||||
return m_view.on_get_named_cookie(url, name);
|
return m_view.on_get_named_cookie(url, name);
|
||||||
|
|
|
@ -69,7 +69,7 @@ private:
|
||||||
virtual void did_request_accept_dialog() override;
|
virtual void did_request_accept_dialog() override;
|
||||||
virtual void did_request_dismiss_dialog() override;
|
virtual void did_request_dismiss_dialog() override;
|
||||||
virtual Messages::WebContentClient::DidRequestAllCookiesResponse did_request_all_cookies(AK::URL 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&, ByteString 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&, Web::Cookie::Source) override;
|
virtual Messages::WebContentClient::DidRequestCookieResponse did_request_cookie(AK::URL const&, Web::Cookie::Source) override;
|
||||||
virtual void did_set_cookie(AK::URL const&, Web::Cookie::ParsedCookie const&, Web::Cookie::Source) override;
|
virtual void did_set_cookie(AK::URL const&, Web::Cookie::ParsedCookie const&, Web::Cookie::Source) override;
|
||||||
virtual void did_update_cookie(Web::Cookie::Cookie const&) override;
|
virtual void did_update_cookie(Web::Cookie::Cookie const&) override;
|
||||||
|
|
|
@ -463,7 +463,7 @@ Vector<Web::Cookie::Cookie> PageClient::page_did_request_all_cookies(URL const&
|
||||||
return client().did_request_all_cookies(url);
|
return client().did_request_all_cookies(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
Optional<Web::Cookie::Cookie> PageClient::page_did_request_named_cookie(URL const& url, ByteString const& name)
|
Optional<Web::Cookie::Cookie> PageClient::page_did_request_named_cookie(URL const& url, String const& name)
|
||||||
{
|
{
|
||||||
return client().did_request_named_cookie(url, name);
|
return client().did_request_named_cookie(url, name);
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,7 +113,7 @@ private:
|
||||||
virtual void page_did_request_dismiss_dialog() override;
|
virtual void page_did_request_dismiss_dialog() override;
|
||||||
virtual void page_did_change_favicon(Gfx::Bitmap const&) override;
|
virtual void page_did_change_favicon(Gfx::Bitmap const&) override;
|
||||||
virtual Vector<Web::Cookie::Cookie> page_did_request_all_cookies(URL const&) override;
|
virtual Vector<Web::Cookie::Cookie> page_did_request_all_cookies(URL const&) override;
|
||||||
virtual Optional<Web::Cookie::Cookie> page_did_request_named_cookie(URL const&, ByteString const&) override;
|
virtual Optional<Web::Cookie::Cookie> page_did_request_named_cookie(URL const&, String const&) override;
|
||||||
virtual String page_did_request_cookie(const URL&, Web::Cookie::Source) override;
|
virtual String page_did_request_cookie(const URL&, Web::Cookie::Source) override;
|
||||||
virtual void page_did_set_cookie(const URL&, Web::Cookie::ParsedCookie const&, Web::Cookie::Source) override;
|
virtual void page_did_set_cookie(const URL&, Web::Cookie::ParsedCookie const&, Web::Cookie::Source) override;
|
||||||
virtual void page_did_update_cookie(Web::Cookie::Cookie) override;
|
virtual void page_did_update_cookie(Web::Cookie::Cookie) override;
|
||||||
|
|
|
@ -53,7 +53,7 @@ endpoint WebContentClient
|
||||||
|
|
||||||
did_change_favicon(Gfx::ShareableBitmap favicon) =|
|
did_change_favicon(Gfx::ShareableBitmap favicon) =|
|
||||||
did_request_all_cookies(URL url) => (Vector<Web::Cookie::Cookie> cookies)
|
did_request_all_cookies(URL url) => (Vector<Web::Cookie::Cookie> cookies)
|
||||||
did_request_named_cookie(URL url, ByteString name) => (Optional<Web::Cookie::Cookie> cookie)
|
did_request_named_cookie(URL url, String name) => (Optional<Web::Cookie::Cookie> cookie)
|
||||||
did_request_cookie(URL url, Web::Cookie::Source source) => (String cookie)
|
did_request_cookie(URL url, Web::Cookie::Source source) => (String cookie)
|
||||||
did_set_cookie(URL url, Web::Cookie::ParsedCookie cookie, Web::Cookie::Source source) => ()
|
did_set_cookie(URL url, Web::Cookie::ParsedCookie cookie, Web::Cookie::Source source) => ()
|
||||||
did_update_cookie(Web::Cookie::Cookie cookie) =|
|
did_update_cookie(Web::Cookie::Cookie cookie) =|
|
||||||
|
|
|
@ -1538,7 +1538,7 @@ Messages::WebDriverClient::GetNamedCookieResponse WebDriverConnection::get_named
|
||||||
// 3. If the url variable name is equal to a cookie’s cookie name amongst all associated cookies of the current browsing context’s active document, return success with the serialized cookie as data.
|
// 3. If the url variable name is equal to a cookie’s cookie name amongst all associated cookies of the current browsing context’s active document, return success with the serialized cookie as data.
|
||||||
auto* document = m_page_client.page().top_level_browsing_context().active_document();
|
auto* document = m_page_client.page().top_level_browsing_context().active_document();
|
||||||
|
|
||||||
if (auto cookie = m_page_client.page_did_request_named_cookie(document->url(), name.to_byte_string()); cookie.has_value()) {
|
if (auto cookie = m_page_client.page_did_request_named_cookie(document->url(), name); cookie.has_value()) {
|
||||||
auto serialized_cookie = serialize_cookie(*cookie);
|
auto serialized_cookie = serialize_cookie(*cookie);
|
||||||
return serialized_cookie;
|
return serialized_cookie;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue