本文整理汇总了C++中WebCoreSynchronousLoader类的典型用法代码示例。如果您正苦于以下问题:C++ WebCoreSynchronousLoader类的具体用法?C++ WebCoreSynchronousLoader怎么用?C++ WebCoreSynchronousLoader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WebCoreSynchronousLoader类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: loadResourceSynchronously
void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, StoredCredentials /*storedCredentials*/, ResourceError& error, ResourceResponse& response, Vector<char>& data, Frame* frame)
{
WebCoreSynchronousLoader syncLoader;
ResourceHandle handle(request, &syncLoader, true, false, true);
#if QT_VERSION < 0x040400
if (!QWebNetworkManager::self()->add(&handle, QWebNetworkInterface::defaultInterface(), QWebNetworkManager::SynchronousJob)) {
// FIXME Create a sane ResourceError
error = ResourceError(String(), -1, String(), String());
return;
}
#else
ResourceHandleInternal *d = handle.getInternal();
if (!(d->m_user.isEmpty() || d->m_pass.isEmpty())) {
// If credentials were specified for this request, add them to the url,
// so that they will be passed to QNetworkRequest.
KURL urlWithCredentials(d->m_request.url());
urlWithCredentials.setUser(d->m_user);
urlWithCredentials.setPass(d->m_pass);
d->m_request.setURL(urlWithCredentials);
}
d->m_frame = static_cast<FrameLoaderClientQt*>(frame->loader()->client())->webFrame();
d->m_job = new QNetworkReplyHandler(&handle, QNetworkReplyHandler::LoadNormal);
#endif
syncLoader.waitForCompletion();
error = syncLoader.resourceError();
data = syncLoader.data();
response = syncLoader.resourceResponse();
}
开发者ID:Mr-Kumar-Abhishek,项目名称:qt,代码行数:30,代码来源:ResourceHandleQt.cpp
示例2: loadResourceSynchronously
void ResourceHandle::loadResourceSynchronously(NetworkingContext*, const ResourceRequest& request, StoredCredentials storedCredentials, ResourceError& error, ResourceResponse& response, Vector<char>& data)
{
WebCoreSynchronousLoader syncLoader;
RefPtr<ResourceHandle> handle = adoptRef(new ResourceHandle(request, &syncLoader, true, false));
ResourceHandleManager* manager = ResourceHandleManager::sharedInstance();
manager->dispatchSynchronousJob(handle.get());
error = syncLoader.resourceError();
data = syncLoader.data();
response = syncLoader.resourceResponse();
}
开发者ID:dslab-epfl,项目名称:warr,代码行数:13,代码来源:ResourceHandleCurl.cpp
示例3: loadResourceSynchronously
void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, StoredCredentials storedCredentials, ResourceError& error, ResourceResponse& response, Vector<char>& data, Frame*)
{
WebCoreSynchronousLoader syncLoader;
ResourceHandle handle(request, &syncLoader, true, false, true);
ResourceHandleManager* manager = ResourceHandleManager::sharedInstance();
manager->dispatchSynchronousJob(&handle);
error = syncLoader.resourceError();
data = syncLoader.data();
response = syncLoader.resourceResponse();
}
开发者ID:freeworkzz,项目名称:nook-st-oss,代码行数:13,代码来源:ResourceHandleCurl.cpp
示例4: ASSERT
void ResourceHandle::platformLoadResourceSynchronously(NetworkingContext* context, const ResourceRequest& request, StoredCredentials, ResourceError& error, ResourceResponse& response, Vector<char>& data)
{
if (!context || !context->isValid()) {
ASSERT(false && "loadResourceSynchronously called with invalid networking context");
return;
}
// FIXME: clean up use of Frame now that we have NetworkingContext (see RIM Bug #1515)
Frame* frame = static_cast<FrameNetworkingContextBlackBerry*>(context)->frame();
if (!frame || !frame->loader() || !frame->loader()->client() || !frame->page()) {
ASSERT(false && "loadResourceSynchronously called without a frame or frame client");
return;
}
PageGroupLoadDeferrer deferrer(frame->page(), true);
TimerBase::fireTimersInNestedEventLoop();
int playerId = static_cast<FrameLoaderClientBlackBerry*>(frame->loader()->client())->playerId();
WebCoreSynchronousLoader syncLoader;
bool defersLoading = false;
bool shouldContentSniff = false;
RefPtr<ResourceHandle> handle = adoptRef(new ResourceHandle(context, request, &syncLoader, defersLoading, shouldContentSniff));
int status = NetworkManager::instance()->startJob(playerId, handle, frame, defersLoading);
if (status != BlackBerry::Platform::FilterStream::StatusSuccess) {
handle->cancel();
error = ResourceError(ResourceError::platformErrorDomain, status, request.url().string(), BlackBerry::Platform::String::emptyString());
return;
}
const double syncLoadTimeOut = 60; // seconds
double startTime = currentTime();
EventLoop loop;
while (!syncLoader.isDone() && !loop.ended()) {
loop.cycle();
if (currentTime() - startTime > syncLoadTimeOut) {
handle->cancel();
error = ResourceError(ResourceError::platformErrorDomain, BlackBerry::Platform::FilterStream::StatusNetworkError, request.url().string(), "Time out");
return;
}
}
error = syncLoader.resourceError();
data = syncLoader.data();
response = syncLoader.resourceResponse();
}
开发者ID:3163504123,项目名称:phantomjs,代码行数:49,代码来源:ResourceHandleBlackBerry.cpp
示例5: loadResourceSynchronously
void ResourceHandle::loadResourceSynchronously(NetworkingContext* context, const ResourceRequest& request, StoredCredentials /*storedCredentials*/, ResourceError& error, ResourceResponse& response, Vector<char>& data)
{
WebCoreSynchronousLoader syncLoader;
RefPtr<ResourceHandle> handle = adoptRef(new ResourceHandle(request, &syncLoader, true, false));
ResourceHandleInternal* d = handle->getInternal();
if (!d->m_user.isEmpty() || !d->m_pass.isEmpty()) {
// If credentials were specified for this request, add them to the url,
// so that they will be passed to QNetworkRequest.
KURL urlWithCredentials(d->m_firstRequest.url());
urlWithCredentials.setUser(d->m_user);
urlWithCredentials.setPass(d->m_pass);
d->m_firstRequest.setURL(urlWithCredentials);
}
d->m_context = context;
d->m_job = new QNetworkReplyHandler(handle.get(), QNetworkReplyHandler::SynchronousLoad);
QNetworkReply* reply = d->m_job->reply();
// When using synchronous calls, we are finished when reaching this point.
if (reply->isFinished()) {
syncLoader.setReplyFinished(true);
d->m_job->forwardData();
d->m_job->finish();
} else
syncLoader.waitForCompletion();
error = syncLoader.resourceError();
data = syncLoader.data();
response = syncLoader.resourceResponse();
}
开发者ID:dankurka,项目名称:webkit_titanium,代码行数:30,代码来源:ResourceHandleQt.cpp
示例6: loadResourceSynchronously
void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, ResourceError& error, ResourceResponse& response, Vector<char>& data, Frame* frame)
{
WebCoreSynchronousLoader syncLoader;
ResourceHandle handle(request, &syncLoader, true, false, true);
#if QT_VERSION < 0x040400
if (!QWebNetworkManager::self()->add(&handle, QWebNetworkInterface::defaultInterface(), QWebNetworkManager::SynchronousJob)) {
// FIXME Create a sane ResourceError
error = ResourceError(String(), -1, String(), String());
return;
}
#else
ResourceHandleInternal *d = handle.getInternal();
d->m_frame = static_cast<FrameLoaderClientQt*>(frame->loader()->client())->webFrame();
d->m_job = new QNetworkReplyHandler(&handle);
#endif
syncLoader.waitForCompletion();
error = syncLoader.resourceError();
data = syncLoader.data();
response = syncLoader.resourceResponse();
}
开发者ID:Gin-Rye,项目名称:duibrowser,代码行数:22,代码来源:ResourceHandleQt.cpp
示例7: loadResourceSynchronously
void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, StoredCredentials /*storedCredentials*/, ResourceError& error, ResourceResponse& response, Vector<char>& data, Frame* frame)
{
WebCoreSynchronousLoader syncLoader;
ResourceHandle handle(request, &syncLoader, true, false);
ResourceHandleInternal *d = handle.getInternal();
if (!(d->m_user.isEmpty() || d->m_pass.isEmpty())) {
// If credentials were specified for this request, add them to the url,
// so that they will be passed to QNetworkRequest.
KURL urlWithCredentials(d->m_request.url());
urlWithCredentials.setUser(d->m_user);
urlWithCredentials.setPass(d->m_pass);
d->m_request.setURL(urlWithCredentials);
}
d->m_frame = static_cast<FrameLoaderClientQt*>(frame->loader()->client())->webFrame();
d->m_job = new QNetworkReplyHandler(&handle, QNetworkReplyHandler::LoadNormal);
syncLoader.waitForCompletion();
error = syncLoader.resourceError();
data = syncLoader.data();
response = syncLoader.resourceResponse();
}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.vendor,代码行数:22,代码来源:ResourceHandleQt.cpp
注:本文中的WebCoreSynchronousLoader类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论