本文整理汇总了C++中DatabaseDetails::expectedUsage方法的典型用法代码示例。如果您正苦于以下问题:C++ DatabaseDetails::expectedUsage方法的具体用法?C++ DatabaseDetails::expectedUsage怎么用?C++ DatabaseDetails::expectedUsage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DatabaseDetails
的用法示例。
在下文中一共展示了DatabaseDetails::expectedUsage方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: exceededDatabaseQuota
void ChromeClientBlackBerry::exceededDatabaseQuota(Frame* frame, const String& name)
{
#if ENABLE(SQL_DATABASE)
Document* document = frame->document();
if (!document)
return;
SecurityOrigin* origin = document->securityOrigin();
#if ENABLE_DRT
if (m_webPagePrivate->m_dumpRenderTree) {
m_webPagePrivate->m_dumpRenderTree->exceededDatabaseQuota(origin, name);
return;
}
#endif
DatabaseTracker& tracker = DatabaseTracker::tracker();
unsigned long long totalUsage = tracker.totalDatabaseUsage();
unsigned long long originUsage = tracker.usageForOrigin(origin);
DatabaseDetails details = tracker.detailsForNameAndOrigin(name, origin);
unsigned long long estimatedSize = details.expectedUsage();
const String& nameStr = details.displayName();
String originStr = origin->databaseIdentifier();
unsigned long long quota = m_webPagePrivate->m_client->databaseQuota(originStr.characters(), originStr.length(),
nameStr.characters(), nameStr.length(), totalUsage, originUsage, estimatedSize);
tracker.setQuota(origin, quota);
#endif
}
示例2:
void ArgumentCoder<DatabaseDetails>::encode(ArgumentEncoder& encoder, const DatabaseDetails& details)
{
encoder << details.name();
encoder << details.displayName();
encoder << details.expectedUsage();
encoder << details.currentUsage();
}
示例3: expectedSize
/*!
Returns the expected size of the database in bytes as defined by the web author.
*/
qint64 QWebDatabase::expectedSize() const
{
#if ENABLE(DATABASE)
DatabaseDetails details = DatabaseTracker::tracker().detailsForNameAndOrigin(d->name, d->origin.get());
return details.expectedUsage();
#else
return 0;
#endif
}
示例4: exceededDatabaseQuota
void ChromeClientEfl::exceededDatabaseQuota(Frame* frame, const String& databaseName, DatabaseDetails details)
{
uint64_t quota;
SecurityOrigin* origin = frame->document()->securityOrigin();
quota = ewk_view_exceeded_database_quota(m_view,
kit(frame), databaseName.utf8().data(),
details.currentUsage(), details.expectedUsage());
/* if client did not set quota, and database is being created now, the
* default quota is applied
*/
if (!quota && !DatabaseManager::manager().hasEntryForOrigin(origin))
quota = ewk_settings_web_database_default_quota_get();
DatabaseManager::manager().setQuota(origin, quota);
}
示例5: exceededDatabaseQuota
void WebChromeClient::exceededDatabaseQuota(Frame* frame, const String& databaseName, DatabaseDetails details)
{
WebFrame* webFrame = WebFrame::fromCoreFrame(*frame);
ASSERT(webFrame);
SecurityOrigin* origin = frame->document()->securityOrigin();
DatabaseManager& dbManager = DatabaseManager::singleton();
uint64_t currentQuota = dbManager.quotaForOrigin(origin);
uint64_t currentOriginUsage = dbManager.usageForOrigin(origin);
uint64_t newQuota = 0;
RefPtr<API::SecurityOrigin> securityOrigin = API::SecurityOrigin::create(WebCore::SecurityOrigin::createFromDatabaseIdentifier(origin->databaseIdentifier()));
newQuota = m_page->injectedBundleUIClient().didExceedDatabaseQuota(m_page, securityOrigin.get(), databaseName, details.displayName(), currentQuota, currentOriginUsage, details.currentUsage(), details.expectedUsage());
if (!newQuota) {
WebProcess::singleton().parentProcessConnection()->sendSync(
Messages::WebPageProxy::ExceededDatabaseQuota(webFrame->frameID(), origin->databaseIdentifier(), databaseName, details.displayName(), currentQuota, currentOriginUsage, details.currentUsage(), details.expectedUsage()),
Messages::WebPageProxy::ExceededDatabaseQuota::Reply(newQuota), m_page->pageID(), std::chrono::milliseconds::max(), IPC::SendSyncOption::InformPlatformProcessWillSuspend);
}
dbManager.setQuota(origin, newQuota);
}
示例6: exceededDatabaseQuota
void WebChromeClient::exceededDatabaseQuota(Frame* frame, const String& databaseName, DatabaseDetails details)
{
WebFrame* webFrame = WebFrame::fromCoreFrame(*frame);
ASSERT(webFrame);
SecurityOrigin* origin = frame->document()->securityOrigin();
DatabaseManager& dbManager = DatabaseManager::manager();
uint64_t currentQuota = dbManager.quotaForOrigin(origin);
uint64_t currentOriginUsage = dbManager.usageForOrigin(origin);
uint64_t newQuota = 0;
RefPtr<WebSecurityOrigin> webSecurityOrigin = WebSecurityOrigin::createFromDatabaseIdentifier(origin->databaseIdentifier());
newQuota = m_page->injectedBundleUIClient().didExceedDatabaseQuota(m_page, webSecurityOrigin.get(), databaseName, details.displayName(), currentQuota, currentOriginUsage, details.currentUsage(), details.expectedUsage());
if (!newQuota) {
unsigned syncSendFlags = IPC::InformPlatformProcessWillSuspend;
if (WebPage::synchronousMessagesShouldSpinRunLoop())
syncSendFlags |= IPC::SpinRunLoopWhileWaitingForReply;
WebProcess::shared().parentProcessConnection()->sendSync(
Messages::WebPageProxy::ExceededDatabaseQuota(webFrame->frameID(), origin->databaseIdentifier(), databaseName, details.displayName(), currentQuota, currentOriginUsage, details.currentUsage(), details.expectedUsage()),
Messages::WebPageProxy::ExceededDatabaseQuota::Reply(newQuota), m_page->pageID(), std::chrono::milliseconds::max(), syncSendFlags);
}
dbManager.setQuota(origin, newQuota);
}
示例7: expectedSize
/*!
Returns the expected size of the database in bytes as defined by the web author.
*/
qint64 QWebDatabase::expectedSize() const
{
DatabaseDetails details = DatabaseTracker::tracker().detailsForNameAndOrigin(d->name, d->origin.get());
return details.expectedUsage();
}