Skip to content

Commit

Permalink
Pass some args as const ref.
Browse files Browse the repository at this point in the history
  • Loading branch information
goodov committed Apr 9, 2021
1 parent 5ebf2fb commit 9d92172
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions browser/ephemeral_storage/ephemeral_storage_tab_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion browser/ephemeral_storage/ephemeral_storage_tab_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<EphemeralStorageTabHelper>;
Expand Down
4 changes: 2 additions & 2 deletions components/permissions/permission_expirations.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion components/permissions/permission_expirations.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 9d92172

Please sign in to comment.