DescriptionRefactor HostContentSettingsMap::SetWebsiteSettingDefaultScope to take a std::unique_ptr.
Currently, HostContentSettingsMap::SetWebsiteSettingDefaultScope
takes a raw base::Value*, and its clients typically release() a
std::unique_ptr<base::Value> when calling it. However, this method
returns without doing anything if provided with an invalid primary or
secondary URL pattern (e.g. the view source page). When this happens,
the base::Value is leaked, as it has been released() by its previous
owner without being taken into a unique_ptr in
SetWebsiteSettingsDefaultScope.
This CL eliminates the leak by making the method take a std::unique_ptr,
and adjusting its call sites to use either std::move or base::WrapUnique.
BUG=618529
TBR=felt@chromium.org,mkwst@chromium.org,benwells@chromium.org
Committed: https://crrev.com/d7e7fc45f0d5f84430707280a18dfe7d6217aed8
Cr-Commit-Position: refs/heads/master@{#398806}
Patch Set 1 #
Total comments: 4
Patch Set 2 : Addressing reviewer comments #Messages
Total messages: 16 (10 generated)
|