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

Unified Diff: components/subresource_filter/content/common/ruleset_dealer.cc

Issue 2661433002: Introduce VerifiedRulesetDealer and its async Handle. (Closed)
Patch Set: Refactor tests. Created 3 years, 11 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
Index: components/subresource_filter/content/common/ruleset_dealer.cc
diff --git a/components/subresource_filter/content/common/ruleset_dealer.cc b/components/subresource_filter/content/common/ruleset_dealer.cc
index e5e490b09424f58a4d89c7fb1674bbfb0e29a978..9cdbc3fb2008bebf9ec12e5442d3db45f9de49c4 100644
--- a/components/subresource_filter/content/common/ruleset_dealer.cc
+++ b/components/subresource_filter/content/common/ruleset_dealer.cc
@@ -9,20 +9,26 @@
namespace subresource_filter {
-RulesetDealer::RulesetDealer() = default;
+RulesetDealer::RulesetDealer() {
+ DetachFromThread();
+}
+
RulesetDealer::~RulesetDealer() = default;
void RulesetDealer::SetRulesetFile(base::File ruleset_file) {
+ DCHECK(CalledOnValidThread());
DCHECK(ruleset_file.IsValid());
ruleset_file_ = std::move(ruleset_file);
weak_cached_ruleset_.reset();
}
-bool RulesetDealer::IsRulesetAvailable() const {
+bool RulesetDealer::IsRulesetFileAvailable() const {
+ DCHECK(CalledOnValidThread());
return ruleset_file_.IsValid();
}
scoped_refptr<const MemoryMappedRuleset> RulesetDealer::GetRuleset() {
+ DCHECK(CalledOnValidThread());
if (!ruleset_file_.IsValid())
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698