#include "third_party/blink/renderer/core/url_pattern/url_pattern_component.h"
#include <string_view>
#include "base/metrics/histogram_functions.h"
#include "base/numerics/safe_conversions.h"
#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "components/url_pattern/url_pattern_util.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_url_pattern_options.h"
#include "third_party/blink/renderer/core/url_pattern/url_pattern_canon.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/wtf/text/string_utf8_adaptor.h"
#include "url/url_util.h"
namespace blink {
namespace url_pattern {
namespace {
StringView TypeToString(Component::Type type) { … }
liburlpattern::EncodeCallback GetEncodeCallback(std::string_view pattern_utf8,
Component::Type type,
Component* protocol_component) { … }
const liburlpattern::Options GetOptions(
Component::Type type,
Component* protocol_component,
const URLPatternOptions& external_options) { … }
int ComparePart(const liburlpattern::Part& lh, const liburlpattern::Part& rh) { … }
}
Component* Component::Compile(v8::Isolate* isolate,
StringView pattern,
Type type,
Component* protocol_component,
const URLPatternOptions& external_options,
ExceptionState& exception_state) { … }
int Component::Compare(const Component& lh, const Component& rh) { … }
Component::Component(Type type,
liburlpattern::Pattern pattern,
ScriptRegexp* regexp,
Vector<String> name_list,
base::PassKey<Component> key)
: … { … }
bool Component::Match(StringView input,
Vector<std::pair<String, String>>* group_list) const { … }
String Component::GeneratePatternString() const { … }
bool Component::ShouldTreatAsStandardURL() const { … }
const std::vector<liburlpattern::Part>& Component::PartList() const { … }
void Component::Trace(Visitor* visitor) const { … }
}
}