Modified: trunk/Source/WebCore/ChangeLog (223419 => 223420)
--- trunk/Source/WebCore/ChangeLog 2017-10-16 18:08:49 UTC (rev 223419)
+++ trunk/Source/WebCore/ChangeLog 2017-10-16 18:53:11 UTC (rev 223420)
@@ -1,3 +1,16 @@
+2017-10-16 Ryan Haddad <[email protected]>
+
+ Unreviewed, rolling out r223419.
+
+ This change broke the Windows build.
+
+ Reverted changeset:
+
+ "If we fail to delete any database file, don't remove its
+ information from the tracker database"
+ https://bugs.webkit.org/show_bug.cgi?id=178251
+ https://trac.webkit.org/changeset/223419
+
2017-10-16 Maureen Daum <[email protected]>
If we fail to delete any database file, don't remove its information from the tracker database
Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp (223419 => 223420)
--- trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp 2017-10-16 18:08:49 UTC (rev 223419)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp 2017-10-16 18:53:11 UTC (rev 223420)
@@ -781,17 +781,12 @@
for (const auto& databaseName : databaseNames) {
auto fullPath = fullPathForDatabase(origin, databaseName, false);
- // If the file doesn't exist, we previously deleted it but failed to remove the information
- // from the tracker database. We want to delete all of the information associated with this
- // database from the tracker database, so still add its name to databaseNamesToDelete.
- if (fileExists(fullPath)) {
- time_t modificationTime;
- if (!getFileModificationTime(fullPath, modificationTime))
- continue;
+ time_t modificationTime;
+ if (!getFileModificationTime(fullPath, modificationTime))
+ continue;
- if (modificationTime < std::chrono::system_clock::to_time_t(time))
- continue;
- }
+ if (modificationTime < std::chrono::system_clock::to_time_t(time))
+ continue;
databaseNamesToDelete.uncheckedAppend(databaseName);
}
@@ -835,22 +830,13 @@
}
// We drop the lock here because holding locks during a call to deleteDatabaseFile will deadlock.
- bool failedToDeleteAnyDatabaseFile = false;
for (auto& name : databaseNames) {
- if (fileExists(fullPathForDatabase(origin, name, false)) && !deleteDatabaseFile(origin, name, deletionMode)) {
+ if (!deleteDatabaseFile(origin, name, deletionMode)) {
// Even if the file can't be deleted, we want to try and delete the rest, don't return early here.
LOG_ERROR("Unable to delete file for database %s in origin %s", name.utf8().data(), origin.databaseIdentifier().utf8().data());
- failedToDeleteAnyDatabaseFile = true;
}
}
- // If we failed to delete any database file, don't remove the origin from the tracker
- // database because we didn't successfully remove all of its data.
- if (failedToDeleteAnyDatabaseFile) {
- RELEASE_LOG_ERROR(DatabaseTracker, "Failed to delete database for origin");
- return false;
- }
-
{
LockHolder lockDatabase(m_databaseGuard);
deleteOriginLockFor(origin);
@@ -1045,7 +1031,7 @@
}
// We drop the lock here because holding locks during a call to deleteDatabaseFile will deadlock.
- if (fileExists(fullPathForDatabase(origin, name, false)) && !deleteDatabaseFile(origin, name, DeletionMode::Default)) {
+ if (!deleteDatabaseFile(origin, name, DeletionMode::Default)) {
LOG_ERROR("Unable to delete file for database %s in origin %s", name.utf8().data(), origin.databaseIdentifier().utf8().data());
LockHolder lockDatabase(m_databaseGuard);
doneDeletingDatabase(origin, name);
Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.h (223419 => 223420)
--- trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.h 2017-10-16 18:08:49 UTC (rev 223419)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.h 2017-10-16 18:53:11 UTC (rev 223420)
@@ -69,7 +69,7 @@
ExceptionOr<void> retryCanEstablishDatabase(DatabaseContext&, const String& name, unsigned estimatedSize);
void setDatabaseDetails(const SecurityOriginData&, const String& name, const String& displayName, unsigned estimatedSize);
- WEBCORE_TESTSUPPORT_EXPORT String fullPathForDatabase(const SecurityOriginData&, const String& name, bool createIfDoesNotExist);
+ String fullPathForDatabase(const SecurityOriginData&, const String& name, bool createIfDoesNotExist);
void addOpenDatabase(Database&);
void removeOpenDatabase(Database&);
Modified: trunk/Source/WebCore/platform/Logging.h (223419 => 223420)
--- trunk/Source/WebCore/platform/Logging.h 2017-10-16 18:08:49 UTC (rev 223419)
+++ trunk/Source/WebCore/platform/Logging.h 2017-10-16 18:53:11 UTC (rev 223420)
@@ -42,7 +42,6 @@
M(Archives) \
M(Compositing) \
M(ContentFiltering) \
- M(DatabaseTracker) \
M(DisplayLists) \
M(DOMTimers) \
M(Editing) \