本文整理汇总了C++中ParsedCookie::creationTime方法的典型用法代码示例。如果您正苦于以下问题:C++ ParsedCookie::creationTime方法的具体用法?C++ ParsedCookie::creationTime怎么用?C++ ParsedCookie::creationTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParsedCookie
的用法示例。
在下文中一共展示了ParsedCookie::creationTime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: invokeSendChangesToDatabase
void CookieDatabaseBackingStore::invokeSendChangesToDatabase()
{
ASSERT(isCurrentThread());
if (!m_db.isOpen()) {
LOG_ERROR("Timer Fired, but database is closed.");
return;
}
Vector<CookieAction> changedCookies;
{
MutexLocker lock(m_mutex);
changedCookies.swap(m_changedCookies);
ASSERT(m_changedCookies.isEmpty());
}
if (changedCookies.isEmpty()) {
CookieLog("CookieBackingStore - Timer fired, but no cookies in changelist");
return;
}
CookieLog("CookieBackingStore - Timer fired, sending changes to database. We have %d changes", changedCookies.size());
SQLiteTransaction transaction(m_db, false);
transaction.begin();
// Iterate through every element in the change list to make calls
// If error occurs, ignore it and continue to the next statement
size_t sizeOfChange = changedCookies.size();
for (size_t i = 0; i < sizeOfChange; i++) {
SQLiteStatement* m_statement;
const ParsedCookie cookie = changedCookies[i].first;
UpdateParameter action = changedCookies[i].second;
if (action == Delete) {
m_statement = m_deleteStatement;
CookieLog("CookieBackingStore - deleting cookie %s.", cookie.toString().utf8().data());
// Binds all the values
if (m_statement->bindText(1, cookie.name()) || m_statement->bindText(2, cookie.domain())
|| m_statement->bindText(3, cookie.path()) || m_statement->bindText(4, cookie.protocol())) {
LOG_ERROR("Cannot bind cookie data to delete");
LOG_ERROR("SQLite Error Message: %s", m_db.lastErrorMsg());
ASSERT_NOT_REACHED();
continue;
}
} else {
if (action == Update) {
CookieLog("CookieBackingStore - updating cookie %s.", cookie.toString().utf8().data());
m_statement = m_updateStatement;
} else {
CookieLog("CookieBackingStore - inserting cookie %s.", cookie.toString().utf8().data());
m_statement = m_insertStatement;
}
// Binds all the values
if (m_statement->bindText(1, cookie.name()) || m_statement->bindText(2, cookie.value())
|| m_statement->bindText(3, cookie.domain()) || m_statement->bindText(4, cookie.path())
|| m_statement->bindDouble(5, cookie.expiry()) || m_statement->bindDouble(6, cookie.lastAccessed())
|| m_statement->bindInt64(7, cookie.isSecure()) || m_statement->bindInt64(8, cookie.isHttpOnly())
|| m_statement->bindDouble(9, cookie.creationTime()) || m_statement->bindText(10, cookie.protocol())) {
LOG_ERROR("Cannot bind cookie data to save");
LOG_ERROR("SQLite Error Message: %s", m_db.lastErrorMsg());
ASSERT_NOT_REACHED();
continue;
}
}
int rc = m_statement->step();
m_statement->reset();
if (rc != SQLResultOk && rc != SQLResultDone) {
LOG_ERROR("Cannot make call to the database");
LOG_ERROR("SQLite Error Message: %s", m_db.lastErrorMsg());
ASSERT_NOT_REACHED();
continue;
}
}
transaction.commit();
CookieLog("CookieBackingStore - transaction complete");
}