本文整理汇总了C++中RenderEmbeddedObject::createWeakPtr方法的典型用法代码示例。如果您正苦于以下问题:C++ RenderEmbeddedObject::createWeakPtr方法的具体用法?C++ RenderEmbeddedObject::createWeakPtr怎么用?C++ RenderEmbeddedObject::createWeakPtr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RenderEmbeddedObject
的用法示例。
在下文中一共展示了RenderEmbeddedObject::createWeakPtr方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadPlugin
bool SubframeLoader::loadPlugin(HTMLPlugInImageElement& pluginElement, const URL& url, const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues, bool useFallback)
{
if (useFallback)
return false;
RenderEmbeddedObject* renderer = pluginElement.renderEmbeddedObject();
// FIXME: This code should not depend on renderer!
if (!renderer)
return false;
pluginElement.subframeLoaderWillCreatePlugIn(url);
IntSize contentSize = roundedIntSize(LayoutSize(renderer->contentWidth(), renderer->contentHeight()));
bool loadManually = is<PluginDocument>(*document()) && !m_containsPlugins && downcast<PluginDocument>(*document()).shouldLoadPluginManually();
#if PLATFORM(IOS)
// On iOS, we only tell the plugin to be in full page mode if the containing plugin document is the top level document.
if (document()->ownerElement())
loadManually = false;
#endif
WeakPtr<RenderWidget> weakRenderer = renderer->createWeakPtr();
// createPlugin *may* cause this renderer to disappear from underneath.
RefPtr<Widget> widget = m_frame.loader().client().createPlugin(contentSize, &pluginElement, url, paramNames, paramValues, mimeType, loadManually);
if (!weakRenderer)
return false;
if (!widget) {
if (!renderer->isPluginUnavailable())
renderer->setPluginUnavailabilityReason(RenderEmbeddedObject::PluginMissing);
return false;
}
pluginElement.subframeLoaderDidCreatePlugIn(*widget);
renderer->setWidget(WTFMove(widget));
m_containsPlugins = true;
return true;
}