本文整理汇总了C++中UserScriptVector::isEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ UserScriptVector::isEmpty方法的具体用法?C++ UserScriptVector::isEmpty怎么用?C++ UserScriptVector::isEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserScriptVector
的用法示例。
在下文中一共展示了UserScriptVector::isEmpty方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
}
示例2: removeUserScriptFromWorld
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);
}
示例3: 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);
}
}
示例4: 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);
}