本文整理汇总了C++中ApplicationCacheHost类的典型用法代码示例。如果您正苦于以下问题:C++ ApplicationCacheHost类的具体用法?C++ ApplicationCacheHost怎么用?C++ ApplicationCacheHost使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ApplicationCacheHost类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: recordAPIUseType
void ApplicationCache::swapCache(ExceptionState& exceptionState)
{
recordAPIUseType();
ApplicationCacheHost* cacheHost = applicationCacheHost();
if (!cacheHost || !cacheHost->swapCache())
exceptionState.throwDOMException(InvalidStateError, "there is no newer application cache to swap to.");
}
示例2: applicationCacheHost
void DOMApplicationCache::disconnectFrame()
{
ApplicationCacheHost* cacheHost = applicationCacheHost();
if (cacheHost)
cacheHost->setDOMApplicationCache(0);
DOMWindowProperty::disconnectFrame();
}
示例3: applicationCacheHost
unsigned short ApplicationCache::status() const
{
ApplicationCacheHost* cacheHost = applicationCacheHost();
if (!cacheHost)
return ApplicationCacheHost::UNCACHED;
return cacheHost->status();
}
示例4: 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));
}
}
}
示例5: DOMWindowProperty
ApplicationCache::ApplicationCache(LocalFrame* frame)
: DOMWindowProperty(frame)
{
ApplicationCacheHost* cacheHost = applicationCacheHost();
if (cacheHost)
cacheHost->setApplicationCache(this);
}
示例6: DOMWindowProperty
ApplicationCache::ApplicationCache(LocalFrame* frame)
: DOMWindowProperty(frame)
{
ScriptWrappable::init(this);
ApplicationCacheHost* cacheHost = applicationCacheHost();
if (cacheHost)
cacheHost->setApplicationCache(this);
}
示例7: 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);
}
示例8: 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));
}
示例9: assertFrameWithDocumentLoader
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);
}
示例10: 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));
}
示例11: assertFrameWithDocumentLoader
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();
}
示例12: 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);
}
}
}
示例13: LOG
void MediaPlayerPrivateAVFoundation::prepareToPlay()
{
LOG(Media, "MediaPlayerPrivateAVFoundation::prepareToPlay(%p)", this);
m_preload = MediaPlayer::Auto;
if (m_havePreparedToPlay)
return;
m_havePreparedToPlay = true;
m_delayingLoad = false;
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
Frame* frame = m_player->frameView() ? m_player->frameView()->frame() : 0;
ApplicationCacheHost* cacheHost = frame ? frame->loader()->documentLoader()->applicationCacheHost() : 0;
ApplicationCacheResource* resource = 0;
if (cacheHost && cacheHost->shouldLoadResourceFromApplicationCache(ResourceRequest(m_assetURL), resource) && resource)
createAVPlayerForCacheResource(resource);
else
#endif
createAVPlayerForURL(m_assetURL);
checkPlayability();
}
示例14: 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);
}
}
}
示例15: disableComponentsOnce
void MediaPlayerPrivateQuickTimeVisualContext::loadInternal(const String& url)
{
if (!QTMovie::initializeQuickTime()) {
// FIXME: is this the right error to return?
m_networkState = MediaPlayer::DecodeError;
m_player->networkStateChanged();
return;
}
disableComponentsOnce();
// Initialize the task timer.
MediaPlayerPrivateTaskTimer::initialize();
if (m_networkState != MediaPlayer::Loading) {
m_networkState = MediaPlayer::Loading;
m_player->networkStateChanged();
}
if (m_readyState != MediaPlayer::HaveNothing) {
m_readyState = MediaPlayer::HaveNothing;
m_player->readyStateChanged();
}
cancelSeek();
setUpCookiesForQuickTime(url);
m_movie = adoptRef(new QTMovie(m_movieClient.get()));
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
Frame* frame = m_player->frameView() ? m_player->frameView()->frame() : 0;
ApplicationCacheHost* cacheHost = frame ? frame->loader()->documentLoader()->applicationCacheHost() : 0;
ApplicationCacheResource* resource = 0;
if (cacheHost && cacheHost->shouldLoadResourceFromApplicationCache(ResourceRequest(url), resource) && resource && !resource->path().isEmpty())
m_movie->load(resource->path().characters(), resource->path().length(), m_player->preservesPitch());
else
#endif
m_movie->load(url.characters(), url.length(), m_player->preservesPitch());
m_movie->setVolume(m_player->volume());
}
开发者ID:0omega,项目名称:platform_external_webkit,代码行数:39,代码来源:MediaPlayerPrivateQuickTimeVisualContext.cpp