Remove more unnecessary #if PLATFORM(IOS)s in ApplicationCacheStorage.cpp
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 26 Jan 2014 00:50:21 +0000 (00:50 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 26 Jan 2014 00:50:21 +0000 (00:50 +0000)
https://bugs.webkit.org/show_bug.cgi?id=127635

Reviewed by Antti Koivisto.

* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::executeSQLCommand):
(WebCore::ApplicationCacheStorage::verifySchemaVersion):
(WebCore::ApplicationCacheStorage::executeStatement):
(WebCore::ApplicationCacheStorage::store):
(WebCore::ApplicationCacheStorage::ensureOriginRecord):
(WebCore::ApplicationCacheStorage::loadCache):

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

Source/WebCore/ChangeLog
Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp

index d24120b..aea1015 100644 (file)
@@ -1,5 +1,20 @@
 2014-01-25  Sam Weinig  <sam@webkit.org>
 
+        Remove more unnecessary #if PLATFORM(IOS)s in ApplicationCacheStorage.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=127635
+
+        Reviewed by Antti Koivisto.
+
+        * loader/appcache/ApplicationCacheStorage.cpp:
+        (WebCore::ApplicationCacheStorage::executeSQLCommand):
+        (WebCore::ApplicationCacheStorage::verifySchemaVersion):
+        (WebCore::ApplicationCacheStorage::executeStatement):
+        (WebCore::ApplicationCacheStorage::store):
+        (WebCore::ApplicationCacheStorage::ensureOriginRecord):
+        (WebCore::ApplicationCacheStorage::loadCache):
+
+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
 
index 40553ec..b82853a 100644 (file)
@@ -566,9 +566,7 @@ bool ApplicationCacheStorage::storeUpdatedQuotaForOrigin(const SecurityOrigin* o
 
 bool ApplicationCacheStorage::executeSQLCommand(const String& sql)
 {
-#if PLATFORM(IOS)
     ASSERT(SQLiteDatabaseTracker::hasTransactionInProgress());
-#endif
     ASSERT(m_database.isOpen());
     
     bool result = m_database.executeCommand(sql);
@@ -586,9 +584,8 @@ static const int schemaVersion = 7;
     
 void ApplicationCacheStorage::verifySchemaVersion()
 {
-#if PLATFORM(IOS)
     ASSERT(SQLiteDatabaseTracker::hasTransactionInProgress());
-#endif
+
     int version = SQLiteStatement(m_database, "PRAGMA user_version").getColumnInt(0);
     if (version == schemaVersion)
         return;
@@ -682,9 +679,7 @@ void ApplicationCacheStorage::openDatabase(bool createIfDoesNotExist)
 
 bool ApplicationCacheStorage::executeStatement(SQLiteStatement& statement)
 {
-#if PLATFORM(IOS)
     ASSERT(SQLiteDatabaseTracker::hasTransactionInProgress());
-#endif
     bool result = statement.executeCommand();
     if (!result)
         LOG_ERROR("Application Cache Storage: failed to execute statement \"%s\" error \"%s\"", 
@@ -695,9 +690,7 @@ bool ApplicationCacheStorage::executeStatement(SQLiteStatement& statement)
 
 bool ApplicationCacheStorage::store(ApplicationCacheGroup* group, GroupStorageIDJournal* journal)
 {
-#if PLATFORM(IOS)
     ASSERT(SQLiteDatabaseTracker::hasTransactionInProgress());
-#endif
     ASSERT(group->storageID() == 0);
     ASSERT(journal);
 
@@ -724,9 +717,7 @@ bool ApplicationCacheStorage::store(ApplicationCacheGroup* group, GroupStorageID
 
 bool ApplicationCacheStorage::store(ApplicationCache* cache, ResourceStorageIDJournal* storageIDJournal)
 {
-#if PLATFORM(IOS)
     ASSERT(SQLiteDatabaseTracker::hasTransactionInProgress());
-#endif
     ASSERT(cache->storageID() == 0);
     ASSERT(cache->group()->storageID() != 0);
     ASSERT(storageIDJournal);
@@ -808,9 +799,7 @@ bool ApplicationCacheStorage::store(ApplicationCache* cache, ResourceStorageIDJo
 
 bool ApplicationCacheStorage::store(ApplicationCacheResource* resource, unsigned cacheStorageID)
 {
-#if PLATFORM(IOS)
     ASSERT(SQLiteDatabaseTracker::hasTransactionInProgress());
-#endif
     ASSERT(cacheStorageID);
     ASSERT(!resource->storageID());
     
@@ -983,9 +972,7 @@ bool ApplicationCacheStorage::store(ApplicationCacheResource* resource, Applicat
 
 bool ApplicationCacheStorage::ensureOriginRecord(const SecurityOrigin* origin)
 {
-#if PLATFORM(IOS)
     ASSERT(SQLiteDatabaseTracker::hasTransactionInProgress());
-#endif
     SQLiteStatement insertOriginStatement(m_database, "INSERT INTO Origins (origin, quota) VALUES (?, ?)");
     if (insertOriginStatement.prepare() != SQLResultOk)
         return false;
@@ -1133,10 +1120,8 @@ static inline void parseHeaders(const String& headers, ResourceResponse& respons
     
 PassRefPtr<ApplicationCache> ApplicationCacheStorage::loadCache(unsigned storageID)
 {
-#if PLATFORM(IOS)
     ASSERT(SQLiteDatabaseTracker::hasTransactionInProgress());
-#endif
-    SQLiteStatement cacheStatement(m_database, 
+    SQLiteStatement cacheStatement(m_database,
                                    "SELECT url, statusCode, type, mimeType, textEncodingName, headers, CacheResourceData.data, CacheResourceData.path FROM CacheEntries INNER JOIN CacheResources ON CacheEntries.resource=CacheResources.id "
                                    "INNER JOIN CacheResourceData ON CacheResourceData.id=CacheResources.data WHERE CacheEntries.cache=?");
     if (cacheStatement.prepare() != SQLResultOk) {