本文整理汇总了C++中FrameLoader::opener方法的典型用法代码示例。如果您正苦于以下问题:C++ FrameLoader::opener方法的具体用法?C++ FrameLoader::opener怎么用?C++ FrameLoader::opener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrameLoader
的用法示例。
在下文中一共展示了FrameLoader::opener方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setForFrame
void SecurityOrigin::setForFrame(Frame* frame)
{
clear();
FrameLoader* loader = frame->loader();
const KURL& securityPolicyURL = loader->url();
if (!securityPolicyURL.isEmpty()) {
m_protocol = securityPolicyURL.protocol().lower();
m_host = securityPolicyURL.host().lower();
m_port = securityPolicyURL.port();
if (m_port)
m_portSet = true;
// data: URLs are not allowed access to anything other than themselves.
if (m_protocol == "data") {
m_noAccess = true;
return;
}
// Only in the case of about:blank or javascript: URLs (which create documents using the "about"
// protocol) do we want to use the parent or openers URL as the origin.
if (m_protocol != "about")
return;
}
Frame* openerFrame = frame->tree()->parent();
if (!openerFrame) {
openerFrame = loader->opener();
if (!openerFrame)
return;
}
Document* openerDocument = openerFrame->document();
if (!openerDocument)
return;
*this = openerDocument->securityOrigin();
}