|
Lines 1758-1777
void IconDatabase::deleteAllPreparedStatements()
a/Source/WebCore/loader/icon/IconDatabase.cpp_sec1
|
| 1758 |
{ |
1758 |
{ |
| 1759 |
ASSERT_ICON_SYNC_THREAD(); |
1759 |
ASSERT_ICON_SYNC_THREAD(); |
| 1760 |
|
1760 |
|
| 1761 |
m_setIconIDForPageURLStatement.clear(); |
1761 |
m_setIconIDForPageURLStatement = nullptr; |
| 1762 |
m_removePageURLStatement.clear(); |
1762 |
m_removePageURLStatement = nullptr; |
| 1763 |
m_getIconIDForIconURLStatement.clear(); |
1763 |
m_getIconIDForIconURLStatement = nullptr; |
| 1764 |
m_getImageDataForIconURLStatement.clear(); |
1764 |
m_getImageDataForIconURLStatement = nullptr; |
| 1765 |
m_addIconToIconInfoStatement.clear(); |
1765 |
m_addIconToIconInfoStatement = nullptr; |
| 1766 |
m_addIconToIconDataStatement.clear(); |
1766 |
m_addIconToIconDataStatement = nullptr; |
| 1767 |
m_getImageDataStatement.clear(); |
1767 |
m_getImageDataStatement = nullptr; |
| 1768 |
m_deletePageURLsForIconURLStatement.clear(); |
1768 |
m_deletePageURLsForIconURLStatement = nullptr; |
| 1769 |
m_deleteIconFromIconInfoStatement.clear(); |
1769 |
m_deleteIconFromIconInfoStatement = nullptr; |
| 1770 |
m_deleteIconFromIconDataStatement.clear(); |
1770 |
m_deleteIconFromIconDataStatement = nullptr; |
| 1771 |
m_updateIconInfoStatement.clear(); |
1771 |
m_updateIconInfoStatement = nullptr; |
| 1772 |
m_updateIconDataStatement.clear(); |
1772 |
m_updateIconDataStatement = nullptr; |
| 1773 |
m_setIconInfoStatement.clear(); |
1773 |
m_setIconInfoStatement = nullptr; |
| 1774 |
m_setIconDataStatement.clear(); |
1774 |
m_setIconDataStatement = nullptr; |
| 1775 |
} |
1775 |
} |
| 1776 |
|
1776 |
|
| 1777 |
void* IconDatabase::cleanupSyncThread() |
1777 |
void* IconDatabase::cleanupSyncThread() |
|
Lines 1810-1824
void* IconDatabase::cleanupSyncThread()
a/Source/WebCore/loader/icon/IconDatabase.cpp_sec2
|
| 1810 |
// 1 - If the SQLDatabase& argument is different, the statement must be destroyed and remade. This happens when the user |
1810 |
// 1 - If the SQLDatabase& argument is different, the statement must be destroyed and remade. This happens when the user |
| 1811 |
// switches to and from private browsing |
1811 |
// switches to and from private browsing |
| 1812 |
// 2 - Lazy construction of the Statement in the first place, in case we've never made this query before |
1812 |
// 2 - Lazy construction of the Statement in the first place, in case we've never made this query before |
| 1813 |
inline void readySQLiteStatement(OwnPtr<SQLiteStatement>& statement, SQLiteDatabase& db, const String& str) |
1813 |
inline void readySQLiteStatement(std::unique_ptr<SQLiteStatement>& statement, SQLiteDatabase& db, const String& str) |
| 1814 |
{ |
1814 |
{ |
| 1815 |
if (statement && (statement->database() != &db || statement->isExpired())) { |
1815 |
if (statement && (statement->database() != &db || statement->isExpired())) { |
| 1816 |
if (statement->isExpired()) |
1816 |
if (statement->isExpired()) |
| 1817 |
LOG(IconDatabase, "SQLiteStatement associated with %s is expired", str.ascii().data()); |
1817 |
LOG(IconDatabase, "SQLiteStatement associated with %s is expired", str.ascii().data()); |
| 1818 |
statement.clear(); |
1818 |
statement = nullptr; |
| 1819 |
} |
1819 |
} |
| 1820 |
if (!statement) { |
1820 |
if (!statement) { |
| 1821 |
statement = adoptPtr(new SQLiteStatement(db, str)); |
1821 |
statement = std::make_unique<SQLiteStatement>(db, str); |
| 1822 |
if (statement->prepare() != SQLResultOk) |
1822 |
if (statement->prepare() != SQLResultOk) |
| 1823 |
LOG_ERROR("Preparing statement %s failed", str.ascii().data()); |
1823 |
LOG_ERROR("Preparing statement %s failed", str.ascii().data()); |
| 1824 |
} |
1824 |
} |