本文整理汇总了C++中ParsedCookie::forceExpire方法的典型用法代码示例。如果您正苦于以下问题:C++ ParsedCookie::forceExpire方法的具体用法?C++ ParsedCookie::forceExpire怎么用?C++ ParsedCookie::forceExpire使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParsedCookie
的用法示例。
在下文中一共展示了ParsedCookie::forceExpire方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeCookieWithName
void CookieManager::removeCookieWithName(const KURL& url, const String& cookieName)
{
// Dispatch the message because the database cookies are not loaded in memory yet.
if (!m_syncedWithDatabase && !m_privateMode) {
typedef void (WebCore::CookieManager::*FunctionType)(const KURL&, const String&);
BlackBerry::Platform::webKitThreadMessageClient()->dispatchMessage(
BlackBerry::Platform::createMethodCallMessage<FunctionType, CookieManager, const KURL, const String>(
&CookieManager::removeCookieWithName, this, url, cookieName));
return;
}
// We get all cookies from all domains that domain matches the request domain
// and delete any cookies with the specified name that path matches the request path
Vector<ParsedCookie*> results;
getRawCookies(results, url, WithHttpOnlyCookies);
// Delete the cookies that path matches the request path
for (size_t i = 0; i < results.size(); i++) {
ParsedCookie* cookie = results[i];
if (!equalIgnoringCase(cookie->name(), cookieName))
continue;
if (url.path().startsWith(cookie->path(), false)) {
cookie->forceExpire();
checkAndTreatCookie(cookie, RemoveFromBackingStore);
}
}
}
示例2: cookieLimitCleanUp
void CookieManager::cookieLimitCleanUp(Timer<CookieManager>* timer)
{
ASSERT_UNUSED(timer, timer == &m_limitTimer);
CookieLimitLog("CookieManager - Starting cookie clean up");
size_t numberOfCookiesOverLimit = (m_count > s_globalMaxCookieCount) ? m_count - s_globalMaxCookieCount : 0;
size_t amountToDelete = s_cookiesToDeleteWhenLimitReached + numberOfCookiesOverLimit;
CookieLimitLog("CookieManager - Excess: %d Amount to Delete: %d", numberOfCookiesOverLimit, amountToDelete);
// Call the database to delete 'amountToDelete' of cookies
Vector<ParsedCookie*> cookiesToDelete;
cookiesToDelete.reserveInitialCapacity(amountToDelete);
CookieLimitLog("CookieManager - Calling database to clean up");
m_cookieBackingStore->getCookiesFromDatabase(cookiesToDelete, amountToDelete);
// Cookies are ordered in ASC order by lastAccessed
for (size_t i = 0; i < amountToDelete; ++i) {
// Expire them and call checkandtreat to delete them from memory and database
ParsedCookie* newCookie = cookiesToDelete[i];
CookieLimitLog("CookieManager - Expire cookie: %s and delete", newCookie->toString().utf8().data());
newCookie->forceExpire();
checkAndTreatCookie(newCookie, RemoveFromBackingStore);
}
CookieLimitLog("CookieManager - Cookie clean up complete.");
}