From c073127b9968811f20c8d4bbe63fc1e2f3ee354d Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Sun, 5 Jan 2025 16:18:33 +0000 Subject: [PATCH] LibWeb/DOM: Return Document's Origin by reference We don't want to have to copy these unnecessarily. --- Libraries/LibWeb/DOM/Document.cpp | 2 +- Libraries/LibWeb/DOM/Document.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Libraries/LibWeb/DOM/Document.cpp b/Libraries/LibWeb/DOM/Document.cpp index 8c933b81e22..68d9fb5ad95 100644 --- a/Libraries/LibWeb/DOM/Document.cpp +++ b/Libraries/LibWeb/DOM/Document.cpp @@ -763,7 +763,7 @@ GC::Ptr Document::default_view() const return const_cast(this)->default_view(); } -URL::Origin Document::origin() const +URL::Origin const& Document::origin() const { return m_origin; } diff --git a/Libraries/LibWeb/DOM/Document.h b/Libraries/LibWeb/DOM/Document.h index d1c17cc43da..dedae9725fa 100644 --- a/Libraries/LibWeb/DOM/Document.h +++ b/Libraries/LibWeb/DOM/Document.h @@ -151,7 +151,7 @@ public: String url_string() const { return m_url.to_string(); } String document_uri() const { return url_string(); } - URL::Origin origin() const; + URL::Origin const& origin() const; void set_origin(URL::Origin const& origin); HTML::OpenerPolicy const& opener_policy() const { return m_opener_policy; }