本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
};
示例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);
}
示例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;
}
示例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();
}
示例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;
}