blob: 92b1fd9e362ff03e1e7a09282e7018a0d7efb0bd [file] [log] [blame]
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <set>
#include <string>
#include <vector>
class PrefRegistrySimple;
namespace secure_origin_whitelist {
// Return a whitelist of origins and hostname patterns that need to be
// considered trustworthy. The whitelist is given by
// kUnsafelyTreatInsecureOriginAsSecure command-line option. See
// The whitelist can contain origins and wildcard hostname patterns up to
// eTLD+1. For example, the list may contain "",
// "", "*", "*.foo.*", and
// "http://*", but not "*", "*.com", or "test.*.com". Hostname
// patterns must contain a wildcard somewhere (so "" is not a valid
// pattern) and wildcards can only replace full components ("test*" is
// not valid).
// Plain origins ("") are canonicalized when they are inserted
// into this list by converting to url::Origin and serializing. For hostname
// patterns, each component is individually canonicalized.
std::vector<std::string> GetWhitelist();
// Parses a comma-separated list of origins and wildcard hostname patterns.
// This separate function allows callers other than GetWhitelist() to
// explicitly pass a whitelist to be parsed.
std::vector<std::string> ParseWhitelist(const std::string& origins_str);
// Returns a whitelist of schemes that should bypass the Is Privileged Context
// check. See
std::set<std::string> GetSchemesBypassingSecureContextCheck();
// Register preferences for Secure Origin Whitelists.
void RegisterProfilePrefs(PrefRegistrySimple*);
} // namespace secure_origin_whitelist