chromium/components/url_rewrite/common/url_loader_throttle.cc

// Copyright 2019 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_rewrite/common/url_loader_throttle.h"

#include <string>
#include <string_view>

#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "net/base/net_errors.h"
#include "services/network/public/cpp/resource_request.h"
#include "url/url_constants.h"

namespace url_rewrite {
namespace {

// Returns a string representing the URL stripped of query and ref.
std::string ClearUrlQueryRef(const GURL& url) {}

void ApplySubstituteQueryPattern(
    network::ResourceRequest* request,
    const mojom::UrlRequestRewriteSubstituteQueryPatternPtr&
        substitute_query_pattern) {}

void ApplyReplaceUrl(network::ResourceRequest* request,
                     const mojom::UrlRequestRewriteReplaceUrlPtr& replace_url) {}

void ApplyRemoveHeader(
    network::ResourceRequest* request,
    const mojom::UrlRequestRewriteRemoveHeaderPtr& remove_header) {}

void ApplyAppendToQuery(
    network::ResourceRequest* request,
    const mojom::UrlRequestRewriteAppendToQueryPtr& append_to_query) {}

bool HostMatches(std::string_view url_host, std::string_view rule_host) {}

// Returns true if the host and scheme filters defined in |rule| match |url|.
bool RuleFiltersMatchUrl(const GURL& url,
                         const mojom::UrlRequestRulePtr& rule) {}

// Returns true if |request| is either allowed or left unblocked by any rules.
bool IsRequestAllowed(network::ResourceRequest* request,
                      const mojom::UrlRequestRewriteRulesPtr& rules) {}

}  // namespace

URLLoaderThrottle::URLLoaderThrottle(
    scoped_refptr<UrlRequestRewriteRules> rules,
    IsHeaderCorsExemptCallback is_header_cors_exempt_callback)
    :{}

URLLoaderThrottle::~URLLoaderThrottle() = default;

void URLLoaderThrottle::DetachFromCurrentSequence() {}

void URLLoaderThrottle::WillStartRequest(network::ResourceRequest* request,
                                         bool* defer) {}

void URLLoaderThrottle::ApplyRule(network::ResourceRequest* request,
                                  const mojom::UrlRequestRulePtr& rule) {}

void URLLoaderThrottle::ApplyRewrite(
    network::ResourceRequest* request,
    const mojom::UrlRequestActionPtr& rewrite) {}

void URLLoaderThrottle::ApplyAddHeaders(
    network::ResourceRequest* request,
    const mojom::UrlRequestRewriteAddHeadersPtr& add_headers) {}

}  // namespace url_rewrite