本文整理汇总了C++中webcore::ResourceResponse::suggestedFilename方法的典型用法代码示例。如果您正苦于以下问题:C++ ResourceResponse::suggestedFilename方法的具体用法?C++ ResourceResponse::suggestedFilename怎么用?C++ ResourceResponse::suggestedFilename使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类webcore::ResourceResponse
的用法示例。
在下文中一共展示了ResourceResponse::suggestedFilename方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: webkit_network_response_get_suggested_filename
/**
* webkit_network_response_get_suggested_filename:
* @response: a #WebKitNetworkResponse
*
* Obtains the suggested filename for the given network response. The
* suggested filename is taken from the 'Content-Disposition' HTTP
* header, but this is not always present, and this method will return
* %NULL in such case.
*
* Returns: (transfer none): the suggested filename or %NULL if not present
* Since: 1.10
**/
const gchar* webkit_network_response_get_suggested_filename(WebKitNetworkResponse* response)
{
g_return_val_if_fail(WEBKIT_IS_NETWORK_RESPONSE(response), 0);
WebKitNetworkResponsePrivate* priv = response->priv;
if (priv->suggestedFilename)
return priv->suggestedFilename;
WebCore::ResourceResponse coreResponse = core(response);
priv->suggestedFilename = g_strdup(coreResponse.suggestedFilename().utf8().data());
return priv->suggestedFilename;
}
示例2: didDecidePolicyForResponse
void DumpRenderTree::didDecidePolicyForResponse(const WebCore::ResourceResponse& response)
{
if (!testDone && m_policyDelegateEnabled) {
if (WebCore::contentDispositionType(response.httpHeaderField("Content-Disposition")) == WebCore::ContentDispositionAttachment)
printf("Policy delegate: resource is an attachment, suggested file name '%s'\n", response.suggestedFilename().utf8().data());
if (waitForPolicy)
gTestRunner->notifyDone();
}
}