Home | History | Annotate | Download | only in tld_cleanup

Lines Matching defs:Rule

18 //  * Strips a single leading and/or trailing dot from each rule, if present.
19 // * Logs a warning if a rule contains '!' or '*.' other than at the beginning
20 // of the rule. (This also catches multiple ! or *. at the start of a rule.)
21 // * Logs a warning if GURL reports a rule as invalid, but keeps the rule.
22 // * Canonicalizes each rule's domain by converting it to a GURL and back.
23 // * Adds explicit rules for true TLDs found in any rule.
43 struct Rule {
48 typedef std::map<std::string, Rule> RuleMap;
53 // 'outfile', with each rule terminated by a LF. The file must already have
99 // Adjusts the rule to a standard form: removes single extraneous dots and
100 // canonicalizes it using GURL. Returns kSuccess if the rule is interpreted as
102 // logs an error and returns kError if the rule is (almost) certainly invalid.
103 NormalizeResult NormalizeRule(std::string* domain, Rule* rule) {
110 LOG(WARNING) << "Ignoring empty rule";
116 LOG(WARNING) << "Ignoring empty rule";
124 rule->exception = true;
127 rule->wildcard = true;
130 LOG(WARNING) << "Ignoring empty rule";
137 LOG(WARNING) << "Keeping probably invalid rule: " << *domain;
148 LOG(ERROR) << "Ignoring rule that couldn't be normalized: " << *domain;
152 LOG(WARNING) << "Keeping rule that GURL says is invalid: " << *domain;
195 Rule rule;
196 rule.wildcard = false;
197 rule.exception = false;
198 NormalizeResult new_result = NormalizeRule(&domain, &rule);
201 // wildcard for the same rule. If we did, we'd have to update our
205 rules[domain] = rule;
230 Rule rule;
231 rule.exception = false;
232 rule.wildcard = false;
233 rules[*iter] = rule;