Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5616)

Unified Diff: chrome/browser/component_updater/subresource_filter_component_installer.cc

Issue 2837163004: Make call sites of subresource_filter::GetActiveConfigurations const-correct. (Closed)
Patch Set: Addressed comments from pkalinnikov@. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/component_updater/subresource_filter_component_installer.cc
diff --git a/chrome/browser/component_updater/subresource_filter_component_installer.cc b/chrome/browser/component_updater/subresource_filter_component_installer.cc
index a7635db1478e7bb44b010e4b0c83730a1b640e77..5016878ec0a13b95fea2a6f541acf3b5f0df1804 100644
--- a/chrome/browser/component_updater/subresource_filter_component_installer.cc
+++ b/chrome/browser/component_updater/subresource_filter_component_installer.cc
@@ -112,16 +112,17 @@ std::string SubresourceFilterComponentInstallerTraits::GetName() const {
// static
std::string SubresourceFilterComponentInstallerTraits::GetInstallerTag() {
- std::string ruleset_flavor = subresource_filter::GetActiveConfigurations()
- ->the_one_and_only()
- .ruleset_flavor;
+ const auto configurations = subresource_filter::GetActiveConfigurations();
+ const std::string& ruleset_flavor =
+ configurations->the_one_and_only().ruleset_flavor;
if (ruleset_flavor.empty())
return ruleset_flavor;
// We allow 4 ruleset flavor identifiers: a, b, c, d
if (ruleset_flavor.size() == 1 && ruleset_flavor.at(0) >= 'a' &&
- ruleset_flavor.at(0) <= 'd')
+ ruleset_flavor.at(0) <= 'd') {
return ruleset_flavor;
+ }
// Return 'invalid' for any cases where we encounter an invalid installer
// tag. This allows us to verify that no clients are encountering invalid
@@ -145,8 +146,9 @@ SubresourceFilterComponentInstallerTraits::GetMimeTypes() const {
void RegisterSubresourceFilterComponent(ComponentUpdateService* cus) {
if (!base::FeatureList::IsEnabled(
- subresource_filter::kSafeBrowsingSubresourceFilter))
+ subresource_filter::kSafeBrowsingSubresourceFilter)) {
return;
+ }
std::unique_ptr<ComponentInstallerTraits> traits(
new SubresourceFilterComponentInstallerTraits());
// |cus| will take ownership of |installer| during installer->Register(cus).
« no previous file with comments | « no previous file | components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698