本文整理汇总了C++中SecurityOrigin::equal方法的典型用法代码示例。如果您正苦于以下问题:C++ SecurityOrigin::equal方法的具体用法?C++ SecurityOrigin::equal怎么用?C++ SecurityOrigin::equal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SecurityOrigin
的用法示例。
在下文中一共展示了SecurityOrigin::equal方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tryToReclaimDatabaseQuota
static unsigned long long tryToReclaimDatabaseQuota(SecurityOrigin* originNeedingQuota) {
DatabaseTracker& tracker = WebCore::DatabaseTracker::tracker();
Vector<RefPtr<SecurityOrigin> > origins;
tracker.origins(origins);
unsigned long long reclaimedQuotaBytes = 0;
for (unsigned i = 0; i < origins.size(); i++) {
SecurityOrigin* originToReclaimFrom = origins[i].get();
// Don't try to reclaim from the origin that has exceeded its quota.
if (originToReclaimFrom->equal(originNeedingQuota))
continue;
unsigned long long originUsage = tracker.usageForOrigin(originToReclaimFrom);
unsigned long long originQuota = tracker.quotaForOrigin(originToReclaimFrom);
// If the origin has a quota that is more than it's current usage +1MB, shrink it.
static const int ONE_MB = 1 * 1024 * 1024;
if (originUsage + ONE_MB < originQuota) {
unsigned long long newQuota = originUsage + ONE_MB;
tracker.setQuota(originToReclaimFrom, newQuota);
reclaimedQuotaBytes += originQuota - newQuota;
}
}
return reclaimedQuotaBytes;
}