Remove some iOS #ifdefs by adding SQLiteDatabaseTracker to all the builds
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 26 Jan 2014 00:36:23 +0000 (00:36 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 26 Jan 2014 00:36:23 +0000 (00:36 +0000)
https://bugs.webkit.org/show_bug.cgi?id=127632

Reviewed by Darin Adler.

Move the SQLiteDatabaseTracker and client from platform/sql/ios to platform/sql,
as there is nothing iOS specific about it. Then, un-#ifdef all its uses. For
ports that don't setup a client, this has no change in behavior.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Modules/webdatabase/DatabaseBackendBase.cpp:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* loader/appcache/ApplicationCacheStorage.cpp:
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::sendWillRevealEdgeEventsIfNeeded):
* platform/sql/SQLiteDatabaseTracker.cpp: Copied from Source/WebCore/platform/sql/ios/SQLiteDatabaseTracker.cpp.
* platform/sql/SQLiteDatabaseTracker.h: Copied from Source/WebCore/platform/sql/ios/SQLiteDatabaseTracker.h.
* platform/sql/SQLiteDatabaseTrackerClient.h: Copied from Source/WebCore/platform/sql/ios/SQLiteDatabaseTrackerClient.h.
* platform/sql/ios: Removed.
* platform/sql/ios/SQLiteDatabaseTracker.cpp: Removed.
* platform/sql/ios/SQLiteDatabaseTracker.h: Removed.
* platform/sql/ios/SQLiteDatabaseTrackerClient.h: Removed.
* storage/StorageAreaSync.cpp:
(WebCore::StorageAreaSync::openDatabase):
(WebCore::StorageAreaSync::sync):
* storage/StorageTracker.cpp:

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

14 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Modules/webdatabase/DatabaseBackendBase.cpp
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp
Source/WebCore/platform/ScrollableArea.h
Source/WebCore/platform/sql/SQLiteDatabaseTracker.cpp [moved from Source/WebCore/platform/sql/ios/SQLiteDatabaseTracker.cpp with 89% similarity]
Source/WebCore/platform/sql/SQLiteDatabaseTracker.h [moved from Source/WebCore/platform/sql/ios/SQLiteDatabaseTracker.h with 97% similarity]
Source/WebCore/platform/sql/SQLiteDatabaseTrackerClient.h [moved from Source/WebCore/platform/sql/ios/SQLiteDatabaseTrackerClient.h with 100% similarity]
Source/WebCore/storage/StorageAreaSync.cpp
Source/WebCore/storage/StorageTracker.cpp

index 764ce28..b16ebd0 100644 (file)
@@ -2057,6 +2057,7 @@ set(WebCore_SOURCES
     platform/sql/SQLValue.cpp
     platform/sql/SQLiteAuthorizer.cpp
     platform/sql/SQLiteDatabase.cpp
+    platform/sql/SQLiteDatabaseTracker.cpp
     platform/sql/SQLiteFileSystem.cpp
     platform/sql/SQLiteStatement.cpp
     platform/sql/SQLiteTransaction.cpp
index bbbe386..d24120b 100644 (file)
@@ -1,3 +1,35 @@
+2014-01-25  Sam Weinig  <sam@webkit.org>
+
+        Remove some iOS #ifdefs by adding SQLiteDatabaseTracker to all the builds
+        https://bugs.webkit.org/show_bug.cgi?id=127632
+
+        Reviewed by Darin Adler.
+
+        Move the SQLiteDatabaseTracker and client from platform/sql/ios to platform/sql,
+        as there is nothing iOS specific about it. Then, un-#ifdef all its uses. For
+        ports that don't setup a client, this has no change in behavior.
+
+        * CMakeLists.txt:
+        * GNUmakefile.list.am:
+        * Modules/webdatabase/DatabaseBackendBase.cpp:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * WebCore.xcodeproj/project.pbxproj:
+        * loader/appcache/ApplicationCacheStorage.cpp:
+        * platform/ScrollableArea.h:
+        (WebCore::ScrollableArea::sendWillRevealEdgeEventsIfNeeded):
+        * platform/sql/SQLiteDatabaseTracker.cpp: Copied from Source/WebCore/platform/sql/ios/SQLiteDatabaseTracker.cpp.
+        * platform/sql/SQLiteDatabaseTracker.h: Copied from Source/WebCore/platform/sql/ios/SQLiteDatabaseTracker.h.
+        * platform/sql/SQLiteDatabaseTrackerClient.h: Copied from Source/WebCore/platform/sql/ios/SQLiteDatabaseTrackerClient.h.
+        * platform/sql/ios: Removed.
+        * platform/sql/ios/SQLiteDatabaseTracker.cpp: Removed.
+        * platform/sql/ios/SQLiteDatabaseTracker.h: Removed.
+        * platform/sql/ios/SQLiteDatabaseTrackerClient.h: Removed.
+        * storage/StorageAreaSync.cpp:
+        (WebCore::StorageAreaSync::openDatabase):
+        (WebCore::StorageAreaSync::sync):
+        * storage/StorageTracker.cpp:
+
 2014-01-25  Anders Carlsson  <andersca@apple.com>
 
         Remove an unused FrameLoaderClient function
index df63e1d..7d7f9c1 100644 (file)
@@ -5478,6 +5478,9 @@ webcore_platform_sources += \
        Source/WebCore/platform/sql/SQLiteAuthorizer.cpp \
        Source/WebCore/platform/sql/SQLiteDatabase.cpp \
        Source/WebCore/platform/sql/SQLiteDatabase.h \
+       Source/WebCore/platform/sql/SQLiteDatabaseTracker.cpp \
+       Source/WebCore/platform/sql/SQLiteDatabaseTracker.h \
+       Source/WebCore/platform/sql/SQLiteDatabaseTrackerClient.h \
        Source/WebCore/platform/sql/SQLiteFileSystem.cpp \
        Source/WebCore/platform/sql/SQLiteFileSystem.h \
        Source/WebCore/platform/sql/SQLiteStatement.cpp \
index f4a56e0..ee45a1d 100644 (file)
@@ -40,6 +40,7 @@
 #include "DatabaseTracker.h"
 #include "ExceptionCode.h"
 #include "Logging.h"
+#include "SQLiteDatabaseTracker.h"
 #include "SQLiteStatement.h"
 #include "SQLiteTransaction.h"
 #include "SecurityOrigin.h"
 #include <wtf/text/CString.h>
 #include <wtf/text/StringHash.h>
 
-#if PLATFORM(IOS)
-#include "SQLiteDatabaseTracker.h"
-#endif
-
 // Registering "opened" databases with the DatabaseTracker
 // =======================================================
 // The DatabaseTracker maintains a list of databases that have been
@@ -332,9 +329,10 @@ bool DatabaseBackendBase::performOpenAndVerify(bool shouldSetVersionInNewDatabas
         // Make sure we wait till the background removal of the empty database files finished before trying to open any database.
         MutexLocker locker(DatabaseTracker::openDatabaseMutex());
     }
-    SQLiteTransactionInProgressAutoCounter transactionCounter;
 #endif
 
+    SQLiteTransactionInProgressAutoCounter transactionCounter;
+
     if (!m_sqliteDatabase.open(m_filename, true)) {
         errorMessage = formatErrorMessage("unable to open database", m_sqliteDatabase.lastError(), m_sqliteDatabase.lastErrorMsg());
         return false;
@@ -587,9 +585,8 @@ unsigned long long DatabaseBackendBase::maximumSize() const
 
 void DatabaseBackendBase::incrementalVacuumIfNeeded()
 {
-#if PLATFORM(IOS)
     SQLiteTransactionInProgressAutoCounter transactionCounter;
-#endif
+
     int64_t freeSpaceSize = m_sqliteDatabase.freeSpaceSize();
     int64_t totalSize = m_sqliteDatabase.totalSize();
     if (totalSize <= 10 * freeSpaceSize) {
index cb7bda0..2ed1a4b 100644 (file)
     </ClCompile>
     <ClCompile Include="..\platform\sql\SQLiteAuthorizer.cpp" />
     <ClCompile Include="..\platform\sql\SQLiteDatabase.cpp" />
+    <ClCompile Include="..\platform\sql\SQLiteDatabaseTracker.cpp" />
     <ClCompile Include="..\platform\sql\SQLiteFileSystem.cpp" />
     <ClCompile Include="..\platform\sql\SQLiteStatement.cpp" />
     <ClCompile Include="..\platform\sql\SQLiteTransaction.cpp" />
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
     </CustomBuildStep>
     <ClInclude Include="..\platform\sql\SQLiteDatabase.h" />
+    <ClInclude Include="..\platform\sql\SQLiteDatabaseTracker.h" />
+    <ClInclude Include="..\platform\sql\SQLiteDatabaseTrackerClient.h" />
     <ClInclude Include="..\platform\sql\SQLiteFileSystem.h" />
     <ClInclude Include="..\platform\sql\SQLiteStatement.h" />
     <ClInclude Include="..\platform\sql\SQLiteTransaction.h" />
index 1326bea..0f653df 100644 (file)
     <ClCompile Include="..\platform\sql\SQLiteDatabase.cpp">
       <Filter>platform\sql</Filter>
     </ClCompile>
+    <ClCompile Include="..\platform\sql\SQLiteDatabaseTracker.cpp">
+      <Filter>platform\sql</Filter>
+    </ClCompile>
     <ClCompile Include="..\platform\sql\SQLiteFileSystem.cpp">
       <Filter>platform\sql</Filter>
     </ClCompile>
     <ClInclude Include="..\platform\sql\SQLiteDatabase.h">
       <Filter>platform\sql</Filter>
     </ClInclude>
+    <ClInclude Include="..\platform\sql\SQLiteDatabaseTracker.h">
+      <Filter>platform\sql</Filter>
+    </ClInclude>
+    <ClInclude Include="..\platform\sql\SQLiteDatabaseTrackerClient.h">
+      <Filter>platform\sql</Filter>
+    </ClInclude>
     <ClInclude Include="..\platform\sql\SQLiteFileSystem.h">
       <Filter>platform\sql</Filter>
     </ClInclude>
index 7424222..f1c5ed0 100644 (file)
                7E428CE413E3407F003B661C /* ResourceHandleIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ResourceHandleIOS.mm; sourceTree = "<group>"; };
                7E46F6F81627A2C900062223 /* JSOESElementIndexUint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSOESElementIndexUint.cpp; sourceTree = "<group>"; };
                7E46F6F91627A2C900062223 /* JSOESElementIndexUint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSOESElementIndexUint.h; sourceTree = "<group>"; };
-               7E474E1B12494DC900235364 /* SQLiteDatabaseTrackerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLiteDatabaseTrackerClient.h; sourceTree = "<group>"; };
-               7E474E1C12494DC900235364 /* SQLiteDatabaseTracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLiteDatabaseTracker.h; sourceTree = "<group>"; };
-               7E474E1D12494DC900235364 /* SQLiteDatabaseTracker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SQLiteDatabaseTracker.cpp; sourceTree = "<group>"; };
+               7E474E1B12494DC900235364 /* SQLiteDatabaseTrackerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SQLiteDatabaseTrackerClient.h; path = sql/SQLiteDatabaseTrackerClient.h; sourceTree = "<group>"; };
+               7E474E1C12494DC900235364 /* SQLiteDatabaseTracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SQLiteDatabaseTracker.h; path = sql/SQLiteDatabaseTracker.h; sourceTree = "<group>"; };
+               7E474E1D12494DC900235364 /* SQLiteDatabaseTracker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SQLiteDatabaseTracker.cpp; path = sql/SQLiteDatabaseTracker.cpp; sourceTree = "<group>"; };
                7E5D7A73161D3F8F00896C34 /* OESElementIndexUint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OESElementIndexUint.cpp; path = canvas/OESElementIndexUint.cpp; sourceTree = "<group>"; };
                7E5D7A74161D3F8F00896C34 /* OESElementIndexUint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OESElementIndexUint.h; path = canvas/OESElementIndexUint.h; sourceTree = "<group>"; };
                7E66E23116D6EB6C00F7E7FF /* WebGLCompressedTextureATC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebGLCompressedTextureATC.cpp; path = canvas/WebGLCompressedTextureATC.cpp; sourceTree = "<group>"; };
                1A2E6E560CC551E0004A2062 /* sql */ = {
                        isa = PBXGroup;
                        children = (
-                               7E474E1912494DA900235364 /* ios */,
+                               7E474E1D12494DC900235364 /* SQLiteDatabaseTracker.cpp */,
+                               7E474E1C12494DC900235364 /* SQLiteDatabaseTracker.h */,
+                               7E474E1B12494DC900235364 /* SQLiteDatabaseTrackerClient.h */,
                                1A2E6E780CC556D5004A2062 /* SQLiteAuthorizer.cpp */,
                                1A2246430CC98DDB00C05240 /* SQLiteDatabase.cpp */,
                                1A2246440CC98DDB00C05240 /* SQLiteDatabase.h */,
                        path = icu;
                        sourceTree = "<group>";
                };
-               7E474E1912494DA900235364 /* ios */ = {
-                       isa = PBXGroup;
-                       children = (
-                               7E474E1D12494DC900235364 /* SQLiteDatabaseTracker.cpp */,
-                               7E474E1C12494DC900235364 /* SQLiteDatabaseTracker.h */,
-                               7E474E1B12494DC900235364 /* SQLiteDatabaseTrackerClient.h */,
-                       );
-                       name = ios;
-                       path = sql/ios;
-                       sourceTree = "<group>";
-               };
                7EE6847312D26E5500E79415 /* cf */ = {
                        isa = PBXGroup;
                        children = (
index b66fb8f..40553ec 100644 (file)
 #include "ApplicationCacheHost.h"
 #include "ApplicationCacheResource.h"
 #include "FileSystem.h"
-#include "URL.h"
 #include "NotImplemented.h"
+#include "SQLiteDatabaseTracker.h"
 #include "SQLiteStatement.h"
 #include "SQLiteTransaction.h"
 #include "SecurityOrigin.h"
+#include "URL.h"
 #include "UUID.h"
-#include <wtf/text/CString.h>
 #include <wtf/StdLibExtras.h>
 #include <wtf/StringExtras.h>
+#include <wtf/text/CString.h>
 #include <wtf/text/StringBuilder.h>
 
-#if PLATFORM(IOS)
-#include "SQLiteDatabaseTracker.h"
-#endif
-
 namespace WebCore {
 
 static const char flatFileSubdirectory[] = "ApplicationCache";
@@ -104,10 +101,8 @@ static unsigned urlHostHash(const URL& url)
 
 ApplicationCacheGroup* ApplicationCacheStorage::loadCacheGroup(const URL& manifestURL)
 {
-#if PLATFORM(IOS)
-    // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
     SQLiteTransactionInProgressAutoCounter transactionCounter;
-#endif
+
     openDatabase(false);
     if (!m_database.isOpen())
         return 0;
@@ -182,10 +177,8 @@ void ApplicationCacheStorage::loadManifestHostHashes()
     // to avoid trying to open the database over and over if it doesn't exist.
     hasLoadedHashes = true;
     
-#if PLATFORM(IOS)
-    // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
     SQLiteTransactionInProgressAutoCounter transactionCounter;
-#endif
+
     openDatabase(false);
     if (!m_database.isOpen())
         return;
@@ -229,10 +222,7 @@ ApplicationCacheGroup* ApplicationCacheStorage::cacheGroupForURL(const URL& url)
     if (!m_database.isOpen())
         return 0;
         
-#if PLATFORM(IOS)
-    // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
     SQLiteTransactionInProgressAutoCounter transactionCounter;
-#endif
 
     // Check the database. Look for all cache groups with a newest cache.
     SQLiteStatement statement(m_database, "SELECT id, manifestURL, newestCache FROM CacheGroups WHERE newestCache IS NOT NULL");
@@ -280,10 +270,8 @@ ApplicationCacheGroup* ApplicationCacheStorage::cacheGroupForURL(const URL& url)
 
 ApplicationCacheGroup* ApplicationCacheStorage::fallbackCacheGroupForURL(const URL& url)
 {
-#if PLATFORM(IOS)
-    // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
     SQLiteTransactionInProgressAutoCounter transactionCounter;
-#endif
+
     ASSERT(!url.hasFragmentIdentifier());
 
     // Check if an appropriate cache already exists in memory.
@@ -455,10 +443,8 @@ void ApplicationCacheStorage::setDefaultOriginQuota(int64_t quota)
 
 bool ApplicationCacheStorage::calculateQuotaForOrigin(const SecurityOrigin* origin, int64_t& quota)
 {
-#if PLATFORM(IOS)
-    // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
     SQLiteTransactionInProgressAutoCounter transactionCounter;
-#endif
+
     // If an Origin record doesn't exist, then the COUNT will be 0 and quota will be 0.
     // Using the count to determine if a record existed or not is a safe way to determine
     // if a quota of 0 is real, from the record, or from null.
@@ -482,10 +468,8 @@ bool ApplicationCacheStorage::calculateQuotaForOrigin(const SecurityOrigin* orig
 
 bool ApplicationCacheStorage::calculateUsageForOrigin(const SecurityOrigin* origin, int64_t& usage)
 {
-#if PLATFORM(IOS)
-    // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
     SQLiteTransactionInProgressAutoCounter transactionCounter;
-#endif
+
     // If an Origins record doesn't exist, then the SUM will be null,
     // which will become 0, as expected, when converting to a number.
     SQLiteStatement statement(m_database, "SELECT SUM(Caches.size)"
@@ -510,10 +494,8 @@ bool ApplicationCacheStorage::calculateUsageForOrigin(const SecurityOrigin* orig
 
 bool ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache(const SecurityOrigin* origin, ApplicationCache* cache, int64_t& remainingSize)
 {
-#if PLATFORM(IOS)
-    // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
     SQLiteTransactionInProgressAutoCounter transactionCounter;
-#endif
+
     openDatabase(false);
     if (!m_database.isOpen())
         return false;
@@ -563,10 +545,8 @@ bool ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache(cons
 
 bool ApplicationCacheStorage::storeUpdatedQuotaForOrigin(const SecurityOrigin* origin, int64_t quota)
 {
-#if PLATFORM(IOS)
-    // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
     SQLiteTransactionInProgressAutoCounter transactionCounter;
-#endif
+
     openDatabase(true);
     if (!m_database.isOpen())
         return false;
@@ -633,10 +613,8 @@ void ApplicationCacheStorage::verifySchemaVersion()
     
 void ApplicationCacheStorage::openDatabase(bool createIfDoesNotExist)
 {
-#if PLATFORM(IOS)
-    // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
     SQLiteTransactionInProgressAutoCounter transactionCounter;
-#endif
+
     if (m_database.isOpen())
         return;
 
@@ -950,10 +928,8 @@ bool ApplicationCacheStorage::store(ApplicationCacheResource* resource, unsigned
 
 bool ApplicationCacheStorage::storeUpdatedType(ApplicationCacheResource* resource, ApplicationCache* cache)
 {
-#if PLATFORM(IOS)
-    // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
     SQLiteTransactionInProgressAutoCounter transactionCounter;
-#endif
+
     ASSERT_UNUSED(cache, cache->storageID());
     ASSERT(resource->storageID());
 
@@ -970,10 +946,8 @@ bool ApplicationCacheStorage::storeUpdatedType(ApplicationCacheResource* resourc
 
 bool ApplicationCacheStorage::store(ApplicationCacheResource* resource, ApplicationCache* cache)
 {
-#if PLATFORM(IOS)
-    // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
     SQLiteTransactionInProgressAutoCounter transactionCounter;
-#endif
+
     ASSERT(cache->storageID());
     
     openDatabase(true);
@@ -1270,10 +1244,8 @@ PassRefPtr<ApplicationCache> ApplicationCacheStorage::loadCache(unsigned storage
     
 void ApplicationCacheStorage::remove(ApplicationCache* cache)
 {
-#if PLATFORM(IOS)
-    // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
     SQLiteTransactionInProgressAutoCounter transactionCounter;
-#endif
+
     if (!cache->storageID())
         return;
     
@@ -1311,10 +1283,8 @@ void ApplicationCacheStorage::remove(ApplicationCache* cache)
 
 void ApplicationCacheStorage::empty()
 {
-#if PLATFORM(IOS)
-    // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
     SQLiteTransactionInProgressAutoCounter transactionCounter;
-#endif
+
     openDatabase(false);
     
     if (!m_database.isOpen())
@@ -1379,10 +1349,8 @@ bool ApplicationCacheStorage::writeDataToUniqueFileInDirectory(SharedBuffer* dat
 
 bool ApplicationCacheStorage::storeCopyOfCache(const String& cacheDirectory, ApplicationCacheHost* cacheHost)
 {
-#if PLATFORM(IOS)
-    // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
     SQLiteTransactionInProgressAutoCounter transactionCounter;
-#endif
+
     ApplicationCache* cache = cacheHost->applicationCache();
     if (!cache)
         return true;
@@ -1419,10 +1387,8 @@ bool ApplicationCacheStorage::storeCopyOfCache(const String& cacheDirectory, App
 
 bool ApplicationCacheStorage::manifestURLs(Vector<URL>* urls)
 {
-#if PLATFORM(IOS)
-    // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
     SQLiteTransactionInProgressAutoCounter transactionCounter;
-#endif
+
     ASSERT(urls);
     openDatabase(false);
     if (!m_database.isOpen())
@@ -1441,10 +1407,8 @@ bool ApplicationCacheStorage::manifestURLs(Vector<URL>* urls)
 
 bool ApplicationCacheStorage::cacheGroupSize(const String& manifestURL, int64_t* size)
 {
-#if PLATFORM(IOS)
-    // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
     SQLiteTransactionInProgressAutoCounter transactionCounter;
-#endif
+
     ASSERT(size);
     openDatabase(false);
     if (!m_database.isOpen())
@@ -1471,10 +1435,8 @@ bool ApplicationCacheStorage::cacheGroupSize(const String& manifestURL, int64_t*
 
 bool ApplicationCacheStorage::deleteCacheGroup(const String& manifestURL)
 {
-#if PLATFORM(IOS)
-    // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
     SQLiteTransactionInProgressAutoCounter transactionCounter;
-#endif
+
     SQLiteTransaction deleteTransaction(m_database);
     // Check to see if the group is in memory.
     ApplicationCacheGroup* group = m_cachesInMemory.get(manifestURL);
@@ -1526,10 +1488,8 @@ bool ApplicationCacheStorage::deleteCacheGroup(const String& manifestURL)
 
 void ApplicationCacheStorage::vacuumDatabaseFile()
 {
-#if PLATFORM(IOS)
-    // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
     SQLiteTransactionInProgressAutoCounter transactionCounter;
-#endif
+
     openDatabase(false);
     if (!m_database.isOpen())
         return;
index b426cc2..8d6f40c 100644 (file)
@@ -254,6 +254,8 @@ protected:
     bool hasLayerForVerticalScrollbar() const;
     bool hasLayerForScrollCorner() const;
 
+    virtual void sendWillRevealEdgeEventsIfNeeded(const IntPoint&, const IntPoint&) { }
+
 private:
     virtual IntRect visibleContentRectInternal(VisibleContentRectIncludesScrollbars, VisibleContentRectBehavior) const;
     void scrollPositionChanged(const IntPoint&);
 #include "config.h"
 #include "SQLiteDatabaseTracker.h"
 
+#include <mutex>
 #include <wtf/NeverDestroyed.h>
-#include <wtf/StdLibExtras.h>
-#include <wtf/ThreadingPrimitives.h>
 
 namespace WebCore {
 
 namespace SQLiteDatabaseTracker {
 
-static SQLiteDatabaseTrackerClient* s_staticSQLiteDatabaseTrackerClient = 0;
+static SQLiteDatabaseTrackerClient* s_staticSQLiteDatabaseTrackerClient = nullptr;
 static unsigned s_transactionInProgressCounter = 0;
 
-static Mutex& transactionInProgressMutex()
+static std::mutex& transactionInProgressMutex()
 {
-    static NeverDestroyed<Mutex> tipMutex;
+    static NeverDestroyed<std::mutex> tipMutex;
     return tipMutex;
 }
 
@@ -54,7 +53,8 @@ void incrementTransactionInProgressCount()
 {
     if (!s_staticSQLiteDatabaseTrackerClient)
         return;
-    MutexLocker lock(transactionInProgressMutex());
+
+    std::lock_guard<std::mutex> lock(transactionInProgressMutex());
 
     s_transactionInProgressCounter++;
     if (s_transactionInProgressCounter == 1)
@@ -65,7 +65,8 @@ void decrementTransactionInProgressCount()
 {
     if (!s_staticSQLiteDatabaseTrackerClient)
         return;
-    MutexLocker lock(transactionInProgressMutex());
+
+    std::lock_guard<std::mutex> lock(transactionInProgressMutex());
 
     ASSERT(s_transactionInProgressCounter);
     s_transactionInProgressCounter--;
@@ -79,7 +80,7 @@ bool hasTransactionInProgress()
 {
     return !s_staticSQLiteDatabaseTrackerClient || s_transactionInProgressCounter > 0;
 }
-#endif // !ASSERT_DISABLED
+#endif
 
 } // namespace SQLiteDatabaseTracker
 
@@ -27,7 +27,6 @@
 #define SQLiteDatabaseTracker_h
 
 #include "SQLiteDatabaseTrackerClient.h"
-#include <wtf/Noncopyable.h>
 
 namespace WebCore {
 
@@ -40,7 +39,7 @@ void setClient(SQLiteDatabaseTrackerClient*);
 
 #if !ASSERT_DISABLED
 bool hasTransactionInProgress();
-#endif // !ASSERT_DISABLED
+#endif
 
 };
 
index 7b0267f..eea5ebe 100644 (file)
@@ -29,6 +29,7 @@
 #include "EventNames.h"
 #include "FileSystem.h"
 #include "HTMLElement.h"
+#include "SQLiteDatabaseTracker.h"
 #include "SQLiteFileSystem.h"
 #include "SQLiteStatement.h"
 #include "SQLiteTransaction.h"
 #include <wtf/MainThread.h>
 #include <wtf/text/CString.h>
 
-#if PLATFORM(IOS)
-#include "SQLiteDatabaseTracker.h"
-#endif
-
 namespace WebCore {
 
 // If the StorageArea undergoes rapid changes, don't sync each change to disk.
@@ -236,9 +233,8 @@ void StorageAreaSync::openDatabase(OpenDatabaseParamType openingStrategy)
     ASSERT(!m_database.isOpen());
     ASSERT(!m_databaseOpenFailed);
 
-#if PLATFORM(IOS)
     SQLiteTransactionInProgressAutoCounter transactionCounter;
-#endif
+
     String databaseFilename = m_syncManager->fullDatabaseFilename(m_databaseIdentifier);
 
     if (!fileExists(databaseFilename) && openingStrategy == SkipIfNonExistent)
@@ -410,9 +406,8 @@ void StorageAreaSync::sync(bool clearItems, const HashMap<String, String>& items
         return;
     }
     
-#if PLATFORM(IOS)
     SQLiteTransactionInProgressAutoCounter transactionCounter;
-#endif
+
     // If the clear flag is set, then we clear all items out before we write any new ones in.
     if (clearItems) {
         SQLiteStatement clear(m_database, "DELETE FROM ItemTable");
index 976dcda..dc236c3 100644 (file)
 
 #include "DatabaseThread.h"
 #include "FileSystem.h"
-#include "StorageThread.h"
 #include "Logging.h"
 #include "PageGroup.h"
+#include "SQLiteDatabaseTracker.h"
 #include "SQLiteFileSystem.h"
 #include "SQLiteStatement.h"
 #include "SecurityOrigin.h"
+#include "StorageThread.h"
 #include "StorageTrackerClient.h"
 #include "TextEncoding.h"
 #include <wtf/Functional.h>
 #include <wtf/Vector.h>
 #include <wtf/text/CString.h>
 
-#if PLATFORM(IOS)
-#include "SQLiteDatabaseTracker.h"
-#endif
-
 namespace WebCore {
 
 static StorageTracker* storageTracker = 0;
@@ -136,9 +133,9 @@ void StorageTracker::openTrackerDatabase(bool createIfDoesNotExist)
 {
     ASSERT(m_isActive);
     ASSERT(!isMainThread());
-#if PLATFORM(IOS)
+
     SQLiteTransactionInProgressAutoCounter transactionCounter;
-#endif
+
     ASSERT(!m_databaseMutex.tryLock());
 
     if (m_database.isOpen())
@@ -199,9 +196,8 @@ void StorageTracker::syncImportOriginIdentifiers()
         openTrackerDatabase(false);
 
         if (m_database.isOpen()) {
-#if PLATFORM(IOS)
             SQLiteTransactionInProgressAutoCounter transactionCounter;
-#endif
+
             SQLiteStatement statement(m_database, "SELECT origin FROM Origins");
             if (statement.prepare() != SQLResultOk) {
                 LOG_ERROR("Failed to prepare statement.");
@@ -242,9 +238,9 @@ void StorageTracker::syncImportOriginIdentifiers()
 void StorageTracker::syncFileSystemAndTrackerDatabase()
 {
     ASSERT(!isMainThread());
-#if PLATFORM(IOS)
+
     SQLiteTransactionInProgressAutoCounter transactionCounter;
-#endif
+
     ASSERT(m_isActive);
 
     Vector<String> paths;
@@ -317,9 +313,8 @@ void StorageTracker::setOriginDetails(const String& originIdentifier, const Stri
 void StorageTracker::syncSetOriginDetails(const String& originIdentifier, const String& databaseFile)
 {
     ASSERT(!isMainThread());
-#if PLATFORM(IOS)
+
     SQLiteTransactionInProgressAutoCounter transactionCounter;
-#endif
 
     MutexLocker locker(m_databaseMutex);
 
@@ -389,9 +384,8 @@ void StorageTracker::deleteAllOrigins()
 void StorageTracker::syncDeleteAllOrigins()
 {
     ASSERT(!isMainThread());
-#if PLATFORM(IOS)
+
     SQLiteTransactionInProgressAutoCounter transactionCounter;
-#endif
     
     MutexLocker locker(m_databaseMutex);
     
@@ -486,9 +480,8 @@ void StorageTracker::deleteOrigin(SecurityOrigin* origin)
 void StorageTracker::syncDeleteOrigin(const String& originIdentifier)
 {
     ASSERT(!isMainThread());
-#if PLATFORM(IOS)
+
     SQLiteTransactionInProgressAutoCounter transactionCounter;
-#endif
 
     MutexLocker locker(m_databaseMutex);
     
@@ -601,9 +594,7 @@ String StorageTracker::databasePathForOrigin(const String& originIdentifier)
     if (!m_database.isOpen())
         return String();
 
-#if PLATFORM(IOS)
     SQLiteTransactionInProgressAutoCounter transactionCounter;
-#endif
 
     SQLiteStatement pathStatement(m_database, "SELECT path FROM Origins WHERE origin=?");
     if (pathStatement.prepare() != SQLResultOk) {