#include "components/url_matcher/url_matcher_factory.h"
#include <memory>
#include <utility>
#include "base/check.h"
#include "base/lazy_instance.h"
#include "base/ranges/algorithm.h"
#include "base/strings/stringprintf.h"
#include "base/values.h"
#include "components/url_matcher/url_matcher_constants.h"
#include "components/url_matcher/url_util.h"
#include "third_party/re2/src/re2/re2.h"
namespace url_matcher {
keys;
namespace {
const char kInvalidPortRanges[] = …;
const char kVectorOfStringsExpected[] = …;
const char kUnknownURLFilterAttribute[] = …;
const char kAttributeExpectedString[] = …;
const char kUnparseableRegexString[] = …;
const char kLowerCaseExpected[] = …;
const char kInvalidCidrBlocks[] = …;
class URLMatcherConditionFactoryMethods { … };
static base::LazyInstance<URLMatcherConditionFactoryMethods>::DestructorAtExit
g_url_matcher_condition_factory_methods = …;
}
scoped_refptr<URLMatcherConditionSet>
URLMatcherFactory::CreateFromURLFilterDictionary(
URLMatcherConditionFactory* url_matcher_condition_factory,
const base::Value::Dict& url_filter_dict,
base::MatcherStringPattern::ID id,
std::string* error) { … }
bool URLMatcherFactory::IsURLMatcherConditionAttribute(
const std::string& condition_attribute_name) { … }
namespace {
bool ContainsUpperCase(const std::string& str) { … }
}
URLMatcherCondition URLMatcherFactory::CreateURLMatcherCondition(
URLMatcherConditionFactory* url_matcher_condition_factory,
const std::string& condition_attribute_name,
const base::Value* value,
std::string* error) { … }
std::unique_ptr<URLMatcherSchemeFilter>
URLMatcherFactory::CreateURLMatcherScheme(const base::Value* value,
std::string* error) { … }
std::unique_ptr<URLMatcherPortFilter> URLMatcherFactory::CreateURLMatcherPorts(
const base::Value* value,
std::string* error) { … }
std::unique_ptr<URLMatcherCidrBlockFilter>
URLMatcherFactory::CreateURLMatcherCidrBlocks(const base::Value* value,
std::string* error) { … }
}