Title: [223423] trunk/Source/WebCore
- Revision
- 223423
- Author
- [email protected]
- Date
- 2017-10-16 12:21:07 -0700 (Mon, 16 Oct 2017)
Log Message
We should wrap the removal of information from the tracker database in a transaction in DatabaseTracker::deleteOrigin()
https://bugs.webkit.org/show_bug.cgi?id=178274
<rdar://problem/34576132>
Patch by Maureen Daum <[email protected]> on 2017-10-16
Reviewed by Tim Horton.
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::deleteOrigin):
Wrap the removal of information from the tracker database in a transaction so that
we don't end up in a case where only one of the tables contains information about
an origin.
If anything goes wrong when we're modifying the tracker database, rollback the transaction
before bailing.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (223422 => 223423)
--- trunk/Source/WebCore/ChangeLog 2017-10-16 19:20:17 UTC (rev 223422)
+++ trunk/Source/WebCore/ChangeLog 2017-10-16 19:21:07 UTC (rev 223423)
@@ -1,3 +1,19 @@
+2017-10-16 Maureen Daum <[email protected]>
+
+ We should wrap the removal of information from the tracker database in a transaction in DatabaseTracker::deleteOrigin()
+ https://bugs.webkit.org/show_bug.cgi?id=178274
+ <rdar://problem/34576132>
+
+ Reviewed by Tim Horton.
+
+ * Modules/webdatabase/DatabaseTracker.cpp:
+ (WebCore::DatabaseTracker::deleteOrigin):
+ Wrap the removal of information from the tracker database in a transaction so that
+ we don't end up in a case where only one of the tables contains information about
+ an origin.
+ If anything goes wrong when we're modifying the tracker database, rollback the transaction
+ before bailing.
+
2017-10-16 Ryan Haddad <[email protected]>
Unreviewed, rolling out r223419.
Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp (223422 => 223423)
--- trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp 2017-10-16 19:20:17 UTC (rev 223422)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp 2017-10-16 19:21:07 UTC (rev 223423)
@@ -42,6 +42,7 @@
#include "SecurityOriginHash.h"
#include "SQLiteFileSystem.h"
#include "SQLiteStatement.h"
+#include "SQLiteTransaction.h"
#include <wtf/MainThread.h>
#include <wtf/NeverDestroyed.h>
#include <wtf/StdLibExtras.h>
@@ -842,6 +843,9 @@
deleteOriginLockFor(origin);
doneDeletingOrigin(origin);
+ SQLiteTransaction transaction(m_database);
+ transaction.begin();
+
SQLiteStatement statement(m_database, "DELETE FROM Databases WHERE origin=?");
if (statement.prepare() != SQLITE_OK) {
LOG_ERROR("Unable to prepare deletion of databases from origin %s from tracker", origin.databaseIdentifier().utf8().data());
@@ -868,6 +872,8 @@
return false;
}
+ transaction.commit();
+
SQLiteFileSystem::deleteEmptyDatabaseDirectory(originPath(origin));
bool isEmpty = true;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes