Lines Matching refs:domain
22 // * Canonicalizes each rule's domain by converting it to a GURL and back.
52 // Writes the list of domain rules contained in the 'rules' set to the
103 NormalizeResult NormalizeRule(std::string* domain, Rule* rule) {
107 if (domain->at(0) == '.')
108 domain->erase(0, 1);
109 if (domain->empty()) {
113 if (domain->at(domain->size() - 1) == '.')
114 domain->erase(domain->size() - 1, 1);
115 if (domain->empty()) {
122 if (domain->at(0) == '!') {
123 domain->erase(0, 1);
125 } else if (domain->find("*.") == 0) {
126 domain->erase(0, 2);
129 if (domain->empty()) {
135 if (domain->find("*.", start_offset) != std::string::npos ||
136 domain->find('!', start_offset) != std::string::npos) {
137 LOG(WARNING) << "Keeping probably invalid rule: " << *domain;
143 url.append(*domain);
148 LOG(ERROR) << "Ignoring rule that couldn't be normalized: " << *domain;
152 LOG(WARNING) << "Keeping rule that GURL says is invalid: " << *domain;
155 domain->assign(spec.substr(host.begin, host.len));
174 std::string domain;
193 domain.assign(data.data(), line_start, line_end - line_start);
198 NormalizeResult new_result = NormalizeRule(&domain, &rule);
203 CHECK(rules.find(domain) == rules.end());
205 rules[domain] = rule;
210 size_t tld_start = domain.find_last_of('.');
211 if (tld_start != std::string::npos && tld_start + 1 < domain.size())
212 extra_rules.insert(domain.substr(tld_start + 1));