chromium/components/url_matcher/url_matcher_factory.cc

// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 {

// Error messages:
const char kInvalidPortRanges[] =;
const char kVectorOfStringsExpected[] =;
const char kUnknownURLFilterAttribute[] =;
const char kAttributeExpectedString[] =;
const char kUnparseableRegexString[] =;
const char kLowerCaseExpected[] =;
const char kInvalidCidrBlocks[] =;

// Registry for all factory methods of URLMatcherConditionFactory
// that allows translating string literals from the extension API into
// the corresponding factory method to be called.
class URLMatcherConditionFactoryMethods {};

static base::LazyInstance<URLMatcherConditionFactoryMethods>::DestructorAtExit
    g_url_matcher_condition_factory_methods =;

}  // namespace

// static
scoped_refptr<URLMatcherConditionSet>
URLMatcherFactory::CreateFromURLFilterDictionary(
    URLMatcherConditionFactory* url_matcher_condition_factory,
    const base::Value::Dict& url_filter_dict,
    base::MatcherStringPattern::ID id,
    std::string* error) {}

// static
bool URLMatcherFactory::IsURLMatcherConditionAttribute(
    const std::string& condition_attribute_name) {}

namespace {

// Returns true if some alphabetic characters in this string are upper case.
bool ContainsUpperCase(const std::string& str) {}

}  // namespace

// static
URLMatcherCondition URLMatcherFactory::CreateURLMatcherCondition(
    URLMatcherConditionFactory* url_matcher_condition_factory,
    const std::string& condition_attribute_name,
    const base::Value* value,
    std::string* error) {}

// static
std::unique_ptr<URLMatcherSchemeFilter>
URLMatcherFactory::CreateURLMatcherScheme(const base::Value* value,
                                          std::string* error) {}

// static
std::unique_ptr<URLMatcherPortFilter> URLMatcherFactory::CreateURLMatcherPorts(
    const base::Value* value,
    std::string* error) {}

// static
std::unique_ptr<URLMatcherCidrBlockFilter>
URLMatcherFactory::CreateURLMatcherCidrBlocks(const base::Value* value,
                                              std::string* error) {}

}  // namespace url_matcher