mirror of
https://github.com/servo/servo
synced 2026-05-05 06:32:13 +02:00
script: Do not unnecessary clone CSP list in Document::get_csp_list (#42716)
We previously clonsed the CSP list unnecessarily which consisted of roughly 2.7%. 1.2% spend in Document::get_csp_list. We can easily avoid it with Ref and cloning it deliberately when needed. Testing: This is functionally identical to the previous code as it is a change from clone to a Ref<>. --------- Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
This commit is contained in:
@@ -547,7 +547,7 @@ impl WindowProxy {
|
||||
target_window.as_global_scope().get_referrer()
|
||||
};
|
||||
// Propagate CSP list and about-base-url from opener to new document
|
||||
let csp_list = existing_document.get_csp_list();
|
||||
let csp_list = existing_document.get_csp_list().clone();
|
||||
target_document.set_csp_list(csp_list);
|
||||
|
||||
// Step 15.5 Otherwise, navigate targetNavigable to urlRecord using sourceDocument,
|
||||
|
||||
Reference in New Issue
Block a user