本文整理汇总了C++中ApplicationCacheHost::applicationCacheInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ ApplicationCacheHost::applicationCacheInfo方法的具体用法?C++ ApplicationCacheHost::applicationCacheInfo怎么用?C++ ApplicationCacheHost::applicationCacheInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ApplicationCacheHost
的用法示例。
在下文中一共展示了ApplicationCacheHost::applicationCacheInfo方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getFramesWithManifests
void InspectorApplicationCacheAgent::getFramesWithManifests(
ErrorString*,
std::unique_ptr<
protocol::Array<protocol::ApplicationCache::FrameWithManifest>>*
result) {
*result =
protocol::Array<protocol::ApplicationCache::FrameWithManifest>::create();
for (LocalFrame* frame : *m_inspectedFrames) {
DocumentLoader* documentLoader = frame->loader().documentLoader();
if (!documentLoader)
return;
ApplicationCacheHost* host = documentLoader->applicationCacheHost();
ApplicationCacheHost::CacheInfo info = host->applicationCacheInfo();
String manifestURL = info.m_manifest.getString();
if (!manifestURL.isEmpty()) {
std::unique_ptr<protocol::ApplicationCache::FrameWithManifest> value =
protocol::ApplicationCache::FrameWithManifest::create()
.setFrameId(IdentifiersFactory::frameId(frame))
.setManifestURL(manifestURL)
.setStatus(static_cast<int>(host->getStatus()))
.build();
(*result)->addItem(std::move(value));
}
}
}
示例2: getApplicationCaches
void InspectorApplicationCacheAgent::getApplicationCaches(ErrorString*, RefPtr<InspectorObject>* applicationCaches)
{
DocumentLoader* documentLoader = m_inspectedPage->mainFrame()->loader()->documentLoader();
if (!documentLoader)
return;
ApplicationCacheHost* host = documentLoader->applicationCacheHost();
ApplicationCacheHost::CacheInfo info = host->applicationCacheInfo();
ApplicationCacheHost::ResourceInfoList resources;
host->fillResourceList(&resources);
*applicationCaches = buildObjectForApplicationCache(resources, info);
}
示例3: updateApplicationCacheStatus
void InspectorApplicationCacheAgent::updateApplicationCacheStatus(LocalFrame* frame)
{
DocumentLoader* documentLoader = frame->loader().documentLoader();
if (!documentLoader)
return;
ApplicationCacheHost* host = documentLoader->applicationCacheHost();
ApplicationCacheHost::Status status = host->status();
ApplicationCacheHost::CacheInfo info = host->applicationCacheInfo();
String manifestURL = info.m_manifest.string();
m_frontend->applicationCacheStatusUpdated(m_pageAgent->frameId(frame), manifestURL, static_cast<int>(status));
}
示例4: getApplicationCacheForFrame
void InspectorApplicationCacheAgent::getApplicationCacheForFrame(ErrorString* errorString, const String& frameId, RefPtr<TypeBuilder::ApplicationCache::ApplicationCache>& applicationCache)
{
DocumentLoader* documentLoader = assertFrameWithDocumentLoader(errorString, frameId);
if (!documentLoader)
return;
ApplicationCacheHost* host = documentLoader->applicationCacheHost();
ApplicationCacheHost::CacheInfo info = host->applicationCacheInfo();
ApplicationCacheHost::ResourceInfoList resources;
host->fillResourceList(&resources);
applicationCache = buildObjectForApplicationCache(resources, info);
}
示例5: updateApplicationCacheStatus
void InspectorApplicationCacheAgent::updateApplicationCacheStatus(LocalFrame* frame)
{
DocumentLoader* documentLoader = frame->loader().documentLoader();
if (!documentLoader)
return;
ApplicationCacheHost* host = documentLoader->applicationCacheHost();
ApplicationCacheHost::Status status = host->getStatus();
ApplicationCacheHost::CacheInfo info = host->applicationCacheInfo();
String manifestURL = info.m_manifest.getString();
String frameId = IdentifiersFactory::frameId(frame);
frontend()->applicationCacheStatusUpdated(frameId, manifestURL, static_cast<int>(status));
}
示例6: getApplicationCacheForFrame
Response InspectorApplicationCacheAgent::getApplicationCacheForFrame(
const String& frameId,
std::unique_ptr<protocol::ApplicationCache::ApplicationCache>*
applicationCache) {
DocumentLoader* documentLoader = nullptr;
Response response = assertFrameWithDocumentLoader(frameId, documentLoader);
if (!response.isSuccess())
return response;
ApplicationCacheHost* host = documentLoader->applicationCacheHost();
ApplicationCacheHost::CacheInfo info = host->applicationCacheInfo();
ApplicationCacheHost::ResourceInfoList resources;
host->fillResourceList(&resources);
*applicationCache = buildObjectForApplicationCache(resources, info);
return Response::OK();
}
示例7: getFramesWithManifests
void InspectorApplicationCacheAgent::getFramesWithManifests(ErrorString*, RefPtr<TypeBuilder::Array<TypeBuilder::ApplicationCache::FrameWithManifest> >& result)
{
result = TypeBuilder::Array<TypeBuilder::ApplicationCache::FrameWithManifest>::create();
for (LocalFrame* frame : *m_inspectedFrames) {
DocumentLoader* documentLoader = frame->loader().documentLoader();
if (!documentLoader)
return;
ApplicationCacheHost* host = documentLoader->applicationCacheHost();
ApplicationCacheHost::CacheInfo info = host->applicationCacheInfo();
String manifestURL = info.m_manifest.string();
if (!manifestURL.isEmpty()) {
RefPtr<TypeBuilder::ApplicationCache::FrameWithManifest> value = TypeBuilder::ApplicationCache::FrameWithManifest::create()
.setFrameId(IdentifiersFactory::frameId(frame))
.setManifestURL(manifestURL)
.setStatus(static_cast<int>(host->status()));
result->addItem(value);
}
}
}
示例8: getFramesWithManifests
void InspectorApplicationCacheAgent::getFramesWithManifests(ErrorString*, RefPtr<TypeBuilder::Array<TypeBuilder::ApplicationCache::FrameWithManifest>>& result)
{
result = TypeBuilder::Array<TypeBuilder::ApplicationCache::FrameWithManifest>::create();
Frame* mainFrame = m_pageAgent->mainFrame();
for (Frame* frame = mainFrame; frame; frame = frame->tree().traverseNext(mainFrame)) {
DocumentLoader* documentLoader = frame->loader().documentLoader();
if (!documentLoader)
continue;
ApplicationCacheHost* host = documentLoader->applicationCacheHost();
ApplicationCacheHost::CacheInfo info = host->applicationCacheInfo();
String manifestURL = info.m_manifest.string();
if (!manifestURL.isEmpty()) {
RefPtr<TypeBuilder::ApplicationCache::FrameWithManifest> value = TypeBuilder::ApplicationCache::FrameWithManifest::create()
.setFrameId(m_pageAgent->frameId(frame))
.setManifestURL(manifestURL)
.setStatus(static_cast<int>(host->status()));
result->addItem(value);
}
}
}