本文整理汇总了C++中FrameLoader::setEncoding方法的典型用法代码示例。如果您正苦于以下问题:C++ FrameLoader::setEncoding方法的具体用法?C++ FrameLoader::setEncoding怎么用?C++ FrameLoader::setEncoding使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrameLoader
的用法示例。
在下文中一共展示了FrameLoader::setEncoding方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: committedLoad
void FrameLoaderClient::committedLoad(WebCore::DocumentLoader* loader, const char* data, int length)
{
if (!m_pluginView) {
ASSERT(loader->frame());
// Setting the encoding on the frame loader is our way to get work done that is normally done
// when the first bit of data is received, even for the case of a document with no data (like about:blank).
String encoding = loader->overrideEncoding();
bool userChosen = !encoding.isNull();
if (!userChosen)
encoding = loader->response().textEncodingName();
FrameLoader* frameLoader = loader->frameLoader();
frameLoader->setEncoding(encoding, userChosen);
if (data)
frameLoader->addData(data, length);
}
if (m_pluginView) {
if (!m_hasSentResponseToPlugin) {
m_pluginView->didReceiveResponse(loader->response());
m_hasSentResponseToPlugin = true;
}
// FIXME: We may want to investigate refactoring our plugin loading
// code to be similar to mac's.
// Also, see http://trac.webkit.org/changeset/24118.
if (!m_pluginView)
return;
m_pluginView->didReceiveData(data, length);
}
}
示例2: committedLoad
void FrameLoaderClientQt::committedLoad(WebCore::DocumentLoader* loader, const char* data, int length)
{
if (!m_pluginView) {
if (!m_frame)
return;
FrameLoader *fl = loader->frameLoader();
if (m_firstData) {
fl->setEncoding(m_response.textEncodingName(), false);
m_firstData = false;
}
fl->addData(data, length);
}
// We re-check here as the plugin can have been created
if (m_pluginView && m_pluginView->isPluginView()) {
if (!m_hasSentResponseToPlugin) {
m_pluginView->didReceiveResponse(loader->response());
// didReceiveResponse sets up a new stream to the plug-in. on a full-page plug-in, a failure in
// setting up this stream can cause the main document load to be cancelled, setting m_pluginView
// to null
if (!m_pluginView)
return;
m_hasSentResponseToPlugin = true;
}
m_pluginView->didReceiveData(data, length);
}
}
示例3: committedLoad
void FrameLoaderClientWx::committedLoad(WebCore::DocumentLoader* loader, const char* data, int length)
{
if (!m_frame)
return;
FrameLoader* fl = loader->frameLoader();
fl->setEncoding(m_response.textEncodingName(), false);
fl->addData(data, length);
}
示例4: dispatchDidFailLoading
void FrameLoaderClientQt::dispatchDidFailLoading(WebCore::DocumentLoader* loader, unsigned long identifier, const WebCore::ResourceError& error)
{
if (dumpResourceLoadCallbacks)
printf("%s - didFailLoadingWithError: %s\n", qPrintable(dumpAssignedUrls[identifier]), qPrintable(drtDescriptionSuitableForTestResult(error)));
if (m_firstData) {
FrameLoader *fl = loader->frameLoader();
fl->setEncoding(m_response.textEncodingName(), false);
m_firstData = false;
}
}
示例5: finishedLoading
void FrameLoaderClientQt::finishedLoading(DocumentLoader* loader)
{
if (!m_pluginView) {
if(m_firstData) {
FrameLoader *fl = loader->frameLoader();
fl->setEncoding(m_response.textEncodingName(), false);
m_firstData = false;
}
}
else {
m_pluginView->didFinishLoading();
m_pluginView = 0;
m_hasSentResponseToPlugin = false;
}
}
示例6: committedLoad
void FrameLoaderClientQt::committedLoad(WebCore::DocumentLoader* loader, const char* data, int length)
{
if (!m_pluginView) {
if (!m_frame)
return;
FrameLoader *fl = loader->frameLoader();
if (m_firstData) {
fl->setEncoding(m_response.textEncodingName(), false);
m_firstData = false;
}
fl->addData(data, length);
}
// We re-check here as the plugin can have been created
if (m_pluginView) {
if (!m_hasSentResponseToPlugin) {
m_pluginView->didReceiveResponse(loader->response());
m_hasSentResponseToPlugin = true;
}
m_pluginView->didReceiveData(data, length);
}
}