当前位置: 首页>>代码示例>>C++>>正文


C++ NeverDestroyed::get方法代码示例

本文整理汇总了C++中NeverDestroyed::get方法的典型用法代码示例。如果您正苦于以下问题:C++ NeverDestroyed::get方法的具体用法?C++ NeverDestroyed::get怎么用?C++ NeverDestroyed::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NeverDestroyed的用法示例。


在下文中一共展示了NeverDestroyed::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: isSupportedAttribute

bool SVGCursorElement::isSupportedAttribute(const QualifiedName& attrName)
{
    static NeverDestroyed<HashSet<QualifiedName>> supportedAttributes;
    if (supportedAttributes.get().isEmpty()) {
        SVGTests::addSupportedAttributes(supportedAttributes);
        SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes);
        SVGURIReference::addSupportedAttributes(supportedAttributes);
        supportedAttributes.get().add(SVGNames::xAttr);
        supportedAttributes.get().add(SVGNames::yAttr);
    }
    return supportedAttributes.get().contains<SVGAttributeHashTranslator>(attrName);
}
开发者ID:fanghongjia,项目名称:JavaScriptCore,代码行数:12,代码来源:SVGCursorElement.cpp

示例2: isSupportedAttribute

bool SVGTextPositioningElement::isSupportedAttribute(const QualifiedName& attrName)
{
    static NeverDestroyed<HashSet<QualifiedName>> supportedAttributes;
    if (supportedAttributes.get().isEmpty()) {
        supportedAttributes.get().add(SVGNames::xAttr);
        supportedAttributes.get().add(SVGNames::yAttr);
        supportedAttributes.get().add(SVGNames::dxAttr);
        supportedAttributes.get().add(SVGNames::dyAttr);
        supportedAttributes.get().add(SVGNames::rotateAttr);
    }
    return supportedAttributes.get().contains<SVGAttributeHashTranslator>(attrName);
}
开发者ID:chenbk85,项目名称:webkit2-wincairo,代码行数:12,代码来源:SVGTextPositioningElement.cpp

示例3: factory

std::unique_ptr<InputType> InputType::create(HTMLInputElement& element, const AtomicString& typeName)
{
    static NeverDestroyed<InputTypeFactoryMap> factoryMap;
    if (factoryMap.get().isEmpty())
        populateInputTypeFactoryMap(factoryMap);

    if (!typeName.isEmpty()) {
        if (auto factory = factoryMap.get().get(typeName))
            return factory(element);
    }
    return std::make_unique<TextInputType>(element);
}
开发者ID:endlessm,项目名称:WebKit,代码行数:12,代码来源:InputType.cpp

示例4: CORSEnabledSchemes

static URLSchemesMap& CORSEnabledSchemes()
{
    // FIXME: http://bugs.webkit.org/show_bug.cgi?id=77160
    static NeverDestroyed<URLSchemesMap> CORSEnabledSchemes;

    if (CORSEnabledSchemes.get().isEmpty()) {
        CORSEnabledSchemes.get().add("http");
        CORSEnabledSchemes.get().add("https");
    }

    return CORSEnabledSchemes;
}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:12,代码来源:SchemeRegistry.cpp

示例5: isSupportedAttribute

bool SVGGradientElement::isSupportedAttribute(const QualifiedName& attrName)
{
    static NeverDestroyed<HashSet<QualifiedName>> supportedAttributes;
    if (supportedAttributes.get().isEmpty()) {
        SVGURIReference::addSupportedAttributes(supportedAttributes);
        SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes);
        supportedAttributes.get().add(SVGNames::gradientUnitsAttr);
        supportedAttributes.get().add(SVGNames::gradientTransformAttr);
        supportedAttributes.get().add(SVGNames::spreadMethodAttr);
    }
    return supportedAttributes.get().contains<SVGAttributeHashTranslator>(attrName);
}
开发者ID:cheekiatng,项目名称:webkit,代码行数:12,代码来源:SVGGradientElement.cpp

示例6: isSupportedAttribute

bool SVGFilterPrimitiveStandardAttributes::isSupportedAttribute(const QualifiedName& attrName)
{
    static NeverDestroyed<HashSet<QualifiedName>> supportedAttributes;
    if (supportedAttributes.get().isEmpty()) {
        supportedAttributes.get().add(SVGNames::xAttr);
        supportedAttributes.get().add(SVGNames::yAttr);
        supportedAttributes.get().add(SVGNames::widthAttr);
        supportedAttributes.get().add(SVGNames::heightAttr);
        supportedAttributes.get().add(SVGNames::resultAttr);
    }
    return supportedAttributes.get().contains<SVGAttributeHashTranslator>(attrName);
}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:12,代码来源:SVGFilterPrimitiveStandardAttributes.cpp

示例7: parseAxisName

static bool parseAxisName(const String& name, Step::Axis& type)
{
    static NeverDestroyed<HashMap<String, Step::Axis>> axisNames;
    if (axisNames.get().isEmpty())
        populateAxisNamesMap(axisNames);

    auto it = axisNames.get().find(name);
    if (it == axisNames.get().end())
        return false;
    type = it->value;
    return true;
}
开发者ID:ZeusbaseWeb,项目名称:webkit,代码行数:12,代码来源:XPathParser.cpp

示例8: parseNonceSource

// nonce-source    = "'nonce-" nonce-value "'"
// nonce-value     = base64-value
bool ContentSecurityPolicySourceList::parseNonceSource(const UChar* begin, const UChar* end)
{
    static NeverDestroyed<String> noncePrefix("'nonce-", String::ConstructFromLiteral);
    if (!StringView(begin, end - begin).startsWithIgnoringASCIICase(noncePrefix.get()))
        return false;
    const UChar* position = begin + noncePrefix.get().length();
    const UChar* beginNonceValue = position;
    skipWhile<UChar, isNonceCharacter>(position, end);
    if (position >= end || position == beginNonceValue || *position != '\'')
        return false;
    m_nonces.add(String(beginNonceValue, position - beginNonceValue));
    return true;
}
开发者ID:edcwconan,项目名称:webkit,代码行数:15,代码来源:ContentSecurityPolicySourceList.cpp

示例9: localURLSchemes

static URLSchemesMap& localURLSchemes()
{
    static NeverDestroyed<URLSchemesMap> localSchemes;

    if (localSchemes.get().isEmpty()) {
        localSchemes.get().add("file");
#if PLATFORM(COCOA)
        localSchemes.get().add("applewebdata");
#endif
    }

    return localSchemes;
}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:13,代码来源:SchemeRegistry.cpp

示例10: isSupportedAttribute

bool SVGForeignObjectElement::isSupportedAttribute(const QualifiedName& attrName)
{
    static NeverDestroyed<HashSet<QualifiedName>> supportedAttributes;
    if (supportedAttributes.get().isEmpty()) {
        SVGLangSpace::addSupportedAttributes(supportedAttributes);
        SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes);
        supportedAttributes.get().add(SVGNames::xAttr);
        supportedAttributes.get().add(SVGNames::yAttr);
        supportedAttributes.get().add(SVGNames::widthAttr);
        supportedAttributes.get().add(SVGNames::heightAttr);
    }
    return supportedAttributes.get().contains<SVGAttributeHashTranslator>(attrName);
}
开发者ID:quanmo,项目名称:webkit,代码行数:13,代码来源:SVGForeignObjectElement.cpp

示例11: subtitleText

static const String subtitleText(Page* page, String mimeType)
{
    static NeverDestroyed<MimeTypeToLocalizedStringMap> mimeTypeToLabelSubtitleMap;
    String subtitleText = mimeTypeToLabelSubtitleMap.get().get(mimeType);
    if (!subtitleText.isEmpty())
        return subtitleText;

    subtitleText = page->chrome().client().plugInStartLabelSubtitle(mimeType);
    if (subtitleText.isEmpty())
        subtitleText = snapshottedPlugInLabelSubtitle();
    mimeTypeToLabelSubtitleMap.get().set(mimeType, subtitleText);
    return subtitleText;
};
开发者ID:TigerWFH,项目名称:webkit,代码行数:13,代码来源:HTMLPlugInImageElement.cpp

示例12: fillWithEmptyClients

void fillWithEmptyClients(PageConfiguration& pageConfiguration)
{
    static NeverDestroyed<EmptyChromeClient> dummyChromeClient;
    pageConfiguration.chromeClient = &dummyChromeClient.get();

#if ENABLE(CONTEXT_MENUS)
    static NeverDestroyed<EmptyContextMenuClient> dummyContextMenuClient;
    pageConfiguration.contextMenuClient = &dummyContextMenuClient.get();
#endif

#if ENABLE(DRAG_SUPPORT)
    static NeverDestroyed<EmptyDragClient> dummyDragClient;
    pageConfiguration.dragClient = &dummyDragClient.get();
#endif

    static NeverDestroyed<EmptyEditorClient> dummyEditorClient;
    pageConfiguration.editorClient = &dummyEditorClient.get();

    static NeverDestroyed<EmptyInspectorClient> dummyInspectorClient;
    pageConfiguration.inspectorClient = &dummyInspectorClient.get();

    static NeverDestroyed<EmptyFrameLoaderClient> dummyFrameLoaderClient;
    pageConfiguration.loaderClientForMainFrame = &dummyFrameLoaderClient.get();

    static NeverDestroyed<EmptyProgressTrackerClient> dummyProgressTrackerClient;
    pageConfiguration.progressTrackerClient = &dummyProgressTrackerClient.get();

    static NeverDestroyed<EmptyDiagnosticLoggingClient> dummyDiagnosticLoggingClient;
    pageConfiguration.diagnosticLoggingClient = &dummyDiagnosticLoggingClient.get();

    pageConfiguration.databaseProvider = adoptRef(new EmptyDatabaseProvider);
    pageConfiguration.storageNamespaceProvider = adoptRef(new EmptyStorageNamespaceProvider);
    pageConfiguration.visitedLinkStore = adoptRef(new EmptyVisitedLinkStore);
}
开发者ID:st3fan,项目名称:webkit,代码行数:34,代码来源:EmptyClients.cpp

示例13: schemesWithUniqueOrigins

static URLSchemesMap& schemesWithUniqueOrigins()
{
    static NeverDestroyed<URLSchemesMap> schemesWithUniqueOrigins;

    if (schemesWithUniqueOrigins.get().isEmpty()) {
        schemesWithUniqueOrigins.get().add("about");
        schemesWithUniqueOrigins.get().add("javascript");
        // This is a willful violation of HTML5.
        // See https://bugs.webkit.org/show_bug.cgi?id=11885
        schemesWithUniqueOrigins.get().add("data");
    }

    return schemesWithUniqueOrigins;
}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:14,代码来源:SchemeRegistry.cpp

示例14: populateFunctionMap

std::unique_ptr<Function> Function::create(const String& name, unsigned numArguments)
{
    static NeverDestroyed<HashMap<String, FunctionMapValue>> functionMap;
    if (functionMap.get().isEmpty())
        populateFunctionMap(functionMap);

    auto it = functionMap.get().find(name);
    if (it == functionMap.get().end())
        return nullptr;

    if (!it->value.argumentCountInterval.contains(numArguments))
        return nullptr;

    return it->value.creationFunction();
}
开发者ID:valbok,项目名称:WebKitForWayland,代码行数:15,代码来源:XPathFunctions.cpp

示例15: guidForOriginAndName

static DatabaseGuid guidForOriginAndName(const String& origin, const String& name)
{
    String stringID = origin + "/" + name;

    typedef HashMap<String, int> IDGuidMap;
    static NeverDestroyed<HashMap<String, int>> map;
    DatabaseGuid guid = map.get().get(stringID);
    if (!guid) {
        static int currentNewGUID = 1;
        guid = currentNewGUID++;
        map.get().set(stringID, guid);
    }

    return guid;
}
开发者ID:AndriyKalashnykov,项目名称:webkit,代码行数:15,代码来源:DatabaseBackendBase.cpp


注:本文中的NeverDestroyed::get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。