本文整理汇总了C++中JSDOMGlobalObject::get方法的典型用法代码示例。如果您正苦于以下问题:C++ JSDOMGlobalObject::get方法的具体用法?C++ JSDOMGlobalObject::get怎么用?C++ JSDOMGlobalObject::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSDOMGlobalObject
的用法示例。
在下文中一共展示了JSDOMGlobalObject::get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: didAddUserAgentShadowRoot
void HTMLPlugInImageElement::didAddUserAgentShadowRoot(ShadowRoot* root)
{
HTMLPlugInElement::didAddUserAgentShadowRoot(root);
if (displayState() >= PreparingPluginReplacement)
return;
Page* page = document().page();
if (!page)
return;
// Reset any author styles that may apply as we only want explicit
// styles defined in the injected user agents stylesheets to specify
// the look-and-feel of the snapshotted plug-in overlay.
root->setResetStyleInheritance(true);
String mimeType = loadedMimeType();
DOMWrapperWorld& isolatedWorld = plugInImageElementIsolatedWorld();
document().ensurePlugInsInjectedScript(isolatedWorld);
ScriptController& scriptController = document().frame()->script();
JSDOMGlobalObject* globalObject = JSC::jsCast<JSDOMGlobalObject*>(scriptController.globalObject(isolatedWorld));
JSC::ExecState* exec = globalObject->globalExec();
JSC::JSLockHolder lock(exec);
JSC::MarkedArgumentBuffer argList;
argList.append(toJS(exec, globalObject, root));
argList.append(jsString(exec, titleText(page, mimeType)));
argList.append(jsString(exec, subtitleText(page, mimeType)));
// This parameter determines whether or not the snapshot overlay should always be visible over the plugin snapshot.
// If no snapshot was found then we want the overlay to be visible.
argList.append(JSC::jsBoolean(!m_snapshotImage));
// It is expected the JS file provides a createOverlay(shadowRoot, title, subtitle) function.
JSC::JSObject* overlay = globalObject->get(exec, JSC::Identifier::fromString(exec, "createOverlay")).toObject(exec);
if (!overlay) {
ASSERT(exec->hadException());
exec->clearException();
return;
}
JSC::CallData callData;
JSC::CallType callType = overlay->methodTable()->getCallData(overlay, callData);
if (callType == JSC::CallType::None)
return;
JSC::call(exec, overlay, callType, callData, globalObject, argList);
exec->clearException();
}