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


C++ UserScriptVector类代码示例

本文整理汇总了C++中UserScriptVector的典型用法代码示例。如果您正苦于以下问题:C++ UserScriptVector类的具体用法?C++ UserScriptVector怎么用?C++ UserScriptVector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: ASSERT_ARG

void PageGroup::removeUserScriptFromWorld(DOMWrapperWorld* world, const KURL& url)
{
    ASSERT_ARG(world, world);

    if (!m_userScripts)
        return;

    UserScriptMap::iterator it = m_userScripts->find(world);
    if (it == m_userScripts->end())
        return;
    
    UserScriptVector* scripts = it->value.get();
    for (int i = scripts->size() - 1; i >= 0; --i) {
        if (scripts->at(i)->url() == url)
            scripts->remove(i);
    }
    
    if (scripts->isEmpty())
        m_userScripts->remove(it);
}
开发者ID:jiezh,项目名称:h5vcc,代码行数:20,代码来源:PageGroup.cpp

示例2: injectUserScriptsForWorld

void Frame::injectUserScriptsForWorld(DOMWrapperWorld* world, const UserScriptVector& userScripts, UserScriptInjectionTime injectionTime)
{
    if (userScripts.isEmpty())
        return;

    Document* doc = document();
    if (!doc)
        return;

    Vector<ScriptSourceCode> sourceCode;
    unsigned count = userScripts.size();
    for (unsigned i = 0; i < count; ++i) {
        UserScript* script = userScripts[i].get();
        if (script->injectedFrames() == InjectInTopFrameOnly && ownerElement())
            continue;

        if (script->injectionTime() == injectionTime && UserContentURLPattern::matchesPatterns(doc->url(), script->whitelist(), script->blacklist()))
            m_script.evaluateInWorld(ScriptSourceCode(script->source(), script->url()), world);
    }
}
开发者ID:CannedFish,项目名称:deepin-webkit,代码行数:20,代码来源:Frame.cpp

示例3: removeUserScriptFromWorld

void PageGroup::removeUserScriptFromWorld(unsigned worldID, const KURL& url)
{
    if (!m_userScripts)
        return;

    UserScriptMap::iterator it = m_userScripts->find(worldID);
    if (it == m_userScripts->end())
        return;
    
    UserScriptVector* scripts = it->second;
    for (int i = scripts->size() - 1; i >= 0; --i) {
        if (scripts->at(i)->url() == url)
            scripts->remove(i);
    }
    
    if (!scripts->isEmpty())
        return;
    
    delete it->second;
    m_userScripts->remove(it);
}
开发者ID:Mr-Kumar-Abhishek,项目名称:qt,代码行数:21,代码来源:PageGroup.cpp

示例4: injectUserScriptsForWorld

void Frame::injectUserScriptsForWorld(DOMWrapperWorld& world, const UserScriptVector& userScripts, UserScriptInjectionTime injectionTime)
{
    if (userScripts.isEmpty())
        return;

    Document* doc = document();
    if (!doc)
        return;

    for (auto& script : userScripts) {
        if (script->injectedFrames() == InjectInTopFrameOnly && ownerElement())
            continue;

        if (script->injectionTime() == injectionTime && UserContentURLPattern::matchesPatterns(doc->url(), script->whitelist(), script->blacklist()))
            m_script->evaluateInWorld(ScriptSourceCode(script->source(), script->url()), world);
    }
}
开发者ID:mu326668629,项目名称:webkit,代码行数:17,代码来源:Frame.cpp


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