/* * Copyright (C) 2013 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. AND ITS CONTRIBUTORS ``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 INC. OR ITS 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. */ #pragma once #include "CryptoAlgorithmIdentifier.h" #include #include #include #include #include #if ENABLE(WEB_CRYPTO) namespace WebCore { class CryptoAlgorithm; class CryptoAlgorithmRegistry { WTF_MAKE_NONCOPYABLE(CryptoAlgorithmRegistry); friend class LazyNeverDestroyed; public: static CryptoAlgorithmRegistry& singleton(); std::optional identifier(const String&); String name(CryptoAlgorithmIdentifier); RefPtr create(CryptoAlgorithmIdentifier); private: CryptoAlgorithmRegistry(); void platformRegisterAlgorithms(); using CryptoAlgorithmConstructor = Ref (*)(); template void registerAlgorithm() { registerAlgorithm(AlgorithmClass::s_name, AlgorithmClass::s_identifier, AlgorithmClass::create); } void registerAlgorithm(const String& name, CryptoAlgorithmIdentifier, CryptoAlgorithmConstructor); Lock m_lock; HashMap m_identifiers WTF_GUARDED_BY_LOCK(m_lock); HashMap> m_constructors WTF_GUARDED_BY_LOCK(m_lock); }; } // namespace WebCore #endif // ENABLE(WEB_CRYPTO) alue='db-tokens'>db-tokens Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Expand)AuthorFilesLines
2023-08-03Fix failed server restart calling integration hooks twice (#7917)Gravatar Bjorn Lu 5-30/+27
2023-08-02[ci] formatGravatar matthewp 3-19/+28
2023-08-02Persistent DOM in ViewTransitions (#7861)Gravatar Matthew Phillips 18-20/+242
2023-08-02[ci] formatGravatar matthewp 1-1/+1
2023-08-02Fix scroll position in view transition (#7882) (#7911)Gravatar Martin Trapp 2-1/+6
2023-08-02Improve sourcemap generation and performance (#7901)Gravatar Bjorn Lu 11-27/+34
2023-08-01[ci] formatGravatar natemoo-re 1-1/+0
2023-08-01Fix astro/app import (#7821)Gravatar ottomated 4-1/+25
2023-08-01[ci] formatGravatar natemoo-re 1-1/+1
2023-08-01feat: add cache headers to assets in Vercel adapter (#7729)Gravatar Hee 10-3/+144
2023-08-01Fix "res.writeHead is not a function" in Express/node middleware (#7708)Gravatar DixCouleur 3-8/+34
2023-08-01Fix: Content Collections - Ignore `.json` files nested in non-underscored sub...Gravatar Tony Dang 3-1/+6
2023-08-01chore: address feedback from #7754 (#7906)Gravatar Nate Moore 1-2/+4
2023-08-01[ci] release (#7877)astro@2.9.7@astrojs/vercel@3.7.5@astrojs/node@5.3.1@astrojs/netlify@2.5.2Gravatar Houston (Bot) 52-129/+128
2023-08-01feat: add logging for when hydrate's JSON parse fails (#7887)Gravatar Sam Hulick 2-3/+28
2023-08-01Fix prefetch test fail (#7902)Gravatar Bjorn Lu 1-0/+2
2023-08-01[ci] formatGravatar bluwy 4-13/+28