<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[162787] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/162787">162787</a></dd>
<dt>Author</dt> <dd>weinig@apple.com</dd>
<dt>Date</dt> <dd>2014-01-25 16:36:23 -0800 (Sat, 25 Jan 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>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:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreGNUmakefilelistam">trunk/Source/WebCore/GNUmakefile.list.am</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseDatabaseBackendBasecpp">trunk/Source/WebCore/Modules/webdatabase/DatabaseBackendBase.cpp</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreloaderappcacheApplicationCacheStoragecpp">trunk/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollableAreah">trunk/Source/WebCore/platform/ScrollableArea.h</a></li>
<li><a href="#trunkSourceWebCorestorageStorageAreaSynccpp">trunk/Source/WebCore/storage/StorageAreaSync.cpp</a></li>
<li><a href="#trunkSourceWebCorestorageStorageTrackercpp">trunk/Source/WebCore/storage/StorageTracker.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformsqlSQLiteDatabaseTrackercpp">trunk/Source/WebCore/platform/sql/SQLiteDatabaseTracker.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformsqlSQLiteDatabaseTrackerh">trunk/Source/WebCore/platform/sql/SQLiteDatabaseTracker.h</a></li>
<li><a href="#trunkSourceWebCoreplatformsqlSQLiteDatabaseTrackerClienth">trunk/Source/WebCore/platform/sql/SQLiteDatabaseTrackerClient.h</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li>trunk/Source/WebCore/platform/sql/ios/</li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (162786 => 162787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2014-01-25 23:04:54 UTC (rev 162786)
+++ trunk/Source/WebCore/CMakeLists.txt        2014-01-26 00:36:23 UTC (rev 162787)
</span><span class="lines">@@ -2057,6 +2057,7 @@
</span><span class="cx"> platform/sql/SQLValue.cpp
</span><span class="cx"> platform/sql/SQLiteAuthorizer.cpp
</span><span class="cx"> platform/sql/SQLiteDatabase.cpp
</span><ins>+ platform/sql/SQLiteDatabaseTracker.cpp
</ins><span class="cx"> platform/sql/SQLiteFileSystem.cpp
</span><span class="cx"> platform/sql/SQLiteStatement.cpp
</span><span class="cx"> platform/sql/SQLiteTransaction.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (162786 => 162787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-01-25 23:04:54 UTC (rev 162786)
+++ trunk/Source/WebCore/ChangeLog        2014-01-26 00:36:23 UTC (rev 162787)
</span><span class="lines">@@ -1,3 +1,35 @@
</span><ins>+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:
+
</ins><span class="cx"> 2014-01-25 Anders Carlsson <andersca@apple.com>
</span><span class="cx">
</span><span class="cx"> Remove an unused FrameLoaderClient function
</span></span></pre></div>
<a id="trunkSourceWebCoreGNUmakefilelistam"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/GNUmakefile.list.am (162786 => 162787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/GNUmakefile.list.am        2014-01-25 23:04:54 UTC (rev 162786)
+++ trunk/Source/WebCore/GNUmakefile.list.am        2014-01-26 00:36:23 UTC (rev 162787)
</span><span class="lines">@@ -5478,6 +5478,9 @@
</span><span class="cx">         Source/WebCore/platform/sql/SQLiteAuthorizer.cpp \
</span><span class="cx">         Source/WebCore/platform/sql/SQLiteDatabase.cpp \
</span><span class="cx">         Source/WebCore/platform/sql/SQLiteDatabase.h \
</span><ins>+        Source/WebCore/platform/sql/SQLiteDatabaseTracker.cpp \
+        Source/WebCore/platform/sql/SQLiteDatabaseTracker.h \
+        Source/WebCore/platform/sql/SQLiteDatabaseTrackerClient.h \
</ins><span class="cx">         Source/WebCore/platform/sql/SQLiteFileSystem.cpp \
</span><span class="cx">         Source/WebCore/platform/sql/SQLiteFileSystem.h \
</span><span class="cx">         Source/WebCore/platform/sql/SQLiteStatement.cpp \
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseDatabaseBackendBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseBackendBase.cpp (162786 => 162787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/DatabaseBackendBase.cpp        2014-01-25 23:04:54 UTC (rev 162786)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseBackendBase.cpp        2014-01-26 00:36:23 UTC (rev 162787)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> #include "DatabaseTracker.h"
</span><span class="cx"> #include "ExceptionCode.h"
</span><span class="cx"> #include "Logging.h"
</span><ins>+#include "SQLiteDatabaseTracker.h"
</ins><span class="cx"> #include "SQLiteStatement.h"
</span><span class="cx"> #include "SQLiteTransaction.h"
</span><span class="cx"> #include "SecurityOrigin.h"
</span><span class="lines">@@ -52,10 +53,6 @@
</span><span class="cx"> #include <wtf/text/CString.h>
</span><span class="cx"> #include <wtf/text/StringHash.h>
</span><span class="cx">
</span><del>-#if PLATFORM(IOS)
-#include "SQLiteDatabaseTracker.h"
-#endif
-
</del><span class="cx"> // Registering "opened" databases with the DatabaseTracker
</span><span class="cx"> // =======================================================
</span><span class="cx"> // The DatabaseTracker maintains a list of databases that have been
</span><span class="lines">@@ -332,9 +329,10 @@
</span><span class="cx"> // Make sure we wait till the background removal of the empty database files finished before trying to open any database.
</span><span class="cx"> MutexLocker locker(DatabaseTracker::openDatabaseMutex());
</span><span class="cx"> }
</span><del>- SQLiteTransactionInProgressAutoCounter transactionCounter;
</del><span class="cx"> #endif
</span><span class="cx">
</span><ins>+ SQLiteTransactionInProgressAutoCounter transactionCounter;
+
</ins><span class="cx"> if (!m_sqliteDatabase.open(m_filename, true)) {
</span><span class="cx"> errorMessage = formatErrorMessage("unable to open database", m_sqliteDatabase.lastError(), m_sqliteDatabase.lastErrorMsg());
</span><span class="cx"> return false;
</span><span class="lines">@@ -587,9 +585,8 @@
</span><span class="cx">
</span><span class="cx"> void DatabaseBackendBase::incrementalVacuumIfNeeded()
</span><span class="cx"> {
</span><del>-#if PLATFORM(IOS)
</del><span class="cx"> SQLiteTransactionInProgressAutoCounter transactionCounter;
</span><del>-#endif
</del><ins>+
</ins><span class="cx"> int64_t freeSpaceSize = m_sqliteDatabase.freeSpaceSize();
</span><span class="cx"> int64_t totalSize = m_sqliteDatabase.totalSize();
</span><span class="cx"> if (totalSize <= 10 * freeSpaceSize) {
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (162786 => 162787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-01-25 23:04:54 UTC (rev 162786)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-01-26 00:36:23 UTC (rev 162787)
</span><span class="lines">@@ -8454,6 +8454,7 @@
</span><span class="cx"> </ClCompile>
</span><span class="cx"> <ClCompile Include="..\platform\sql\SQLiteAuthorizer.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\sql\SQLiteDatabase.cpp" />
</span><ins>+ <ClCompile Include="..\platform\sql\SQLiteDatabaseTracker.cpp" />
</ins><span class="cx"> <ClCompile Include="..\platform\sql\SQLiteFileSystem.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\sql\SQLiteStatement.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\sql\SQLiteTransaction.cpp" />
</span><span class="lines">@@ -19510,6 +19511,8 @@
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
</span><span class="cx"> </CustomBuildStep>
</span><span class="cx"> <ClInclude Include="..\platform\sql\SQLiteDatabase.h" />
</span><ins>+ <ClInclude Include="..\platform\sql\SQLiteDatabaseTracker.h" />
+ <ClInclude Include="..\platform\sql\SQLiteDatabaseTrackerClient.h" />
</ins><span class="cx"> <ClInclude Include="..\platform\sql\SQLiteFileSystem.h" />
</span><span class="cx"> <ClInclude Include="..\platform\sql\SQLiteStatement.h" />
</span><span class="cx"> <ClInclude Include="..\platform\sql\SQLiteTransaction.h" />
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (162786 => 162787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-01-25 23:04:54 UTC (rev 162786)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-01-26 00:36:23 UTC (rev 162787)
</span><span class="lines">@@ -1923,6 +1923,9 @@
</span><span class="cx"> <ClCompile Include="..\platform\sql\SQLiteDatabase.cpp">
</span><span class="cx"> <Filter>platform\sql</Filter>
</span><span class="cx"> </ClCompile>
</span><ins>+ <ClCompile Include="..\platform\sql\SQLiteDatabaseTracker.cpp">
+ <Filter>platform\sql</Filter>
+ </ClCompile>
</ins><span class="cx"> <ClCompile Include="..\platform\sql\SQLiteFileSystem.cpp">
</span><span class="cx"> <Filter>platform\sql</Filter>
</span><span class="cx"> </ClCompile>
</span><span class="lines">@@ -8699,6 +8702,12 @@
</span><span class="cx"> <ClInclude Include="..\platform\sql\SQLiteDatabase.h">
</span><span class="cx"> <Filter>platform\sql</Filter>
</span><span class="cx"> </ClInclude>
</span><ins>+ <ClInclude Include="..\platform\sql\SQLiteDatabaseTracker.h">
+ <Filter>platform\sql</Filter>
+ </ClInclude>
+ <ClInclude Include="..\platform\sql\SQLiteDatabaseTrackerClient.h">
+ <Filter>platform\sql</Filter>
+ </ClInclude>
</ins><span class="cx"> <ClInclude Include="..\platform\sql\SQLiteFileSystem.h">
</span><span class="cx"> <Filter>platform\sql</Filter>
</span><span class="cx"> </ClInclude>
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (162786 => 162787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-01-25 23:04:54 UTC (rev 162786)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-01-26 00:36:23 UTC (rev 162787)
</span><span class="lines">@@ -9234,9 +9234,9 @@
</span><span class="cx">                 7E428CE413E3407F003B661C /* ResourceHandleIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ResourceHandleIOS.mm; sourceTree = "<group>"; };
</span><span class="cx">                 7E46F6F81627A2C900062223 /* JSOESElementIndexUint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSOESElementIndexUint.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 7E46F6F91627A2C900062223 /* JSOESElementIndexUint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSOESElementIndexUint.h; sourceTree = "<group>"; };
</span><del>-                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>"; };
</del><ins>+                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>"; };
</ins><span class="cx">                 7E5D7A73161D3F8F00896C34 /* OESElementIndexUint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OESElementIndexUint.cpp; path = canvas/OESElementIndexUint.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 7E5D7A74161D3F8F00896C34 /* OESElementIndexUint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OESElementIndexUint.h; path = canvas/OESElementIndexUint.h; sourceTree = "<group>"; };
</span><span class="cx">                 7E66E23116D6EB6C00F7E7FF /* WebGLCompressedTextureATC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebGLCompressedTextureATC.cpp; path = canvas/WebGLCompressedTextureATC.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -14510,7 +14510,9 @@
</span><span class="cx">                 1A2E6E560CC551E0004A2062 /* sql */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><del>-                                7E474E1912494DA900235364 /* ios */,
</del><ins>+                                7E474E1D12494DC900235364 /* SQLiteDatabaseTracker.cpp */,
+                                7E474E1C12494DC900235364 /* SQLiteDatabaseTracker.h */,
+                                7E474E1B12494DC900235364 /* SQLiteDatabaseTrackerClient.h */,
</ins><span class="cx">                                 1A2E6E780CC556D5004A2062 /* SQLiteAuthorizer.cpp */,
</span><span class="cx">                                 1A2246430CC98DDB00C05240 /* SQLiteDatabase.cpp */,
</span><span class="cx">                                 1A2246440CC98DDB00C05240 /* SQLiteDatabase.h */,
</span><span class="lines">@@ -16209,17 +16211,6 @@
</span><span class="cx">                         path = icu;
</span><span class="cx">                         sourceTree = "<group>";
</span><span class="cx">                 };
</span><del>-                7E474E1912494DA900235364 /* ios */ = {
-                        isa = PBXGroup;
-                        children = (
-                                7E474E1D12494DC900235364 /* SQLiteDatabaseTracker.cpp */,
-                                7E474E1C12494DC900235364 /* SQLiteDatabaseTracker.h */,
-                                7E474E1B12494DC900235364 /* SQLiteDatabaseTrackerClient.h */,
-                        );
-                        name = ios;
-                        path = sql/ios;
-                        sourceTree = "<group>";
-                };
</del><span class="cx">                 7EE6847312D26E5500E79415 /* cf */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderappcacheApplicationCacheStoragecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp (162786 => 162787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp        2014-01-25 23:04:54 UTC (rev 162786)
+++ trunk/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp        2014-01-26 00:36:23 UTC (rev 162787)
</span><span class="lines">@@ -31,21 +31,18 @@
</span><span class="cx"> #include "ApplicationCacheHost.h"
</span><span class="cx"> #include "ApplicationCacheResource.h"
</span><span class="cx"> #include "FileSystem.h"
</span><del>-#include "URL.h"
</del><span class="cx"> #include "NotImplemented.h"
</span><ins>+#include "SQLiteDatabaseTracker.h"
</ins><span class="cx"> #include "SQLiteStatement.h"
</span><span class="cx"> #include "SQLiteTransaction.h"
</span><span class="cx"> #include "SecurityOrigin.h"
</span><ins>+#include "URL.h"
</ins><span class="cx"> #include "UUID.h"
</span><del>-#include <wtf/text/CString.h>
</del><span class="cx"> #include <wtf/StdLibExtras.h>
</span><span class="cx"> #include <wtf/StringExtras.h>
</span><ins>+#include <wtf/text/CString.h>
</ins><span class="cx"> #include <wtf/text/StringBuilder.h>
</span><span class="cx">
</span><del>-#if PLATFORM(IOS)
-#include "SQLiteDatabaseTracker.h"
-#endif
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> static const char flatFileSubdirectory[] = "ApplicationCache";
</span><span class="lines">@@ -104,10 +101,8 @@
</span><span class="cx">
</span><span class="cx"> ApplicationCacheGroup* ApplicationCacheStorage::loadCacheGroup(const URL& manifestURL)
</span><span class="cx"> {
</span><del>-#if PLATFORM(IOS)
- // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
</del><span class="cx"> SQLiteTransactionInProgressAutoCounter transactionCounter;
</span><del>-#endif
</del><ins>+
</ins><span class="cx"> openDatabase(false);
</span><span class="cx"> if (!m_database.isOpen())
</span><span class="cx"> return 0;
</span><span class="lines">@@ -182,10 +177,8 @@
</span><span class="cx"> // to avoid trying to open the database over and over if it doesn't exist.
</span><span class="cx"> hasLoadedHashes = true;
</span><span class="cx">
</span><del>-#if PLATFORM(IOS)
- // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
</del><span class="cx"> SQLiteTransactionInProgressAutoCounter transactionCounter;
</span><del>-#endif
</del><ins>+
</ins><span class="cx"> openDatabase(false);
</span><span class="cx"> if (!m_database.isOpen())
</span><span class="cx"> return;
</span><span class="lines">@@ -229,10 +222,7 @@
</span><span class="cx"> if (!m_database.isOpen())
</span><span class="cx"> return 0;
</span><span class="cx">
</span><del>-#if PLATFORM(IOS)
- // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
</del><span class="cx"> SQLiteTransactionInProgressAutoCounter transactionCounter;
</span><del>-#endif
</del><span class="cx">
</span><span class="cx"> // Check the database. Look for all cache groups with a newest cache.
</span><span class="cx"> SQLiteStatement statement(m_database, "SELECT id, manifestURL, newestCache FROM CacheGroups WHERE newestCache IS NOT NULL");
</span><span class="lines">@@ -280,10 +270,8 @@
</span><span class="cx">
</span><span class="cx"> ApplicationCacheGroup* ApplicationCacheStorage::fallbackCacheGroupForURL(const URL& url)
</span><span class="cx"> {
</span><del>-#if PLATFORM(IOS)
- // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
</del><span class="cx"> SQLiteTransactionInProgressAutoCounter transactionCounter;
</span><del>-#endif
</del><ins>+
</ins><span class="cx"> ASSERT(!url.hasFragmentIdentifier());
</span><span class="cx">
</span><span class="cx"> // Check if an appropriate cache already exists in memory.
</span><span class="lines">@@ -455,10 +443,8 @@
</span><span class="cx">
</span><span class="cx"> bool ApplicationCacheStorage::calculateQuotaForOrigin(const SecurityOrigin* origin, int64_t& quota)
</span><span class="cx"> {
</span><del>-#if PLATFORM(IOS)
- // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
</del><span class="cx"> SQLiteTransactionInProgressAutoCounter transactionCounter;
</span><del>-#endif
</del><ins>+
</ins><span class="cx"> // If an Origin record doesn't exist, then the COUNT will be 0 and quota will be 0.
</span><span class="cx"> // Using the count to determine if a record existed or not is a safe way to determine
</span><span class="cx"> // if a quota of 0 is real, from the record, or from null.
</span><span class="lines">@@ -482,10 +468,8 @@
</span><span class="cx">
</span><span class="cx"> bool ApplicationCacheStorage::calculateUsageForOrigin(const SecurityOrigin* origin, int64_t& usage)
</span><span class="cx"> {
</span><del>-#if PLATFORM(IOS)
- // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
</del><span class="cx"> SQLiteTransactionInProgressAutoCounter transactionCounter;
</span><del>-#endif
</del><ins>+
</ins><span class="cx"> // If an Origins record doesn't exist, then the SUM will be null,
</span><span class="cx"> // which will become 0, as expected, when converting to a number.
</span><span class="cx"> SQLiteStatement statement(m_database, "SELECT SUM(Caches.size)"
</span><span class="lines">@@ -510,10 +494,8 @@
</span><span class="cx">
</span><span class="cx"> bool ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache(const SecurityOrigin* origin, ApplicationCache* cache, int64_t& remainingSize)
</span><span class="cx"> {
</span><del>-#if PLATFORM(IOS)
- // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
</del><span class="cx"> SQLiteTransactionInProgressAutoCounter transactionCounter;
</span><del>-#endif
</del><ins>+
</ins><span class="cx"> openDatabase(false);
</span><span class="cx"> if (!m_database.isOpen())
</span><span class="cx"> return false;
</span><span class="lines">@@ -563,10 +545,8 @@
</span><span class="cx">
</span><span class="cx"> bool ApplicationCacheStorage::storeUpdatedQuotaForOrigin(const SecurityOrigin* origin, int64_t quota)
</span><span class="cx"> {
</span><del>-#if PLATFORM(IOS)
- // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
</del><span class="cx"> SQLiteTransactionInProgressAutoCounter transactionCounter;
</span><del>-#endif
</del><ins>+
</ins><span class="cx"> openDatabase(true);
</span><span class="cx"> if (!m_database.isOpen())
</span><span class="cx"> return false;
</span><span class="lines">@@ -633,10 +613,8 @@
</span><span class="cx">
</span><span class="cx"> void ApplicationCacheStorage::openDatabase(bool createIfDoesNotExist)
</span><span class="cx"> {
</span><del>-#if PLATFORM(IOS)
- // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
</del><span class="cx"> SQLiteTransactionInProgressAutoCounter transactionCounter;
</span><del>-#endif
</del><ins>+
</ins><span class="cx"> if (m_database.isOpen())
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -950,10 +928,8 @@
</span><span class="cx">
</span><span class="cx"> bool ApplicationCacheStorage::storeUpdatedType(ApplicationCacheResource* resource, ApplicationCache* cache)
</span><span class="cx"> {
</span><del>-#if PLATFORM(IOS)
- // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
</del><span class="cx"> SQLiteTransactionInProgressAutoCounter transactionCounter;
</span><del>-#endif
</del><ins>+
</ins><span class="cx"> ASSERT_UNUSED(cache, cache->storageID());
</span><span class="cx"> ASSERT(resource->storageID());
</span><span class="cx">
</span><span class="lines">@@ -970,10 +946,8 @@
</span><span class="cx">
</span><span class="cx"> bool ApplicationCacheStorage::store(ApplicationCacheResource* resource, ApplicationCache* cache)
</span><span class="cx"> {
</span><del>-#if PLATFORM(IOS)
- // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
</del><span class="cx"> SQLiteTransactionInProgressAutoCounter transactionCounter;
</span><del>-#endif
</del><ins>+
</ins><span class="cx"> ASSERT(cache->storageID());
</span><span class="cx">
</span><span class="cx"> openDatabase(true);
</span><span class="lines">@@ -1270,10 +1244,8 @@
</span><span class="cx">
</span><span class="cx"> void ApplicationCacheStorage::remove(ApplicationCache* cache)
</span><span class="cx"> {
</span><del>-#if PLATFORM(IOS)
- // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
</del><span class="cx"> SQLiteTransactionInProgressAutoCounter transactionCounter;
</span><del>-#endif
</del><ins>+
</ins><span class="cx"> if (!cache->storageID())
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -1311,10 +1283,8 @@
</span><span class="cx">
</span><span class="cx"> void ApplicationCacheStorage::empty()
</span><span class="cx"> {
</span><del>-#if PLATFORM(IOS)
- // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
</del><span class="cx"> SQLiteTransactionInProgressAutoCounter transactionCounter;
</span><del>-#endif
</del><ins>+
</ins><span class="cx"> openDatabase(false);
</span><span class="cx">
</span><span class="cx"> if (!m_database.isOpen())
</span><span class="lines">@@ -1379,10 +1349,8 @@
</span><span class="cx">
</span><span class="cx"> bool ApplicationCacheStorage::storeCopyOfCache(const String& cacheDirectory, ApplicationCacheHost* cacheHost)
</span><span class="cx"> {
</span><del>-#if PLATFORM(IOS)
- // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
</del><span class="cx"> SQLiteTransactionInProgressAutoCounter transactionCounter;
</span><del>-#endif
</del><ins>+
</ins><span class="cx"> ApplicationCache* cache = cacheHost->applicationCache();
</span><span class="cx"> if (!cache)
</span><span class="cx"> return true;
</span><span class="lines">@@ -1419,10 +1387,8 @@
</span><span class="cx">
</span><span class="cx"> bool ApplicationCacheStorage::manifestURLs(Vector<URL>* urls)
</span><span class="cx"> {
</span><del>-#if PLATFORM(IOS)
- // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
</del><span class="cx"> SQLiteTransactionInProgressAutoCounter transactionCounter;
</span><del>-#endif
</del><ins>+
</ins><span class="cx"> ASSERT(urls);
</span><span class="cx"> openDatabase(false);
</span><span class="cx"> if (!m_database.isOpen())
</span><span class="lines">@@ -1441,10 +1407,8 @@
</span><span class="cx">
</span><span class="cx"> bool ApplicationCacheStorage::cacheGroupSize(const String& manifestURL, int64_t* size)
</span><span class="cx"> {
</span><del>-#if PLATFORM(IOS)
- // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
</del><span class="cx"> SQLiteTransactionInProgressAutoCounter transactionCounter;
</span><del>-#endif
</del><ins>+
</ins><span class="cx"> ASSERT(size);
</span><span class="cx"> openDatabase(false);
</span><span class="cx"> if (!m_database.isOpen())
</span><span class="lines">@@ -1471,10 +1435,8 @@
</span><span class="cx">
</span><span class="cx"> bool ApplicationCacheStorage::deleteCacheGroup(const String& manifestURL)
</span><span class="cx"> {
</span><del>-#if PLATFORM(IOS)
- // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
</del><span class="cx"> SQLiteTransactionInProgressAutoCounter transactionCounter;
</span><del>-#endif
</del><ins>+
</ins><span class="cx"> SQLiteTransaction deleteTransaction(m_database);
</span><span class="cx"> // Check to see if the group is in memory.
</span><span class="cx"> ApplicationCacheGroup* group = m_cachesInMemory.get(manifestURL);
</span><span class="lines">@@ -1526,10 +1488,8 @@
</span><span class="cx">
</span><span class="cx"> void ApplicationCacheStorage::vacuumDatabaseFile()
</span><span class="cx"> {
</span><del>-#if PLATFORM(IOS)
- // FIXME: Move the PLATFORM(IOS)-guards inside the constructor and destructor of SQLiteTransactionInProgressAutoCounter.
</del><span class="cx"> SQLiteTransactionInProgressAutoCounter transactionCounter;
</span><del>-#endif
</del><ins>+
</ins><span class="cx"> openDatabase(false);
</span><span class="cx"> if (!m_database.isOpen())
</span><span class="cx"> return;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollableAreah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollableArea.h (162786 => 162787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollableArea.h        2014-01-25 23:04:54 UTC (rev 162786)
+++ trunk/Source/WebCore/platform/ScrollableArea.h        2014-01-26 00:36:23 UTC (rev 162787)
</span><span class="lines">@@ -254,6 +254,8 @@
</span><span class="cx"> bool hasLayerForVerticalScrollbar() const;
</span><span class="cx"> bool hasLayerForScrollCorner() const;
</span><span class="cx">
</span><ins>+ virtual void sendWillRevealEdgeEventsIfNeeded(const IntPoint&, const IntPoint&) { }
+
</ins><span class="cx"> private:
</span><span class="cx"> virtual IntRect visibleContentRectInternal(VisibleContentRectIncludesScrollbars, VisibleContentRectBehavior) const;
</span><span class="cx"> void scrollPositionChanged(const IntPoint&);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformsqlSQLiteDatabaseTrackercppfromrev162767trunkSourceWebCoreplatformsqliosSQLiteDatabaseTrackercpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/sql/SQLiteDatabaseTracker.cpp (from rev 162767, trunk/Source/WebCore/platform/sql/ios/SQLiteDatabaseTracker.cpp) (0 => 162787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/sql/SQLiteDatabaseTracker.cpp         (rev 0)
+++ trunk/Source/WebCore/platform/sql/SQLiteDatabaseTracker.cpp        2014-01-26 00:36:23 UTC (rev 162787)
</span><span class="lines">@@ -0,0 +1,87 @@
</span><ins>+/*
+ * Copyright (C) 2010, 2012 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 INC. OR
+ * 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 "SQLiteDatabaseTracker.h"
+
+#include <mutex>
+#include <wtf/NeverDestroyed.h>
+
+namespace WebCore {
+
+namespace SQLiteDatabaseTracker {
+
+static SQLiteDatabaseTrackerClient* s_staticSQLiteDatabaseTrackerClient = nullptr;
+static unsigned s_transactionInProgressCounter = 0;
+
+static std::mutex& transactionInProgressMutex()
+{
+ static NeverDestroyed<std::mutex> tipMutex;
+ return tipMutex;
+}
+
+void setClient(SQLiteDatabaseTrackerClient* client)
+{
+ ASSERT(client);
+ ASSERT(!s_staticSQLiteDatabaseTrackerClient || s_staticSQLiteDatabaseTrackerClient == client);
+ s_staticSQLiteDatabaseTrackerClient = client;
+}
+
+void incrementTransactionInProgressCount()
+{
+ if (!s_staticSQLiteDatabaseTrackerClient)
+ return;
+
+ std::lock_guard<std::mutex> lock(transactionInProgressMutex());
+
+ s_transactionInProgressCounter++;
+ if (s_transactionInProgressCounter == 1)
+ s_staticSQLiteDatabaseTrackerClient->willBeginFirstTransaction();
+}
+
+void decrementTransactionInProgressCount()
+{
+ if (!s_staticSQLiteDatabaseTrackerClient)
+ return;
+
+ std::lock_guard<std::mutex> lock(transactionInProgressMutex());
+
+ ASSERT(s_transactionInProgressCounter);
+ s_transactionInProgressCounter--;
+
+ if (!s_transactionInProgressCounter)
+ s_staticSQLiteDatabaseTrackerClient->didFinishLastTransaction();
+}
+
+#if !ASSERT_DISABLED
+bool hasTransactionInProgress()
+{
+ return !s_staticSQLiteDatabaseTrackerClient || s_transactionInProgressCounter > 0;
+}
+#endif
+
+} // namespace SQLiteDatabaseTracker
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformsqlSQLiteDatabaseTrackerhfromrev162767trunkSourceWebCoreplatformsqliosSQLiteDatabaseTrackerh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/sql/SQLiteDatabaseTracker.h (from rev 162767, trunk/Source/WebCore/platform/sql/ios/SQLiteDatabaseTracker.h) (0 => 162787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/sql/SQLiteDatabaseTracker.h         (rev 0)
+++ trunk/Source/WebCore/platform/sql/SQLiteDatabaseTracker.h        2014-01-26 00:36:23 UTC (rev 162787)
</span><span class="lines">@@ -0,0 +1,60 @@
</span><ins>+/*
+ * Copyright (C) 2010, 2012 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 INC. OR
+ * 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 SQLiteDatabaseTracker_h
+#define SQLiteDatabaseTracker_h
+
+#include "SQLiteDatabaseTrackerClient.h"
+
+namespace WebCore {
+
+namespace SQLiteDatabaseTracker {
+
+void decrementTransactionInProgressCount();
+void incrementTransactionInProgressCount();
+
+void setClient(SQLiteDatabaseTrackerClient*);
+
+#if !ASSERT_DISABLED
+bool hasTransactionInProgress();
+#endif
+
+};
+
+class SQLiteTransactionInProgressAutoCounter {
+public:
+ SQLiteTransactionInProgressAutoCounter()
+ {
+ SQLiteDatabaseTracker::incrementTransactionInProgressCount();
+ }
+ ~SQLiteTransactionInProgressAutoCounter()
+ {
+ SQLiteDatabaseTracker::decrementTransactionInProgressCount();
+ }
+};
+
+} // namespace WebCore
+
+#endif // SQLiteDatabaseTracker_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformsqlSQLiteDatabaseTrackerClienthfromrev162767trunkSourceWebCoreplatformsqliosSQLiteDatabaseTrackerClienth"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/sql/SQLiteDatabaseTrackerClient.h (from rev 162767, trunk/Source/WebCore/platform/sql/ios/SQLiteDatabaseTrackerClient.h) (0 => 162787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/sql/SQLiteDatabaseTrackerClient.h         (rev 0)
+++ trunk/Source/WebCore/platform/sql/SQLiteDatabaseTrackerClient.h        2014-01-26 00:36:23 UTC (rev 162787)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+/*
+ * Copyright (C) 2010 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 INC. OR
+ * 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 SQLiteDatabaseTrackerClient_h
+#define SQLiteDatabaseTrackerClient_h
+
+namespace WebCore {
+
+class SQLiteDatabaseTrackerClient {
+public:
+ virtual ~SQLiteDatabaseTrackerClient() { }
+
+ virtual void willBeginFirstTransaction() = 0;
+ virtual void didFinishLastTransaction() = 0;
+};
+
+} // namespace WebCore
+
+#endif // SQLiteDatabaseTrackerClient_h
</ins></span></pre></div>
<a id="trunkSourceWebCorestorageStorageAreaSynccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/storage/StorageAreaSync.cpp (162786 => 162787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/storage/StorageAreaSync.cpp        2014-01-25 23:04:54 UTC (rev 162786)
+++ trunk/Source/WebCore/storage/StorageAreaSync.cpp        2014-01-26 00:36:23 UTC (rev 162787)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #include "EventNames.h"
</span><span class="cx"> #include "FileSystem.h"
</span><span class="cx"> #include "HTMLElement.h"
</span><ins>+#include "SQLiteDatabaseTracker.h"
</ins><span class="cx"> #include "SQLiteFileSystem.h"
</span><span class="cx"> #include "SQLiteStatement.h"
</span><span class="cx"> #include "SQLiteTransaction.h"
</span><span class="lines">@@ -41,10 +42,6 @@
</span><span class="cx"> #include <wtf/MainThread.h>
</span><span class="cx"> #include <wtf/text/CString.h>
</span><span class="cx">
</span><del>-#if PLATFORM(IOS)
-#include "SQLiteDatabaseTracker.h"
-#endif
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> // If the StorageArea undergoes rapid changes, don't sync each change to disk.
</span><span class="lines">@@ -236,9 +233,8 @@
</span><span class="cx"> ASSERT(!m_database.isOpen());
</span><span class="cx"> ASSERT(!m_databaseOpenFailed);
</span><span class="cx">
</span><del>-#if PLATFORM(IOS)
</del><span class="cx"> SQLiteTransactionInProgressAutoCounter transactionCounter;
</span><del>-#endif
</del><ins>+
</ins><span class="cx"> String databaseFilename = m_syncManager->fullDatabaseFilename(m_databaseIdentifier);
</span><span class="cx">
</span><span class="cx"> if (!fileExists(databaseFilename) && openingStrategy == SkipIfNonExistent)
</span><span class="lines">@@ -410,9 +406,8 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#if PLATFORM(IOS)
</del><span class="cx"> SQLiteTransactionInProgressAutoCounter transactionCounter;
</span><del>-#endif
</del><ins>+
</ins><span class="cx"> // If the clear flag is set, then we clear all items out before we write any new ones in.
</span><span class="cx"> if (clearItems) {
</span><span class="cx"> SQLiteStatement clear(m_database, "DELETE FROM ItemTable");
</span></span></pre></div>
<a id="trunkSourceWebCorestorageStorageTrackercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/storage/StorageTracker.cpp (162786 => 162787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/storage/StorageTracker.cpp        2014-01-25 23:04:54 UTC (rev 162786)
+++ trunk/Source/WebCore/storage/StorageTracker.cpp        2014-01-26 00:36:23 UTC (rev 162787)
</span><span class="lines">@@ -28,12 +28,13 @@
</span><span class="cx">
</span><span class="cx"> #include "DatabaseThread.h"
</span><span class="cx"> #include "FileSystem.h"
</span><del>-#include "StorageThread.h"
</del><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "PageGroup.h"
</span><ins>+#include "SQLiteDatabaseTracker.h"
</ins><span class="cx"> #include "SQLiteFileSystem.h"
</span><span class="cx"> #include "SQLiteStatement.h"
</span><span class="cx"> #include "SecurityOrigin.h"
</span><ins>+#include "StorageThread.h"
</ins><span class="cx"> #include "StorageTrackerClient.h"
</span><span class="cx"> #include "TextEncoding.h"
</span><span class="cx"> #include <wtf/Functional.h>
</span><span class="lines">@@ -42,10 +43,6 @@
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx"> #include <wtf/text/CString.h>
</span><span class="cx">
</span><del>-#if PLATFORM(IOS)
-#include "SQLiteDatabaseTracker.h"
-#endif
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> static StorageTracker* storageTracker = 0;
</span><span class="lines">@@ -136,9 +133,9 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(m_isActive);
</span><span class="cx"> ASSERT(!isMainThread());
</span><del>-#if PLATFORM(IOS)
</del><ins>+
</ins><span class="cx"> SQLiteTransactionInProgressAutoCounter transactionCounter;
</span><del>-#endif
</del><ins>+
</ins><span class="cx"> ASSERT(!m_databaseMutex.tryLock());
</span><span class="cx">
</span><span class="cx"> if (m_database.isOpen())
</span><span class="lines">@@ -199,9 +196,8 @@
</span><span class="cx"> openTrackerDatabase(false);
</span><span class="cx">
</span><span class="cx"> if (m_database.isOpen()) {
</span><del>-#if PLATFORM(IOS)
</del><span class="cx"> SQLiteTransactionInProgressAutoCounter transactionCounter;
</span><del>-#endif
</del><ins>+
</ins><span class="cx"> SQLiteStatement statement(m_database, "SELECT origin FROM Origins");
</span><span class="cx"> if (statement.prepare() != SQLResultOk) {
</span><span class="cx"> LOG_ERROR("Failed to prepare statement.");
</span><span class="lines">@@ -242,9 +238,9 @@
</span><span class="cx"> void StorageTracker::syncFileSystemAndTrackerDatabase()
</span><span class="cx"> {
</span><span class="cx"> ASSERT(!isMainThread());
</span><del>-#if PLATFORM(IOS)
</del><ins>+
</ins><span class="cx"> SQLiteTransactionInProgressAutoCounter transactionCounter;
</span><del>-#endif
</del><ins>+
</ins><span class="cx"> ASSERT(m_isActive);
</span><span class="cx">
</span><span class="cx"> Vector<String> paths;
</span><span class="lines">@@ -317,9 +313,8 @@
</span><span class="cx"> void StorageTracker::syncSetOriginDetails(const String& originIdentifier, const String& databaseFile)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(!isMainThread());
</span><del>-#if PLATFORM(IOS)
</del><ins>+
</ins><span class="cx"> SQLiteTransactionInProgressAutoCounter transactionCounter;
</span><del>-#endif
</del><span class="cx">
</span><span class="cx"> MutexLocker locker(m_databaseMutex);
</span><span class="cx">
</span><span class="lines">@@ -389,9 +384,8 @@
</span><span class="cx"> void StorageTracker::syncDeleteAllOrigins()
</span><span class="cx"> {
</span><span class="cx"> ASSERT(!isMainThread());
</span><del>-#if PLATFORM(IOS)
</del><ins>+
</ins><span class="cx"> SQLiteTransactionInProgressAutoCounter transactionCounter;
</span><del>-#endif
</del><span class="cx">
</span><span class="cx"> MutexLocker locker(m_databaseMutex);
</span><span class="cx">
</span><span class="lines">@@ -486,9 +480,8 @@
</span><span class="cx"> void StorageTracker::syncDeleteOrigin(const String& originIdentifier)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(!isMainThread());
</span><del>-#if PLATFORM(IOS)
</del><ins>+
</ins><span class="cx"> SQLiteTransactionInProgressAutoCounter transactionCounter;
</span><del>-#endif
</del><span class="cx">
</span><span class="cx"> MutexLocker locker(m_databaseMutex);
</span><span class="cx">
</span><span class="lines">@@ -601,9 +594,7 @@
</span><span class="cx"> if (!m_database.isOpen())
</span><span class="cx"> return String();
</span><span class="cx">
</span><del>-#if PLATFORM(IOS)
</del><span class="cx"> SQLiteTransactionInProgressAutoCounter transactionCounter;
</span><del>-#endif
</del><span class="cx">
</span><span class="cx"> SQLiteStatement pathStatement(m_database, "SELECT path FROM Origins WHERE origin=?");
</span><span class="cx"> if (pathStatement.prepare() != SQLResultOk) {
</span></span></pre>
</div>
</div>
</body>
</html>