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

Side by Side Diff: components/subresource_filter/core/browser/subresource_filter_features_test_support.cc

Issue 2831373002: Introduce subresource_filter::ConfigurationList and make querying it cheap. (Closed)
Patch Set: Rebase. Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/subresource_filter/core/browser/subresource_filter_features _test_support.h" 5 #include "components/subresource_filter/core/browser/subresource_filter_features _test_support.h"
6 6
7 #include <map> 7 #include <map>
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 if (existing_feature_list) { 58 if (existing_feature_list) {
59 std::string enabled_features; 59 std::string enabled_features;
60 std::string disabled_features; 60 std::string disabled_features;
61 base::FeatureList::GetInstance()->GetFeatureOverrides(&enabled_features, 61 base::FeatureList::GetInstance()->GetFeatureOverrides(&enabled_features,
62 &disabled_features); 62 &disabled_features);
63 feature_list->InitializeFromCommandLine(enabled_features, 63 feature_list->InitializeFromCommandLine(enabled_features,
64 disabled_features); 64 disabled_features);
65 } 65 }
66 66
67 scoped_feature_list_.InitWithFeatureList(std::move(feature_list)); 67 scoped_feature_list_.InitWithFeatureList(std::move(feature_list));
68
69 // Force the active ConfigurationList to be reparsed on next access so that
70 // the variation parameters come into effect.
71 ClearCachedActiveConfigurations();
68 } 72 }
69 73
70 ScopedSubresourceFilterFeatureToggle::~ScopedSubresourceFilterFeatureToggle() { 74 ScopedSubresourceFilterFeatureToggle::~ScopedSubresourceFilterFeatureToggle() {
71 variations::testing::ClearAllVariationParams(); 75 variations::testing::ClearAllVariationParams();
76
77 // Force the active ConfigurationList to be reparsed on next access, so that
78 // the overrides from this instance are no longer in effect.
79 ClearCachedActiveConfigurations();
72 } 80 }
73 81
74 } // namespace testing 82 } // namespace testing
75 } // namespace subresource_filter 83 } // namespace subresource_filter
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698