Lines Matching refs:domain
27 // Writes the list of domain rules contained in the 'rules' set to the
75 NormalizeResult NormalizeRule(std::string* domain, Rule* rule) {
79 if (domain->at(0) == '.')
80 domain->erase(0, 1);
81 if (domain->empty()) {
85 if (domain->at(domain->size() - 1) == '.')
86 domain->erase(domain->size() - 1, 1);
87 if (domain->empty()) {
94 if (domain->at(0) == '!') {
95 domain->erase(0, 1);
97 } else if (domain->find("*.") == 0) {
98 domain->erase(0, 2);
101 if (domain->empty()) {
107 if (domain->find("*.", start_offset) != std::string::npos ||
108 domain->find('!', start_offset) != std::string::npos) {
109 LOG(WARNING) << "Keeping probably invalid rule: " << *domain;
115 url.append(*domain);
120 LOG(ERROR) << "Ignoring rule that couldn't be normalized: " << *domain;
124 LOG(WARNING) << "Keeping rule that GURL says is invalid: " << *domain;
127 domain->assign(spec.substr(host.begin, host.len));
137 std::string domain;
168 domain.assign(data.data(), line_start, line_end - line_start);
174 NormalizeResult new_result = NormalizeRule(&domain, &rule);
177 // wildcard for the same rule, or that the same domain is listed as both
180 CHECK(rules->find(domain) == rules->end())
181 << "Duplicate rule found for " << domain;
183 (*rules)[domain] = rule;
188 size_t tld_start = domain.find_last_of('.');
189 if (tld_start != std::string::npos && tld_start + 1 < domain.size()) {
190 std::string extra_rule_domain = domain.substr(tld_start + 1);