本文整理汇总了C++中iconDatabase函数的典型用法代码示例。如果您正苦于以下问题:C++ iconDatabase函数的具体用法?C++ iconDatabase怎么用?C++ iconDatabase使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了iconDatabase函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ASSERT
HistoryItem::~HistoryItem()
{
ASSERT(!m_cachedPage);
ASSERT(!m_document);
iconDatabase()->releaseIconForPageURL(m_urlString);
#if PLATFORM(ANDROID)
if (m_bridge)
m_bridge->detachHistoryItem();
#endif
}
开发者ID:flying-dutchmen,项目名称:3DS_w3Browser,代码行数:10,代码来源:HistoryItem.cpp
示例2: ASSERT
void IconController::continueLoadWithDecision(IconLoadDecision iconLoadDecision)
{
ASSERT(iconLoadDecision != IconLoadUnknown);
// FIXME (<rdar://problem/9168605>) - We should support in-memory-only private browsing icons in asynchronous icon database mode.
if (iconDatabase().supportsAsynchronousMode() && m_frame->page()->settings()->privateBrowsingEnabled())
return;
if (iconLoadDecision == IconLoadNo) {
KURL iconURL(url());
String urlString(iconURL.string());
if (urlString.isEmpty())
return;
LOG(IconDatabase, "IconController::startLoader() - Told not to load this icon, committing iconURL %s to database for pageURL mapping", urlString.ascii().data());
commitToDatabase(iconURL);
if (iconDatabase().supportsAsynchronousMode()) {
m_frame->loader()->documentLoader()->getIconDataForIconURL(urlString);
return;
}
// We were told not to load this icon - that means this icon is already known by the database
// If the icon data hasn't been read in from disk yet, kick off the read of the icon from the database to make sure someone
// has done it. This is after registering for the notification so the WebView can call the appropriate delegate method.
// Otherwise if the icon data *is* available, notify the delegate
if (!iconDatabase().synchronousIconDataKnownForIconURL(urlString)) {
LOG(IconDatabase, "Told not to load icon %s but icon data is not yet available - registering for notification and requesting load from disk", urlString.ascii().data());
m_frame->loader()->client()->registerForIconNotification();
iconDatabase().synchronousIconForPageURL(m_frame->document()->url().string(), IntSize(0, 0));
iconDatabase().synchronousIconForPageURL(m_frame->loader()->initialRequest().url().string(), IntSize(0, 0));
} else
m_frame->loader()->client()->dispatchDidReceiveIcon();
return;
}
if (!m_iconLoader)
m_iconLoader = IconLoader::create(m_frame);
m_iconLoader->startLoading();
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:42,代码来源:IconController.cpp
示例3: m_urlString
HistoryItem::HistoryItem(const String& urlString, const String& title, double time)
: m_urlString(urlString)
, m_originalURLString(urlString)
, m_title(title)
, m_lastVisitedTime(time)
, m_isInPageCache(false)
, m_isTargetItem(false)
, m_visitCount(0)
{
iconDatabase()->retainIconForPageURL(m_urlString);
}
开发者ID:Chingliu,项目名称:EAWebkit,代码行数:11,代码来源:HistoryItem.cpp
示例4: m_urlString
HistoryItem::HistoryItem(const String& urlString, const String& title, double time)
: m_urlString(urlString)
, m_originalURLString(urlString)
, m_title(title)
, m_lastVisitedTime(time)
, m_lastVisitWasHTTPNonGet(false)
, m_lastVisitWasFailure(false)
, m_isTargetItem(false)
, m_visitCount(0)
, m_documentSequenceNumber(generateDocumentSequenceNumber())
{
iconDatabase()->retainIconForPageURL(m_urlString);
}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:13,代码来源:HistoryItem.cpp
示例5: m_urlString
HistoryItem::HistoryItem(const String& urlString, const String& title)
: m_urlString(urlString)
, m_originalURLString(urlString)
, m_title(title)
, m_pageScaleFactor(0)
, m_lastVisitWasFailure(false)
, m_isTargetItem(false)
, m_itemSequenceNumber(generateSequenceNumber())
, m_documentSequenceNumber(generateSequenceNumber())
, m_pruningReason(PruningReason::None)
{
iconDatabase().retainIconForPageURL(m_urlString);
}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:13,代码来源:HistoryItem.cpp
示例6: iconDatabase
void IconLoader::finishLoading(const KURL& iconURL, PassRefPtr<SharedBuffer> data)
{
// When an icon load results in a 404 we commit it to the database here and clear the loading state.
// But the SubresourceLoader continues pulling in data in the background for the 404 page if the server sends one.
// Once that data finishes loading or if the load is cancelled while that data is being read, finishLoading ends up being called a second time.
// We need to change SubresourceLoader to have a mode where it will stop itself after receiving a 404 so this won't happen -
// in the meantime, we'll only commit this data to the IconDatabase if it's the first time ::finishLoading() is called
// <rdar://problem/5463392> tracks that enhancement
if (!iconURL.isEmpty() && m_loadIsInProgress) {
iconDatabase()->setIconDataForIconURL(data, iconURL.string());
LOG(IconDatabase, "IconLoader::finishLoading() - Committing iconURL %s to database", iconURL.string().ascii().data());
m_frame->loader()->commitIconURLToIconDatabase(iconURL);
m_frame->loader()->client()->dispatchDidReceiveIcon();
}
clearLoadingState();
}
开发者ID:Fale,项目名称:qtmoko,代码行数:18,代码来源:IconLoader.cpp
示例7: m_urlString
HistoryItem::HistoryItem(const String& urlString, const String& title, const String& alternateTitle)
: m_urlString(urlString)
, m_originalURLString(urlString)
, m_title(title)
, m_displayTitle(alternateTitle)
, m_pageScaleFactor(0)
, m_lastVisitWasFailure(false)
, m_isTargetItem(false)
, m_itemSequenceNumber(generateSequenceNumber())
, m_documentSequenceNumber(generateSequenceNumber())
, m_pruningReason(PruningReason::None)
#if PLATFORM(IOS)
, m_scale(0)
, m_scaleIsInitial(false)
, m_bookmarkID(0)
#endif
{
iconDatabase().retainIconForPageURL(m_urlString);
}
开发者ID:rhythmkay,项目名称:webkit,代码行数:19,代码来源:HistoryItem.cpp
示例8: ASSERT
void IconLoader::notifyFinished(CachedResource* resource)
{
ASSERT(resource == m_resource);
// If we got a status code indicating an invalid response, then lets
// ignore the data and not try to decode the error page as an icon.
RefPtr<ResourceBuffer> data = resource->resourceBuffer();
int status = resource->response().httpStatusCode();
if (status && (status < 200 || status > 299))
data = 0;
LOG(IconDatabase, "IconLoader::finishLoading() - Committing iconURL %s to database", resource->url().string().ascii().data());
m_frame->loader()->icon()->commitToDatabase(resource->url());
// Setting the icon data only after committing to the database ensures that the data is
// kept in memory (so it does not have to be read from the database asynchronously), since
// there is a page URL referencing it.
iconDatabase().setIconDataForIconURL(data ? data->sharedBuffer() : 0, resource->url().string());
m_frame->loader()->client()->dispatchDidReceiveIcon();
stopLoading();
}
开发者ID:gobihun,项目名称:webkit,代码行数:20,代码来源:IconLoader.cpp
示例9: m_urlString
HistoryItem::HistoryItem(const URL& url, const String& target, const String& parent, const String& title)
: m_urlString(url.string())
, m_originalURLString(url.string())
, m_target(target)
, m_parent(parent)
, m_title(title)
, m_pageScaleFactor(0)
, m_lastVisitWasFailure(false)
, m_isTargetItem(false)
, m_itemSequenceNumber(generateSequenceNumber())
, m_documentSequenceNumber(generateSequenceNumber())
, m_next(0)
, m_prev(0)
#if PLATFORM(IOS)
, m_scale(0)
, m_scaleIsInitial(false)
, m_bookmarkID(0)
#endif
{
iconDatabase().retainIconForPageURL(m_urlString);
}
开发者ID:PTaylour,项目名称:webkit,代码行数:21,代码来源:HistoryItem.cpp
示例10: m_urlString
HistoryItem::HistoryItem(const String& urlString, const String& title, double time)
: m_urlString(urlString)
, m_originalURLString(urlString)
, m_title(title)
, m_lastVisitedTime(time)
, m_lastVisitWasHTTPNonGet(false)
, m_pageScaleFactor(0)
, m_lastVisitWasFailure(false)
, m_isTargetItem(false)
, m_visitCount(0)
, m_itemSequenceNumber(generateSequenceNumber())
, m_documentSequenceNumber(generateSequenceNumber())
, m_next(0)
, m_prev(0)
#if PLATFORM(IOS)
, m_scale(0)
, m_scaleIsInitial(false)
, m_bookmarkID(0)
#endif
{
iconDatabase().retainIconForPageURL(m_urlString);
}
开发者ID:Happy-Ferret,项目名称:webkit.js,代码行数:22,代码来源:HistoryItem.cpp
示例11: ASSERT
HistoryItem::~HistoryItem()
{
ASSERT(!m_isInPageCache);
iconDatabase()->releaseIconForPageURL(m_urlString);
}
开发者ID:Chingliu,项目名称:EAWebkit,代码行数:5,代码来源:HistoryItem.cpp
示例12: ASSERT
PassRefPtr<LegacyWebArchive> LegacyWebArchive::create(const String& markupString, Frame* frame, const Vector<Node*>& nodes, FrameFilter* frameFilter)
{
ASSERT(frame);
const ResourceResponse& response = frame->loader().documentLoader()->response();
URL responseURL = response.url();
// it's possible to have a response without a URL here
// <rdar://problem/5454935>
if (responseURL.isNull())
responseURL = URL(ParsedURLString, emptyString());
RefPtr<ArchiveResource> mainResource = ArchiveResource::create(utf8Buffer(markupString), responseURL, response.mimeType(), "UTF-8", frame->tree().uniqueName());
Vector<PassRefPtr<LegacyWebArchive>> subframeArchives;
Vector<PassRefPtr<ArchiveResource>> subresources;
HashSet<URL> uniqueSubresources;
size_t nodesSize = nodes.size();
for (size_t i = 0; i < nodesSize; ++i) {
Node& node = *nodes[i];
Frame* childFrame;
if ((isHTMLFrameElement(node) || isHTMLIFrameElement(node) || isHTMLObjectElement(node))
&& (childFrame = toHTMLFrameOwnerElement(node).contentFrame())) {
if (frameFilter && !frameFilter->shouldIncludeSubframe(childFrame))
continue;
RefPtr<LegacyWebArchive> subframeArchive = create(childFrame->document(), frameFilter);
if (subframeArchive)
subframeArchives.append(subframeArchive);
else
LOG_ERROR("Unabled to archive subframe %s", childFrame->tree().uniqueName().string().utf8().data());
} else {
ListHashSet<URL> subresourceURLs;
node.getSubresourceURLs(subresourceURLs);
DocumentLoader* documentLoader = frame->loader().documentLoader();
ListHashSet<URL>::iterator iterEnd = subresourceURLs.end();
for (ListHashSet<URL>::iterator iter = subresourceURLs.begin(); iter != iterEnd; ++iter) {
const URL& subresourceURL = *iter;
if (uniqueSubresources.contains(subresourceURL))
continue;
uniqueSubresources.add(subresourceURL);
RefPtr<ArchiveResource> resource = documentLoader->subresource(subresourceURL);
if (resource) {
subresources.append(resource.release());
continue;
}
ResourceRequest request(subresourceURL);
#if ENABLE(CACHE_PARTITIONING)
request.setCachePartition(frame->document()->topOrigin()->cachePartition());
#endif
CachedResource* cachedResource = memoryCache()->resourceForRequest(request);
if (cachedResource) {
ResourceBuffer* data = cachedResource->resourceBuffer();
resource = ArchiveResource::create(data ? data->sharedBuffer() : 0, subresourceURL, cachedResource->response());
if (resource) {
subresources.append(resource.release());
continue;
}
}
// FIXME: should do something better than spew to console here
LOG_ERROR("Failed to archive subresource for %s", subresourceURL.string().utf8().data());
}
}
}
// Add favicon if one exists for this page, if we are archiving the entire page.
if (nodesSize && nodes[0]->isDocumentNode() && iconDatabase().isEnabled()) {
const String& iconURL = iconDatabase().synchronousIconURLForPageURL(responseURL);
if (!iconURL.isEmpty() && iconDatabase().synchronousIconDataKnownForIconURL(iconURL)) {
if (Image* iconImage = iconDatabase().synchronousIconForPageURL(responseURL, IntSize(16, 16))) {
if (RefPtr<ArchiveResource> resource = ArchiveResource::create(iconImage->data(), URL(ParsedURLString, iconURL), "image/x-icon", "", ""))
subresources.append(resource.release());
}
}
}
return create(mainResource.release(), subresources, subframeArchives);
}
开发者ID:kodybrown,项目名称:webkit,代码行数:85,代码来源:LegacyWebArchive.cpp
示例13: LOG
void IconController::commitToDatabase(const KURL& icon)
{
LOG(IconDatabase, "Committing iconURL %s to database for pageURLs %s and %s", icon.string().ascii().data(), m_frame->document()->url().string().ascii().data(), m_frame->loader()->initialRequest().url().string().ascii().data());
iconDatabase().setIconURLForPageURL(icon.string(), m_frame->document()->url().string());
iconDatabase().setIconURLForPageURL(icon.string(), m_frame->loader()->initialRequest().url().string());
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:6,代码来源:IconController.cpp
示例14: ASSERT
PassRefPtr<LegacyWebArchive> LegacyWebArchive::create(const String& markupString, Frame* frame, const Vector<Node*>& nodes)
{
ASSERT(frame);
const ResourceResponse& response = frame->loader()->documentLoader()->response();
KURL responseURL = response.url();
// it's possible to have a response without a URL here
// <rdar://problem/5454935>
if (responseURL.isNull())
responseURL = KURL(ParsedURLString, "");
PassRefPtr<ArchiveResource> mainResource = ArchiveResource::create(utf8Buffer(markupString), responseURL, response.mimeType(), "UTF-8", frame->tree()->uniqueName());
Vector<PassRefPtr<LegacyWebArchive> > subframeArchives;
Vector<PassRefPtr<ArchiveResource> > subresources;
HashSet<KURL> uniqueSubresources;
size_t nodesSize = nodes.size();
for (size_t i = 0; i < nodesSize; ++i) {
Node* node = nodes[i];
Frame* childFrame;
if ((node->hasTagName(HTMLNames::frameTag) || node->hasTagName(HTMLNames::iframeTag) || node->hasTagName(HTMLNames::objectTag)) &&
(childFrame = static_cast<HTMLFrameOwnerElement*>(node)->contentFrame())) {
RefPtr<LegacyWebArchive> subframeArchive = create(childFrame->document());
if (subframeArchive)
subframeArchives.append(subframeArchive);
else
LOG_ERROR("Unabled to archive subframe %s", childFrame->tree()->uniqueName().string().utf8().data());
} else {
ListHashSet<KURL> subresourceURLs;
node->getSubresourceURLs(subresourceURLs);
DocumentLoader* documentLoader = frame->loader()->documentLoader();
ListHashSet<KURL>::iterator iterEnd = subresourceURLs.end();
for (ListHashSet<KURL>::iterator iter = subresourceURLs.begin(); iter != iterEnd; ++iter) {
const KURL& subresourceURL = *iter;
if (uniqueSubresources.contains(subresourceURL))
continue;
uniqueSubresources.add(subresourceURL);
RefPtr<ArchiveResource> resource = documentLoader->subresource(subresourceURL);
if (resource) {
subresources.append(resource.release());
continue;
}
CachedResource* cachedResource = memoryCache()->resourceForURL(subresourceURL);
if (cachedResource) {
resource = ArchiveResource::create(cachedResource->data(), subresourceURL, cachedResource->response());
if (resource) {
subresources.append(resource.release());
continue;
}
}
// FIXME: should do something better than spew to console here
LOG_ERROR("Failed to archive subresource for %s", subresourceURL.string().utf8().data());
}
}
}
// Add favicon if one exists for this page, if we are archiving the entire page.
if (nodesSize && nodes[0]->isDocumentNode() && iconDatabase().isEnabled()) {
const String& iconURL = iconDatabase().synchronousIconURLForPageURL(responseURL);
if (!iconURL.isEmpty() && iconDatabase().synchronousIconDataKnownForIconURL(iconURL)) {
if (Image* iconImage = iconDatabase().synchronousIconForPageURL(responseURL, IntSize(16, 16))) {
if (RefPtr<ArchiveResource> resource = ArchiveResource::create(iconImage->data(), KURL(ParsedURLString, iconURL), "image/x-icon", "", ""))
subresources.append(resource.release());
}
}
}
return create(mainResource, subresources, subframeArchives);
}
开发者ID:sanyaade-mobiledev,项目名称:Webkit-Projects,代码行数:77,代码来源:LegacyWebArchive.cpp
注:本文中的iconDatabase函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论