chromium/third_party/blink/renderer/core/url_pattern/url_pattern_component.cc

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

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

// Utility method to convert a type to a string.
StringView TypeToString(Component::Type type) {}

// Utility method to get the correct encoding callback for a given type.
liburlpattern::EncodeCallback GetEncodeCallback(std::string_view pattern_utf8,
                                                Component::Type type,
                                                Component* protocol_component) {}

// Utility method to get the correct liburlpattern parse options for a given
// type.
const liburlpattern::Options GetOptions(
    Component::Type type,
    Component* protocol_component,
    const URLPatternOptions& external_options) {}

int ComparePart(const liburlpattern::Part& lh, const liburlpattern::Part& rh) {}

}  // anonymous namespace

// static
Component* Component::Compile(v8::Isolate* isolate,
                              StringView pattern,
                              Type type,
                              Component* protocol_component,
                              const URLPatternOptions& external_options,
                              ExceptionState& exception_state) {}

// static
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 {}

}  // namespace url_pattern
}  // namespace blink