From 9d921724187e7b03a9e6adcddf8af8aba5c88b1a Mon Sep 17 00:00:00 2001 From: Aleksey Khoroshilov Date: Fri, 9 Apr 2021 16:29:48 +0700 Subject: [PATCH] Pass some args as const ref. --- browser/ephemeral_storage/ephemeral_storage_tab_helper.cc | 6 +++--- browser/ephemeral_storage/ephemeral_storage_tab_helper.h | 2 +- components/permissions/permission_expirations.cc | 4 ++-- components/permissions/permission_expirations.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/browser/ephemeral_storage/ephemeral_storage_tab_helper.cc b/browser/ephemeral_storage/ephemeral_storage_tab_helper.cc index bf982558a5df..454697665d03 100644 --- a/browser/ephemeral_storage/ephemeral_storage_tab_helper.cc +++ b/browser/ephemeral_storage/ephemeral_storage_tab_helper.cc @@ -77,11 +77,11 @@ void EphemeralStorageTabHelper::ReadyToCommitNavigation( if (new_domain == previous_domain) return; - CreateEphemeralStorageAreasForDomainAndURL(std::move(new_domain), new_url); + CreateEphemeralStorageAreasForDomainAndURL(new_domain, new_url); } void EphemeralStorageTabHelper::CreateEphemeralStorageAreasForDomainAndURL( - std::string new_domain, + const std::string& new_domain, const GURL& new_url) { if (new_url.is_empty()) return; @@ -125,7 +125,7 @@ void EphemeralStorageTabHelper::CreateEphemeralStorageAreasForDomainAndURL( : base::nullopt); tld_ephemeral_lifetime_ = content::TLDEphemeralLifetime::GetOrCreate( - browser_context, partition, std::move(new_domain)); + browser_context, partition, new_domain); } WEB_CONTENTS_USER_DATA_KEY_IMPL(EphemeralStorageTabHelper) diff --git a/browser/ephemeral_storage/ephemeral_storage_tab_helper.h b/browser/ephemeral_storage/ephemeral_storage_tab_helper.h index 3f9b957ca1b8..2ddcf2745f60 100644 --- a/browser/ephemeral_storage/ephemeral_storage_tab_helper.h +++ b/browser/ephemeral_storage/ephemeral_storage_tab_helper.h @@ -38,7 +38,7 @@ class EphemeralStorageTabHelper content::NavigationHandle* navigation_handle) override; private: - void CreateEphemeralStorageAreasForDomainAndURL(std::string new_domain, + void CreateEphemeralStorageAreasForDomainAndURL(const std::string& new_domain, const GURL& new_url); friend class content::WebContentsUserData; diff --git a/components/permissions/permission_expirations.cc b/components/permissions/permission_expirations.cc index 18b9309f90e8..690600317885 100644 --- a/components/permissions/permission_expirations.cc +++ b/components/permissions/permission_expirations.cc @@ -130,13 +130,13 @@ PermissionExpirations::RemoveExpiredPermissions(base::Time current_time) { } PermissionExpirations::ExpiredPermissions -PermissionExpirations::RemoveExpiredPermissions(std::string domain) { +PermissionExpirations::RemoveExpiredPermissions(const std::string& domain) { return RemoveExpiredPermissionsImpl(base::BindRepeating( [](const PermissionExpirationKey& expiration_key, const PermissionExpirations::KeyExpirationsMap& key_expirations) { return key_expirations.equal_range(expiration_key); }, - PermissionExpirationKey(std::move(domain)))); + PermissionExpirationKey(domain))); } PermissionExpirations::ExpiredPermissions diff --git a/components/permissions/permission_expirations.h b/components/permissions/permission_expirations.h index d5c4554c0d2d..1c23b36841c3 100644 --- a/components/permissions/permission_expirations.h +++ b/components/permissions/permission_expirations.h @@ -55,7 +55,7 @@ class PermissionExpirations { // Remove expired permissions with expiration_time >= |current_time|. ExpiredPermissions RemoveExpiredPermissions(base::Time current_time); // Remove expired permissions with exact |domain|. - ExpiredPermissions RemoveExpiredPermissions(std::string domain); + ExpiredPermissions RemoveExpiredPermissions(const std::string& domain); // Remove expired permissions with a domain as a key. ExpiredPermissions RemoveAllDomainPermissions();