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


C++ SecurityOrigin::host方法代码示例

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


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

示例1: areOriginsMatching

static inline bool areOriginsMatching(const SecurityOrigin& origin1, const SecurityOrigin& origin2)
{
    if (origin1.isUnique() || origin2.isUnique())
        return origin1.isUnique() == origin2.isUnique();

    if (origin1.protocol() != origin2.protocol())
        return false;

    if (origin1.protocol() == "file")
        return true;

    if (origin1.host() != origin2.host())
        return false;

    return origin1.port() == origin2.port();
}
开发者ID:,项目名称:,代码行数:16,代码来源:

示例2: removeResourcesWithOrigin

void MemoryCache::removeResourcesWithOrigin(SecurityOrigin& origin)
{
#if ENABLE(CACHE_PARTITIONING)
    String originPartition = ResourceRequest::partitionName(origin.host());
#endif

    Vector<CachedResource*> resourcesWithOrigin;
    for (auto& resources : m_sessionResources.values()) {
        for (auto& keyValue : *resources) {
            auto& resource = *keyValue.value;
#if ENABLE(CACHE_PARTITIONING)
            auto& partitionName = keyValue.key.second;
            if (partitionName == originPartition) {
                resourcesWithOrigin.append(&resource);
                continue;
            }
#endif
            RefPtr<SecurityOrigin> resourceOrigin = SecurityOrigin::create(resource.url());
            if (resourceOrigin->equal(&origin))
                resourcesWithOrigin.append(&resource);
        }
    }

    for (auto* resource : resourcesWithOrigin)
        remove(*resource);
}
开发者ID:nickooms,项目名称:webkit,代码行数:26,代码来源:MemoryCache.cpp

示例3: fromSecurityOrigin

SecurityOriginData SecurityOriginData::fromSecurityOrigin(const SecurityOrigin& securityOrigin)
{
    SecurityOriginData securityOriginData;

    securityOriginData.protocol = securityOrigin.protocol();
    securityOriginData.host = securityOrigin.host();
    securityOriginData.port = securityOrigin.port();

    return securityOriginData;
}
开发者ID:edcwconan,项目名称:webkit,代码行数:10,代码来源:SecurityOriginData.cpp

示例4: matchesOrigin

bool OriginAccessEntry::matchesOrigin(const SecurityOrigin& origin) const
{
    ASSERT(origin.host() == origin.host().convertToASCIILowercase());
    ASSERT(origin.protocol() == origin.protocol().convertToASCIILowercase());

    if (m_protocol != origin.protocol())
        return false;
    
    // Special case: Include subdomains and empty host means "all hosts, including ip addresses".
    if (m_subdomainSettings == AllowSubdomains && m_host.isEmpty())
        return true;
    
    // Exact match.
    if (m_host == origin.host())
        return true;
    
    // Otherwise we can only match if we're matching subdomains.
    if (m_subdomainSettings == DisallowSubdomains)
        return false;
    
    // Don't try to do subdomain matching on IP addresses.
    if (m_hostIsIPAddress)
        return false;
    
    // Match subdomains.
    if (origin.host().length() > m_host.length() && origin.host()[origin.host().length() - m_host.length() - 1] == '.' && origin.host().endsWith(m_host))
        return true;
    
    return false;
}
开发者ID:caiolima,项目名称:webkit,代码行数:30,代码来源:OriginAccessEntry.cpp

示例5: matchesOrigin

OriginAccessEntry::MatchResult OriginAccessEntry::matchesOrigin(const SecurityOrigin& origin) const
{
    ASSERT(origin.host() == origin.host().lower());
    ASSERT(origin.protocol() == origin.protocol().lower());

    if (m_protocol != origin.protocol())
        return DoesNotMatchOrigin;

    // Special case: Include subdomains and empty host means "all hosts, including ip addresses".
    if (m_subdomainSettings == AllowSubdomains && m_host.isEmpty())
        return MatchesOrigin;

    // Exact match.
    if (m_host == origin.host())
        return MatchesOrigin;

    // Otherwise we can only match if we're matching subdomains.
    if (m_subdomainSettings == DisallowSubdomains)
        return DoesNotMatchOrigin;

    // Don't try to do subdomain matching on IP addresses (except for testing).
    if (m_hostIsIPAddress && m_ipAddressSettings == TreatIPAddressAsIPAddress)
        return DoesNotMatchOrigin;

    // Match subdomains.
    if (origin.host().length() <= m_host.length() || origin.host()[origin.host().length() - m_host.length() - 1] != '.' || !origin.host().endsWith(m_host))
        return DoesNotMatchOrigin;

    if (m_hostIsPublicSuffix)
        return MatchesOriginButIsPublicSuffix;

    return MatchesOrigin;
}
开发者ID:joone,项目名称:blink-crosswalk,代码行数:33,代码来源:OriginAccessEntry.cpp

示例6: matchesDomain

OriginAccessEntry::MatchResult OriginAccessEntry::matchesDomain(const SecurityOrigin& origin) const
{
    ASSERT(origin.host() == origin.host().lower());
    // Special case: Include subdomains and empty host means "all hosts, including ip addresses".
    if (m_subdomainSettings != DisallowSubdomains && m_host.isEmpty())
        return MatchesOrigin;

    // Exact match.
    if (m_host == origin.host())
        return MatchesOrigin;

    // Don't try to do subdomain matching on IP addresses.
    if (m_hostIsIPAddress)
        return DoesNotMatchOrigin;

    // Match subdomains.
    switch (m_subdomainSettings) {
    case DisallowSubdomains:
        return DoesNotMatchOrigin;

    case AllowSubdomains:
        if (!IsSubdomainOfHost(origin.host(), m_host))
            return DoesNotMatchOrigin;
        break;

    case AllowRegisterableDomains:
        // Fall back to a simple subdomain check if no registerable domain could be found:
        if (m_registerableDomain.isEmpty()) {
            if (!IsSubdomainOfHost(origin.host(), m_host))
                return DoesNotMatchOrigin;
        } else if (m_registerableDomain != origin.host() && !IsSubdomainOfHost(origin.host(), m_registerableDomain)) {
            return DoesNotMatchOrigin;
        }
        break;
    };

    if (m_hostIsPublicSuffix)
        return MatchesOriginButIsPublicSuffix;

    return MatchesOrigin;
}
开发者ID:joone,项目名称:chromium-crosswalk,代码行数:41,代码来源:OriginAccessEntry.cpp

示例7: addSourceSelf

void CSPSourceList::addSourceSelf()
{
    m_list.append(CSPSource(m_origin->protocol(), m_origin->host(), m_origin->port(), false, false));
}
开发者ID:13W,项目名称:phantomjs,代码行数:4,代码来源:ContentSecurityPolicy.cpp

示例8: emptyString

ContentSecurityPolicy::ContentSecurityPolicy(const SecurityOrigin& securityOrigin)
    : m_sandboxFlags(SandboxNone)
{
    m_selfSourceProtocol = securityOrigin.protocol();
    m_selfSource = std::make_unique<ContentSecurityPolicySource>(*this, m_selfSourceProtocol, securityOrigin.host(), securityOrigin.port(), emptyString(), false, false);
}
开发者ID:sunyuping,项目名称:webkit,代码行数:6,代码来源:ContentSecurityPolicy.cpp


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