Get rid of DatabaseBackendBase
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Aug 2015 21:23:55 +0000 (21:23 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Aug 2015 21:23:55 +0000 (21:23 +0000)
https://bugs.webkit.org/show_bug.cgi?id=147733

Reviewed by Geoffrey Garen.

* CMakeLists.txt:
* Modules/webdatabase/Database.cpp:
(WebCore::Database::Database):
(WebCore::DoneCreatingDatabaseOnExitCaller::DoneCreatingDatabaseOnExitCaller):
(WebCore::DoneCreatingDatabaseOnExitCaller::~DoneCreatingDatabaseOnExitCaller):
* Modules/webdatabase/Database.h:
* Modules/webdatabase/DatabaseBackendBase.cpp: Removed.
(WebCore::DatabaseBackendBase::DatabaseBackendBase): Deleted.
(WebCore::DatabaseBackendBase::~DatabaseBackendBase): Deleted.
* Modules/webdatabase/DatabaseBackendBase.h: Removed.
* Modules/webdatabase/DatabaseManager.cpp:
* Modules/webdatabase/DatabaseManager.h:
* Modules/webdatabase/DatabaseTracker.cpp:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188061 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/webdatabase/Database.cpp
Source/WebCore/Modules/webdatabase/Database.h
Source/WebCore/Modules/webdatabase/DatabaseBackendBase.cpp [deleted file]
Source/WebCore/Modules/webdatabase/DatabaseBackendBase.h [deleted file]
Source/WebCore/Modules/webdatabase/DatabaseManager.cpp
Source/WebCore/Modules/webdatabase/DatabaseManager.h
Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/WebCore.xcodeproj/project.pbxproj

index e214914..a4c9133 100644 (file)
@@ -1003,7 +1003,6 @@ set(WebCore_SOURCES
     Modules/webdatabase/DOMWindowWebDatabase.cpp
     Modules/webdatabase/Database.cpp
     Modules/webdatabase/DatabaseAuthorizer.cpp
-    Modules/webdatabase/DatabaseBackendBase.cpp
     Modules/webdatabase/DatabaseContext.cpp
     Modules/webdatabase/DatabaseManager.cpp
     Modules/webdatabase/DatabaseServer.cpp
index 9a1dc45..e99b31e 100644 (file)
@@ -1,3 +1,27 @@
+2015-08-06  Anders Carlsson  <andersca@apple.com>
+
+        Get rid of DatabaseBackendBase
+        https://bugs.webkit.org/show_bug.cgi?id=147733
+
+        Reviewed by Geoffrey Garen.
+
+        * CMakeLists.txt:
+        * Modules/webdatabase/Database.cpp:
+        (WebCore::Database::Database):
+        (WebCore::DoneCreatingDatabaseOnExitCaller::DoneCreatingDatabaseOnExitCaller):
+        (WebCore::DoneCreatingDatabaseOnExitCaller::~DoneCreatingDatabaseOnExitCaller):
+        * Modules/webdatabase/Database.h:
+        * Modules/webdatabase/DatabaseBackendBase.cpp: Removed.
+        (WebCore::DatabaseBackendBase::DatabaseBackendBase): Deleted.
+        (WebCore::DatabaseBackendBase::~DatabaseBackendBase): Deleted.
+        * Modules/webdatabase/DatabaseBackendBase.h: Removed.
+        * Modules/webdatabase/DatabaseManager.cpp:
+        * Modules/webdatabase/DatabaseManager.h:
+        * Modules/webdatabase/DatabaseTracker.cpp:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * WebCore.xcodeproj/project.pbxproj:
+
 2015-08-06  Myles C. Maxfield  <mmaxfield@apple.com>
 
         Add comment to CSSParserString
index 9863bc9..bcefef3 100644 (file)
@@ -189,7 +189,7 @@ static inline void updateGuidVersionMap(DatabaseGuid guid, String newVersion)
     guidToVersionMap().set(guid, newVersion.isEmpty() ? String() : newVersion.isolatedCopy());
 }
 
-typedef HashMap<DatabaseGuid, std::unique_ptr<HashSet<DatabaseBackendBase*>>> GuidDatabaseMap;
+typedef HashMap<DatabaseGuid, std::unique_ptr<HashSet<Database*>>> GuidDatabaseMap;
 
 static GuidDatabaseMap& guidToDatabaseMap()
 {
@@ -236,9 +236,9 @@ Database::Database(PassRefPtr<DatabaseContext> databaseContext, const String& na
         std::lock_guard<std::mutex> locker(guidMutex());
 
         m_guid = guidForOriginAndName(securityOrigin()->toString(), name);
-        std::unique_ptr<HashSet<DatabaseBackendBase*>>& hashSet = guidToDatabaseMap().add(m_guid, nullptr).iterator->value;
+        std::unique_ptr<HashSet<Database*>>& hashSet = guidToDatabaseMap().add(m_guid, nullptr).iterator->value;
         if (!hashSet)
-            hashSet = std::make_unique<HashSet<DatabaseBackendBase*>>();
+            hashSet = std::make_unique<HashSet<Database*>>();
         hashSet->add(this);
     }
 
@@ -324,20 +324,20 @@ void Database::close()
 
 class DoneCreatingDatabaseOnExitCaller {
 public:
-    DoneCreatingDatabaseOnExitCaller(DatabaseBackendBase* database)
+    DoneCreatingDatabaseOnExitCaller(Database* database)
         : m_database(database)
         , m_openSucceeded(false)
     {
     }
     ~DoneCreatingDatabaseOnExitCaller()
     {
-        DatabaseTracker::tracker().doneCreatingDatabase(static_cast<Database*>(m_database));
+        DatabaseTracker::tracker().doneCreatingDatabase(m_database);
     }
 
     void setOpenSucceeded() { m_openSucceeded = true; }
 
 private:
-    DatabaseBackendBase* m_database;
+    Database* m_database;
     bool m_openSucceeded;
 };
 
index 292f3fc..449917d 100644 (file)
@@ -29,9 +29,9 @@
 #ifndef Database_h
 #define Database_h
 
-#include "DatabaseBackendBase.h"
 #include "DatabaseBasicTypes.h"
 #include "DatabaseError.h"
+#include "SQLiteDatabase.h"
 #include <wtf/Deque.h>
 #include <wtf/text/WTFString.h>
 
@@ -39,6 +39,7 @@ namespace WebCore {
 
 class ChangeVersionData;
 class DatabaseCallback;
+class DatabaseDetails;
 class DatabaseContext;
 class ScriptExecutionContext;
 class SecurityOrigin;
@@ -50,7 +51,7 @@ class SQLTransactionCoordinator;
 class SQLTransactionErrorCallback;
 class VoidCallback;
 
-class Database final : public DatabaseBackendBase {
+class Database final : public ThreadSafeRefCounted<Database> {
 public:
     virtual ~Database();
 
@@ -166,7 +167,6 @@ private:
     bool m_isTransactionQueueEnabled;
 
     friend class ChangeVersionWrapper;
-    friend class DatabaseBackendBase;
     friend class DatabaseManager;
     friend class DatabaseServer; // FIXME: remove this when the backend has been split out.
     friend class SQLStatement;
diff --git a/Source/WebCore/Modules/webdatabase/DatabaseBackendBase.cpp b/Source/WebCore/Modules/webdatabase/DatabaseBackendBase.cpp
deleted file mode 100644 (file)
index ad52b19..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "DatabaseBackendBase.h"
-
-#include "Database.h"
-#include "DatabaseAuthorizer.h"
-#include "DatabaseContext.h"
-#include "DatabaseManager.h"
-#include "DatabaseTracker.h"
-#include "ExceptionCode.h"
-#include "Logging.h"
-#include "SQLiteDatabaseTracker.h"
-#include "SQLiteStatement.h"
-#include "SecurityOrigin.h"
-#include <wtf/HashMap.h>
-#include <wtf/HashSet.h>
-#include <wtf/NeverDestroyed.h>
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefPtr.h>
-#include <wtf/StdLibExtras.h>
-#include <wtf/text/CString.h>
-#include <wtf/text/StringHash.h>
-
-namespace WebCore {
-
-DatabaseBackendBase::DatabaseBackendBase()
-{
-}
-
-DatabaseBackendBase::~DatabaseBackendBase()
-{
-}
-
-} // namespace WebCore
diff --git a/Source/WebCore/Modules/webdatabase/DatabaseBackendBase.h b/Source/WebCore/Modules/webdatabase/DatabaseBackendBase.h
deleted file mode 100644 (file)
index 8b0e1dc..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef DatabaseBackendBase_h
-#define DatabaseBackendBase_h
-
-#include "DatabaseBasicTypes.h"
-#include "DatabaseDetails.h"
-#include "DatabaseError.h"
-#include "SQLiteDatabase.h"
-#include <wtf/Forward.h>
-#include <wtf/RefPtr.h>
-#include <wtf/ThreadSafeRefCounted.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-class Database;
-class DatabaseAuthorizer;
-class DatabaseContext;
-class SecurityOrigin;
-
-class DatabaseBackendBase : public ThreadSafeRefCounted<DatabaseBackendBase> {
-public:
-    virtual ~DatabaseBackendBase();
-
-
-protected:
-    friend class ChangeVersionWrapper;
-    friend class SQLStatementBackend;
-    friend class SQLStatementSync;
-    friend class SQLTransactionBackend;
-    friend class SQLTransactionBackendSync;
-
-    DatabaseBackendBase();
-
-    friend class DatabaseServer;
-};
-
-} // namespace WebCore
-
-#endif // DatabaseBackendBase_h
index b436cf2..e786dbe 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "AbstractDatabaseServer.h"
 #include "Database.h"
-#include "DatabaseBackendBase.h"
 #include "DatabaseCallback.h"
 #include "DatabaseContext.h"
 #include "DatabaseServer.h"
index 1e09654..ce56871 100644 (file)
@@ -40,7 +40,6 @@ namespace WebCore {
 
 class AbstractDatabaseServer;
 class Database;
-class DatabaseBackendBase;
 class DatabaseCallback;
 class DatabaseContext;
 class DatabaseManagerClient;
index aaa6b03..ef014d0 100644 (file)
@@ -32,7 +32,6 @@
 #include "Chrome.h"
 #include "ChromeClient.h"
 #include "Database.h"
-#include "DatabaseBackendBase.h"
 #include "DatabaseContext.h"
 #include "DatabaseManager.h"
 #include "DatabaseManagerClient.h"
index 04f07d1..23a8920 100644 (file)
     <ClCompile Include="..\Modules\webdatabase\ChangeVersionWrapper.cpp" />
     <ClCompile Include="..\Modules\webdatabase\Database.cpp" />
     <ClCompile Include="..\Modules\webdatabase\DatabaseAuthorizer.cpp" />
-    <ClCompile Include="..\Modules\webdatabase\DatabaseBackendBase.cpp" />
     <ClCompile Include="..\Modules\webdatabase\DatabaseContext.cpp" />
     <ClCompile Include="..\Modules\webdatabase\DatabaseManager.cpp" />
     <ClCompile Include="..\Modules\webdatabase\DatabaseServer.cpp" />
     <ClInclude Include="..\Modules\webdatabase\ChangeVersionWrapper.h" />
     <ClInclude Include="..\Modules\webdatabase\Database.h" />
     <ClInclude Include="..\Modules\webdatabase\DatabaseAuthorizer.h" />
-    <ClInclude Include="..\Modules\webdatabase\DatabaseBackendBase.h" />
     <ClInclude Include="..\Modules\webdatabase\DatabaseBasicTypes.h" />
     <ClInclude Include="..\Modules\webdatabase\DatabaseCallback.h" />
     <ClInclude Include="..\Modules\webdatabase\DatabaseContext.h" />
index a7e1356..0463201 100644 (file)
     <ClCompile Include="..\Modules\webdatabase\DatabaseAuthorizer.cpp">
       <Filter>Modules\webdatabase</Filter>
     </ClCompile>
-    <ClCompile Include="..\Modules\webdatabase\DatabaseBackendBase.cpp">
-      <Filter>Modules\webdatabase</Filter>
-    </ClCompile>
     <ClCompile Include="..\Modules\webdatabase\DatabaseContext.cpp">
       <Filter>Modules\webdatabase</Filter>
     </ClCompile>
     <ClInclude Include="..\Modules\webdatabase\DatabaseAuthorizer.h">
       <Filter>Modules\webdatabase</Filter>
     </ClInclude>
-    <ClInclude Include="..\Modules\webdatabase\DatabaseBackendBase.h">
-      <Filter>Modules\webdatabase</Filter>
-    </ClInclude>
     <ClInclude Include="..\Modules\webdatabase\DatabaseBasicTypes.h">
       <Filter>Modules\webdatabase</Filter>
     </ClInclude>
index 627047a..88a383d 100644 (file)
                97B38E27151C4271004622E9 /* DOMWindowNotifications.h in Headers */ = {isa = PBXBuildFile; fileRef = 97B38E24151C4264004622E9 /* DOMWindowNotifications.h */; };
                97B38E28151C4273004622E9 /* DOMWindowNotifications.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97B38E23151C4264004622E9 /* DOMWindowNotifications.cpp */; };
                97B8FFD116AE7F960038388D /* CharacterReferenceParserInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 97B8FFCF16AE7F920038388D /* CharacterReferenceParserInlines.h */; };
-               97BC69DA1505F076001B74AC /* DatabaseBackendBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97BC69D61505F076001B74AC /* DatabaseBackendBase.cpp */; };
-               97BC69DB1505F076001B74AC /* DatabaseBackendBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 97BC69D71505F076001B74AC /* DatabaseBackendBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
                97BC69DC1505F076001B74AC /* ChangeVersionWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97BC69D81505F076001B74AC /* ChangeVersionWrapper.cpp */; };
                97BC69DD1505F076001B74AC /* ChangeVersionWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 97BC69D91505F076001B74AC /* ChangeVersionWrapper.h */; };
                97BC6A201505F081001B74AC /* Database.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97BC69DE1505F081001B74AC /* Database.cpp */; };
                97B38E24151C4264004622E9 /* DOMWindowNotifications.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWindowNotifications.h; sourceTree = "<group>"; };
                97B38E25151C4264004622E9 /* DOMWindowNotifications.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMWindowNotifications.idl; sourceTree = "<group>"; };
                97B8FFCF16AE7F920038388D /* CharacterReferenceParserInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CharacterReferenceParserInlines.h; sourceTree = "<group>"; };
-               97BC69D61505F076001B74AC /* DatabaseBackendBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DatabaseBackendBase.cpp; sourceTree = "<group>"; };
-               97BC69D71505F076001B74AC /* DatabaseBackendBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseBackendBase.h; sourceTree = "<group>"; };
                97BC69D81505F076001B74AC /* ChangeVersionWrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ChangeVersionWrapper.cpp; sourceTree = "<group>"; };
                97BC69D91505F076001B74AC /* ChangeVersionWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChangeVersionWrapper.h; sourceTree = "<group>"; };
                97BC69DE1505F081001B74AC /* Database.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Database.cpp; sourceTree = "<group>"; };
                                97BC69E01505F081001B74AC /* Database.idl */,
                                97BC69E11505F081001B74AC /* DatabaseAuthorizer.cpp */,
                                97BC69E21505F081001B74AC /* DatabaseAuthorizer.h */,
-                               97BC69D61505F076001B74AC /* DatabaseBackendBase.cpp */,
-                               97BC69D71505F076001B74AC /* DatabaseBackendBase.h */,
                                FE3371A0167C11D400EDB752 /* DatabaseBasicTypes.h */,
                                97BC69E31505F081001B74AC /* DatabaseCallback.h */,
                                97BC69E41505F081001B74AC /* DatabaseCallback.idl */,
                                26F756B01B3B65AC0005DD79 /* MutableRange.h in Headers */,
                                97BC6A211505F081001B74AC /* Database.h in Headers */,
                                97BC6A241505F081001B74AC /* DatabaseAuthorizer.h in Headers */,
-                               97BC69DB1505F076001B74AC /* DatabaseBackendBase.h in Headers */,
                                FE3371A2167C11D400EDB752 /* DatabaseBasicTypes.h in Headers */,
                                97BC6A251505F081001B74AC /* DatabaseCallback.h in Headers */,
                                97BC6A281505F081001B74AC /* DatabaseContext.h in Headers */,
                                62CD32591157E57C0063B0A7 /* CustomEvent.cpp in Sources */,
                                97BC6A201505F081001B74AC /* Database.cpp in Sources */,
                                97BC6A231505F081001B74AC /* DatabaseAuthorizer.cpp in Sources */,
-                               97BC69DA1505F076001B74AC /* DatabaseBackendBase.cpp in Sources */,
                                97BC6A271505F081001B74AC /* DatabaseContext.cpp in Sources */,
                                FE456F181677D74E005EDDF9 /* DatabaseManager.cpp in Sources */,
                                1ACB2B231A5733F400333392 /* DatabaseProvider.cpp in Sources */,