<!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>[188045] 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/188045">188045</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2015-08-06 10:55:53 -0700 (Thu, 06 Aug 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move the last remnants of DatabaseBackendBase to Database
https://bugs.webkit.org/show_bug.cgi?id=147730

Reviewed by Tim Horton.

* Modules/webdatabase/Database.cpp:
(WebCore::Database::Database):
(WebCore::Database::performOpenAndVerify):
* Modules/webdatabase/Database.h:
* Modules/webdatabase/DatabaseBackendBase.cpp:
(WebCore::DatabaseBackendBase::DatabaseBackendBase):
* Modules/webdatabase/DatabaseBackendBase.h:
(WebCore::DatabaseBackendBase::databaseContext): Deleted.
(WebCore::DatabaseBackendBase::setFrontend): Deleted.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseDatabasecpp">trunk/Source/WebCore/Modules/webdatabase/Database.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseDatabaseh">trunk/Source/WebCore/Modules/webdatabase/Database.h</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseDatabaseBackendBasecpp">trunk/Source/WebCore/Modules/webdatabase/DatabaseBackendBase.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseDatabaseBackendBaseh">trunk/Source/WebCore/Modules/webdatabase/DatabaseBackendBase.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (188044 => 188045)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-08-06 17:44:45 UTC (rev 188044)
+++ trunk/Source/WebCore/ChangeLog        2015-08-06 17:55:53 UTC (rev 188045)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2015-08-06  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Move the last remnants of DatabaseBackendBase to Database
+        https://bugs.webkit.org/show_bug.cgi?id=147730
+
+        Reviewed by Tim Horton.
+
+        * Modules/webdatabase/Database.cpp:
+        (WebCore::Database::Database):
+        (WebCore::Database::performOpenAndVerify):
+        * Modules/webdatabase/Database.h:
+        * Modules/webdatabase/DatabaseBackendBase.cpp:
+        (WebCore::DatabaseBackendBase::DatabaseBackendBase):
+        * Modules/webdatabase/DatabaseBackendBase.h:
+        (WebCore::DatabaseBackendBase::databaseContext): Deleted.
+        (WebCore::DatabaseBackendBase::setFrontend): Deleted.
+
</ins><span class="cx"> 2015-08-06  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix build without ENABLE(VIDEO) after r188030.
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/Database.cpp (188044 => 188045)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/Database.cpp        2015-08-06 17:44:45 UTC (rev 188044)
+++ trunk/Source/WebCore/Modules/webdatabase/Database.cpp        2015-08-06 17:55:53 UTC (rev 188045)
</span><span class="lines">@@ -60,6 +60,35 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+// Registering &quot;opened&quot; databases with the DatabaseTracker
+// =======================================================
+// The DatabaseTracker maintains a list of databases that have been
+// &quot;opened&quot; so that the client can call interrupt or delete on every database
+// associated with a DatabaseContext.
+//
+// We will only call DatabaseTracker::addOpenDatabase() to add the database
+// to the tracker as opened when we've succeeded in opening the database,
+// and will set m_opened to true. Similarly, we only call
+// DatabaseTracker::removeOpenDatabase() to remove the database from the
+// tracker when we set m_opened to false in closeDatabase(). This sets up
+// a simple symmetry between open and close operations, and a direct
+// correlation to adding and removing databases from the tracker's list,
+// thus ensuring that we have a correct list for the interrupt and
+// delete operations to work on.
+//
+// The only databases instances not tracked by the tracker's open database
+// list are the ones that have not been added yet, or the ones that we
+// attempted an open on but failed to. Such instances only exist in the
+// DatabaseServer's factory methods for creating database backends.
+//
+// The factory methods will either call openAndVerifyVersion() or
+// performOpenAndVerify(). These methods will add the newly instantiated
+// database backend if they succeed in opening the requested database.
+// In the case of failure to open the database, the factory methods will
+// simply discard the newly instantiated database backend when they return.
+// The ref counting mechanims will automatically destruct the un-added
+// (and un-returned) databases instances.
+
</ins><span class="cx"> static const char versionKey[] = &quot;WebKitDatabaseVersionKey&quot;;
</span><span class="cx"> static const char unqualifiedInfoTableName[] = &quot;__WebKitDatabaseInfoTable__&quot;;
</span><span class="cx"> 
</span><span class="lines">@@ -184,12 +213,17 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Database::Database(PassRefPtr&lt;DatabaseContext&gt; databaseContext, const String&amp; name, const String&amp; expectedVersion, const String&amp; displayName, unsigned long estimatedSize)
</span><del>-    : DatabaseBackendBase(databaseContext.get(), name, expectedVersion, displayName, estimatedSize)
</del><ins>+    : m_scriptExecutionContext(databaseContext-&gt;scriptExecutionContext())
+    , m_databaseContext(databaseContext)
+    , m_deleted(false)
+    , m_name(name.isolatedCopy())
+    , m_expectedVersion(expectedVersion.isolatedCopy())
+    , m_displayName(displayName.isolatedCopy())
+    , m_estimatedSize(estimatedSize)
+    , m_opened(false)
+    , m_new(false)
</ins><span class="cx">     , m_transactionInProgress(false)
</span><span class="cx">     , m_isTransactionQueueEnabled(true)
</span><del>-    , m_scriptExecutionContext(databaseContext-&gt;scriptExecutionContext())
-    , m_databaseContext(databaseContext)
-    , m_deleted(false)
</del><span class="cx"> {
</span><span class="cx">     m_contextThreadSecurityOrigin = m_databaseContext-&gt;securityOrigin()-&gt;isolatedCopy();
</span><span class="cx"> 
</span><span class="lines">@@ -211,7 +245,6 @@
</span><span class="cx">     m_filename = DatabaseManager::singleton().fullPathForDatabase(securityOrigin(), m_name);
</span><span class="cx"> 
</span><span class="cx">     m_databaseThreadSecurityOrigin = m_contextThreadSecurityOrigin-&gt;isolatedCopy();
</span><del>-    setFrontend(this);
</del><span class="cx"> 
</span><span class="cx">     ASSERT(m_databaseContext-&gt;databaseThread());
</span><span class="cx"> }
</span><span class="lines">@@ -365,7 +398,7 @@
</span><span class="cx">                     m_sqliteDatabase.close();
</span><span class="cx">                     return false;
</span><span class="cx">                 }
</span><del>-            } else if (!m_frontend-&gt;getVersionFromDatabase(currentVersion, false)) {
</del><ins>+            } else if (!getVersionFromDatabase(currentVersion, false)) {
</ins><span class="cx">                 errorMessage = formatErrorMessage(&quot;unable to open database, failed to read current version&quot;, m_sqliteDatabase.lastError(), m_sqliteDatabase.lastErrorMsg());
</span><span class="cx">                 transaction.rollback();
</span><span class="cx">                 m_sqliteDatabase.close();
</span><span class="lines">@@ -376,7 +409,7 @@
</span><span class="cx">                 LOG(StorageAPI, &quot;Retrieved current version %s from database %s&quot;, currentVersion.ascii().data(), databaseDebugName().ascii().data());
</span><span class="cx">             } else if (!m_new || shouldSetVersionInNewDatabase) {
</span><span class="cx">                 LOG(StorageAPI, &quot;Setting version %s in database %s that was just created&quot;, m_expectedVersion.ascii().data(), databaseDebugName().ascii().data());
</span><del>-                if (!m_frontend-&gt;setVersionInDatabase(m_expectedVersion, false)) {
</del><ins>+                if (!setVersionInDatabase(m_expectedVersion, false)) {
</ins><span class="cx">                     errorMessage = formatErrorMessage(&quot;unable to open database, failed to write current version&quot;, m_sqliteDatabase.lastError(), m_sqliteDatabase.lastErrorMsg());
</span><span class="cx">                     transaction.rollback();
</span><span class="cx">                     m_sqliteDatabase.close();
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseDatabaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/Database.h (188044 => 188045)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/Database.h        2015-08-06 17:44:45 UTC (rev 188044)
+++ trunk/Source/WebCore/Modules/webdatabase/Database.h        2015-08-06 17:55:53 UTC (rev 188045)
</span><span class="lines">@@ -138,18 +138,33 @@
</span><span class="cx">     String databaseDebugName() const;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    Deque&lt;RefPtr&lt;SQLTransactionBackend&gt;&gt; m_transactionQueue;
-    Mutex m_transactionInProgressMutex;
-    bool m_transactionInProgress;
-    bool m_isTransactionQueueEnabled;
-
</del><span class="cx">     RefPtr&lt;ScriptExecutionContext&gt; m_scriptExecutionContext;
</span><ins>+    RefPtr&lt;SecurityOrigin&gt; m_contextThreadSecurityOrigin;
</ins><span class="cx">     RefPtr&lt;SecurityOrigin&gt; m_databaseThreadSecurityOrigin;
</span><span class="cx">     RefPtr&lt;DatabaseContext&gt; m_databaseContext;
</span><span class="cx"> 
</span><span class="cx">     bool m_deleted;
</span><span class="cx">     bool m_hasPendingCreationEvent { false };
</span><span class="cx"> 
</span><ins>+    String m_name;
+    String m_expectedVersion;
+    String m_displayName;
+    unsigned long m_estimatedSize;
+    String m_filename;
+
+    DatabaseGuid m_guid;
+    bool m_opened;
+    bool m_new;
+
+    SQLiteDatabase m_sqliteDatabase;
+
+    RefPtr&lt;DatabaseAuthorizer&gt; m_databaseAuthorizer;
+
+    Deque&lt;RefPtr&lt;SQLTransactionBackend&gt;&gt; m_transactionQueue;
+    Mutex m_transactionInProgressMutex;
+    bool m_transactionInProgress;
+    bool m_isTransactionQueueEnabled;
+
</ins><span class="cx">     friend class ChangeVersionWrapper;
</span><span class="cx">     friend class DatabaseBackendBase;
</span><span class="cx">     friend class DatabaseManager;
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseDatabaseBackendBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseBackendBase.cpp (188044 => 188045)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/DatabaseBackendBase.cpp        2015-08-06 17:44:45 UTC (rev 188044)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseBackendBase.cpp        2015-08-06 17:55:53 UTC (rev 188045)
</span><span class="lines">@@ -49,45 +49,9 @@
</span><span class="cx"> #include &lt;wtf/text/CString.h&gt;
</span><span class="cx"> #include &lt;wtf/text/StringHash.h&gt;
</span><span class="cx"> 
</span><del>-// Registering &quot;opened&quot; databases with the DatabaseTracker
-// =======================================================
-// The DatabaseTracker maintains a list of databases that have been
-// &quot;opened&quot; so that the client can call interrupt or delete on every database
-// associated with a DatabaseContext.
-//
-// We will only call DatabaseTracker::addOpenDatabase() to add the database
-// to the tracker as opened when we've succeeded in opening the database,
-// and will set m_opened to true. Similarly, we only call
-// DatabaseTracker::removeOpenDatabase() to remove the database from the
-// tracker when we set m_opened to false in closeDatabase(). This sets up
-// a simple symmetry between open and close operations, and a direct
-// correlation to adding and removing databases from the tracker's list,
-// thus ensuring that we have a correct list for the interrupt and
-// delete operations to work on.
-//
-// The only databases instances not tracked by the tracker's open database
-// list are the ones that have not been added yet, or the ones that we
-// attempted an open on but failed to. Such instances only exist in the
-// DatabaseServer's factory methods for creating database backends.
-//
-// The factory methods will either call openAndVerifyVersion() or
-// performOpenAndVerify(). These methods will add the newly instantiated
-// database backend if they succeed in opening the requested database.
-// In the case of failure to open the database, the factory methods will
-// simply discard the newly instantiated database backend when they return.
-// The ref counting mechanims will automatically destruct the un-added
-// (and un-returned) databases instances.
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-DatabaseBackendBase::DatabaseBackendBase(PassRefPtr&lt;DatabaseContext&gt; databaseContext, const String&amp; name, const String&amp; expectedVersion, const String&amp; displayName, unsigned long estimatedSize)
-    : m_databaseContext(databaseContext)
-    , m_name(name.isolatedCopy())
-    , m_expectedVersion(expectedVersion.isolatedCopy())
-    , m_displayName(displayName.isolatedCopy())
-    , m_estimatedSize(estimatedSize)
-    , m_opened(false)
-    , m_new(false)
</del><ins>+DatabaseBackendBase::DatabaseBackendBase()
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseDatabaseBackendBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseBackendBase.h (188044 => 188045)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/DatabaseBackendBase.h        2015-08-06 17:44:45 UTC (rev 188044)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseBackendBase.h        2015-08-06 17:55:53 UTC (rev 188045)
</span><span class="lines">@@ -51,9 +51,6 @@
</span><span class="cx">     virtual ~DatabaseBackendBase();
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-    DatabaseContext* databaseContext() const { return m_databaseContext.get(); }
-    void setFrontend(Database* frontend) { m_frontend = frontend; }
-
</del><span class="cx"> protected:
</span><span class="cx">     friend class ChangeVersionWrapper;
</span><span class="cx">     friend class SQLStatementBackend;
</span><span class="lines">@@ -61,27 +58,8 @@
</span><span class="cx">     friend class SQLTransactionBackend;
</span><span class="cx">     friend class SQLTransactionBackendSync;
</span><span class="cx"> 
</span><del>-    DatabaseBackendBase(PassRefPtr&lt;DatabaseContext&gt;, const String&amp; name, const String&amp; expectedVersion, const String&amp; displayName, unsigned long estimatedSize);
</del><ins>+    DatabaseBackendBase();
</ins><span class="cx"> 
</span><del>-    RefPtr&lt;SecurityOrigin&gt; m_contextThreadSecurityOrigin;
-    RefPtr&lt;DatabaseContext&gt; m_databaseContext; // Associated with m_scriptExecutionContext.
-
-    String m_name;
-    String m_expectedVersion;
-    String m_displayName;
-    unsigned long m_estimatedSize;
-    String m_filename;
-
-    Database* m_frontend;
-
-    DatabaseGuid m_guid;
-    bool m_opened;
-    bool m_new;
-
-    SQLiteDatabase m_sqliteDatabase;
-
-    RefPtr&lt;DatabaseAuthorizer&gt; m_databaseAuthorizer;
-
</del><span class="cx">     friend class DatabaseServer;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>