chromium/third_party/blink/renderer/platform/weborigin/scheme_registry.cc

/*
 * Copyright (C) 2010 Apple Inc. All Rights Reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */

#include "third_party/blink/renderer/platform/weborigin/scheme_registry.h"

#include <algorithm>

#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/public/web/blink.h"
#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"
#include "third_party/blink/renderer/platform/wtf/thread_specific.h"
#include "third_party/blink/renderer/platform/wtf/threading.h"
#include "url/url_util.h"

namespace blink {

// Function defined in third_party/blink/public/web/blink.h.
void SetDomainRelaxationForbiddenForTest(bool forbidden,
                                         const WebString& scheme) {}

// Function defined in third_party/blink/public/web/blink.h.
void ResetDomainRelaxationForTest() {}

namespace {

struct PolicyAreasHashTraits : HashTraits<SchemeRegistry::PolicyAreas> {};

class URLSchemesRegistry final {};

const URLSchemesRegistry& GetURLSchemesRegistry() {}

URLSchemesRegistry& GetMutableURLSchemesRegistry() {}

URLSchemesRegistry& GetMutableURLSchemesRegistryForTest() {}

}  // namespace

void SchemeRegistry::RegisterURLSchemeAsDisplayIsolated(const String& scheme) {}

bool SchemeRegistry::ShouldTreatURLSchemeAsDisplayIsolated(
    const String& scheme) {}

bool SchemeRegistry::ShouldTreatURLSchemeAsRestrictingMixedContent(
    const String& scheme) {}

bool SchemeRegistry::ShouldLoadURLSchemeAsEmptyDocument(const String& scheme) {}

void SchemeRegistry::SetDomainRelaxationForbiddenForURLSchemeForTest(
    bool forbidden,
    const String& scheme) {}

void SchemeRegistry::ResetDomainRelaxationForTest() {}

bool SchemeRegistry::IsDomainRelaxationForbiddenForURLScheme(
    const String& scheme) {}

bool SchemeRegistry::CanDisplayOnlyIfCanRequest(const String& scheme) {}

void SchemeRegistry::RegisterURLSchemeAsNotAllowingJavascriptURLs(
    const String& scheme) {}

void SchemeRegistry::RemoveURLSchemeAsNotAllowingJavascriptURLs(
    const String& scheme) {}

bool SchemeRegistry::ShouldTreatURLSchemeAsNotAllowingJavascriptURLs(
    const String& scheme) {}

bool SchemeRegistry::ShouldTreatURLSchemeAsCorsEnabled(const String& scheme) {}

String SchemeRegistry::ListOfCorsEnabledURLSchemes() {}

bool SchemeRegistry::ShouldTrackUsageMetricsForScheme(const String& scheme) {}

void SchemeRegistry::RegisterURLSchemeAsAllowingServiceWorkers(
    const String& scheme) {}

bool SchemeRegistry::ShouldTreatURLSchemeAsAllowingServiceWorkers(
    const String& scheme) {}

void SchemeRegistry::RegisterURLSchemeAsSupportingFetchAPI(
    const String& scheme) {}

bool SchemeRegistry::ShouldTreatURLSchemeAsSupportingFetchAPI(
    const String& scheme) {}

// https://url.spec.whatwg.org/#special-scheme
bool SchemeRegistry::IsSpecialScheme(const String& scheme) {}

void SchemeRegistry::RegisterURLSchemeAsFirstPartyWhenTopLevel(
    const String& scheme) {}

void SchemeRegistry::RemoveURLSchemeAsFirstPartyWhenTopLevel(
    const String& scheme) {}

bool SchemeRegistry::ShouldTreatURLSchemeAsFirstPartyWhenTopLevel(
    const String& scheme) {}

void SchemeRegistry::RegisterURLSchemeAsFirstPartyWhenTopLevelEmbeddingSecure(
    const String& scheme) {}

bool SchemeRegistry::
    ShouldTreatURLSchemeAsFirstPartyWhenTopLevelEmbeddingSecure(
        const String& top_level_scheme,
        const String& child_scheme) {}

void SchemeRegistry::RegisterURLSchemeAsAllowedForReferrer(
    const String& scheme) {}

void SchemeRegistry::RemoveURLSchemeAsAllowedForReferrer(const String& scheme) {}

bool SchemeRegistry::ShouldTreatURLSchemeAsAllowedForReferrer(
    const String& scheme) {}

void SchemeRegistry::RegisterURLSchemeAsError(const String& scheme) {}

bool SchemeRegistry::ShouldTreatURLSchemeAsError(const String& scheme) {}

void SchemeRegistry::RegisterURLSchemeAsAllowingSharedArrayBuffers(
    const String& scheme) {}

bool SchemeRegistry::ShouldTreatURLSchemeAsAllowingSharedArrayBuffers(
    const String& scheme) {}

void SchemeRegistry::RegisterURLSchemeAsBypassingContentSecurityPolicy(
    const String& scheme,
    PolicyAreas policy_areas) {}

void SchemeRegistry::RemoveURLSchemeRegisteredAsBypassingContentSecurityPolicy(
    const String& scheme) {}

bool SchemeRegistry::SchemeShouldBypassContentSecurityPolicy(
    const String& scheme,
    PolicyAreas policy_areas) {}

void SchemeRegistry::RegisterURLSchemeBypassingSecureContextCheck(
    const String& scheme) {}

bool SchemeRegistry::SchemeShouldBypassSecureContextCheck(
    const String& scheme) {}

void SchemeRegistry::RegisterURLSchemeAsAllowingWasmEvalCSP(
    const String& scheme) {}

bool SchemeRegistry::SchemeSupportsWasmEvalCSP(const String& scheme) {}

void SchemeRegistry::RegisterURLSchemeAsWebUI(const String& scheme) {}

void SchemeRegistry::RemoveURLSchemeAsWebUI(const String& scheme) {}

bool SchemeRegistry::IsWebUIScheme(const String& scheme) {}

void SchemeRegistry::RegisterURLSchemeAsWebUIForTest(const String& scheme) {}

void SchemeRegistry::RemoveURLSchemeAsWebUIForTest(const String& scheme) {}

void SchemeRegistry::RegisterURLSchemeAsCodeCacheWithHashing(
    const String& scheme) {}

void SchemeRegistry::RemoveURLSchemeAsCodeCacheWithHashing(
    const String& scheme) {}

bool SchemeRegistry::SchemeSupportsCodeCacheWithHashing(const String& scheme) {}

}  // namespace blink