本文整理汇总了C++中CookieMap::takePrevious方法的典型用法代码示例。如果您正苦于以下问题:C++ CookieMap::takePrevious方法的具体用法?C++ CookieMap::takePrevious怎么用?C++ CookieMap::takePrevious使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CookieMap
的用法示例。
在下文中一共展示了CookieMap::takePrevious方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: checkAndTreatCookie
void CookieManager::checkAndTreatCookie(ParsedCookie* cookie)
{
ASSERT(cookie->domain().length());
CookieMap* curMap = m_managerMap.get(cookie->domain());
// Check for cookie to remove in case it is not a session cookie and it has expired.
if (cookie->hasExpired()) {
// The cookie has expired so check we have a valid HashMap so try delete it.
if (curMap) {
// Check if we have a cookie to remove and update information accordingly.
ParsedCookie* prevCookie = curMap->takePrevious(cookie);
if (prevCookie) {
cookieBackingStore().remove(cookie);
removedCookie();
delete cookie;
}
}
} else {
if (!curMap) {
curMap = new CookieMap();
m_managerMap.add(cookie->domain(), curMap);
addCookieToMap(curMap, cookie);
} else {
// Check if there is a previous cookie.
ParsedCookie* prevCookie = curMap->takePrevious(cookie);
if (prevCookie) {
update(curMap, prevCookie, cookie);
delete prevCookie;
} else
addCookieToMap(curMap, cookie);
}
}
}