Title: [223673] branches/safari-604-branch/Source/WebCore
- Revision
- 223673
- Author
- [email protected]
- Date
- 2017-10-18 22:14:52 -0700 (Wed, 18 Oct 2017)
Log Message
Cherry-pick r223423. rdar://problem/34745623
Modified Paths
Diff
Modified: branches/safari-604-branch/Source/WebCore/ChangeLog (223672 => 223673)
--- branches/safari-604-branch/Source/WebCore/ChangeLog 2017-10-19 05:14:50 UTC (rev 223672)
+++ branches/safari-604-branch/Source/WebCore/ChangeLog 2017-10-19 05:14:52 UTC (rev 223673)
@@ -1,5 +1,25 @@
2017-10-18 Jason Marcell <[email protected]>
+ Cherry-pick r223423. rdar://problem/34745623
+
+ 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-18 Jason Marcell <[email protected]>
+
Cherry-pick r223420. rdar://problem/34745623
2017-10-16 Ryan Haddad <[email protected]>
Modified: branches/safari-604-branch/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp (223672 => 223673)
--- branches/safari-604-branch/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp 2017-10-19 05:14:50 UTC (rev 223672)
+++ branches/safari-604-branch/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp 2017-10-19 05:14:52 UTC (rev 223673)
@@ -43,6 +43,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>
@@ -843,6 +844,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());
@@ -869,6 +873,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