Reviewed by Anders
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Nov 2007 21:15:22 +0000 (21:15 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Nov 2007 21:15:22 +0000 (21:15 +0000)
        Renamed a flag inside of SQLiteTransaction and added an accessor (for future work)

        * platform/sql/SQLiteTransaction.cpp:
        (WebCore::SQLiteTransaction::SQLiteTransaction):
        (WebCore::SQLiteTransaction::~SQLiteTransaction):
        (WebCore::SQLiteTransaction::begin):
        (WebCore::SQLiteTransaction::commit):
        (WebCore::SQLiteTransaction::rollback):
        * platform/sql/SQLiteTransaction.h:
        (WebCore::SQLiteTransaction::inProgress):

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

WebCore/ChangeLog
WebCore/platform/sql/SQLiteTransaction.cpp
WebCore/platform/sql/SQLiteTransaction.h

index 6928dfc58264fe3ebb639cb1608d0612fd7e1ff0..c6c902c591640452d512c8d886eb7f33d1c07955 100644 (file)
@@ -1,3 +1,18 @@
+2007-11-01  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Anders
+
+        Renamed a flag inside of SQLiteTransaction and added an accessor (for future work)
+
+        * platform/sql/SQLiteTransaction.cpp:
+        (WebCore::SQLiteTransaction::SQLiteTransaction):
+        (WebCore::SQLiteTransaction::~SQLiteTransaction):
+        (WebCore::SQLiteTransaction::begin):
+        (WebCore::SQLiteTransaction::commit):
+        (WebCore::SQLiteTransaction::rollback):
+        * platform/sql/SQLiteTransaction.h:
+        (WebCore::SQLiteTransaction::inProgress):
+
 2007-11-01  Adam Roben  <aroben@apple.com>
 
         Remove all duplicate xcopy commands from WebCore's post-build step
index 5f2b7d844c0e69e74ad924725837c7169d61bd66..b5026620ba1272b653e3c74c13f355a096c6c05a 100644 (file)
@@ -32,31 +32,31 @@ namespace WebCore {
 
 SQLiteTransaction::SQLiteTransaction(SQLiteDatabase& db)
     : m_db(db)
-    , m_began(false)
+    , m_inProgress(false)
 {
 }
 
 SQLiteTransaction::~SQLiteTransaction()
 {
-    if (m_began
+    if (m_inProgress
         rollback();
 }
     
 void SQLiteTransaction::begin()
 {
-    if (!m_began) {
+    if (!m_inProgress) {
         ASSERT(!m_db.m_transactionInProgress);
-        m_began = m_db.executeCommand("BEGIN;");
+        m_inProgress = m_db.executeCommand("BEGIN;");
         m_db.m_transactionInProgress = true;
     }
 }
 
 void SQLiteTransaction::commit()
 {
-    if (m_began) {
+    if (m_inProgress) {
         ASSERT(m_db.m_transactionInProgress);
         if (m_db.executeCommand("COMMIT;")) {
-            m_began = false;
+            m_inProgress = false;
             m_db.m_transactionInProgress = false;
         }
     }
@@ -64,10 +64,10 @@ void SQLiteTransaction::commit()
 
 void SQLiteTransaction::rollback()
 {
-    if (m_began) {
+    if (m_inProgress) {
         ASSERT(m_db.m_transactionInProgress);
         if (m_db.executeCommand("ROLLBACK;")) {
-            m_began = false;
+            m_inProgress = false;
             m_db.m_transactionInProgress = false;
         }
     }
index cb68e5e58fc70722981970010437e9027a9cff6b..de1ebe6e5620107ff5a7092dd56f99db18eb8ec8 100644 (file)
@@ -42,9 +42,10 @@ public:
     void commit();
     void rollback();
     
+    bool inProgress() const { return m_inProgress; }
 private:
     SQLiteDatabase& m_db;
-    bool m_began;
+    bool m_inProgress;
 
 };