summaryrefslogtreecommitdiff
path: root/Source/WebCore/Modules/webdatabase/SQLResultSet.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/Modules/webdatabase/SQLResultSet.cpp
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebCore/Modules/webdatabase/SQLResultSet.cpp')
-rw-r--r--Source/WebCore/Modules/webdatabase/SQLResultSet.cpp42
1 files changed, 5 insertions, 37 deletions
diff --git a/Source/WebCore/Modules/webdatabase/SQLResultSet.cpp b/Source/WebCore/Modules/webdatabase/SQLResultSet.cpp
index 91a2d9108..da63f2b90 100644
--- a/Source/WebCore/Modules/webdatabase/SQLResultSet.cpp
+++ b/Source/WebCore/Modules/webdatabase/SQLResultSet.cpp
@@ -10,7 +10,7 @@
* 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.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * 3. Neither the name of Apple Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
@@ -29,54 +29,22 @@
#include "config.h"
#include "SQLResultSet.h"
-#if ENABLE(SQL_DATABASE)
-
#include "ExceptionCode.h"
namespace WebCore {
SQLResultSet::SQLResultSet()
: m_rows(SQLResultSetRowList::create())
- , m_insertId(0)
- , m_insertIdSet(false)
- , m_rowsAffected(0)
{
}
-int64_t SQLResultSet::insertId(ExceptionCode& e) const
+ExceptionOr<int64_t> SQLResultSet::insertId() const
{
// 4.11.4 - Return the id of the last row inserted as a result of the query
// If the query didn't result in any rows being added, raise an INVALID_ACCESS_ERR exception
- if (m_insertIdSet)
- return m_insertId;
-
- e = INVALID_ACCESS_ERR;
- return -1;
-}
-
-int SQLResultSet::rowsAffected() const
-{
- return m_rowsAffected;
-}
-
-SQLResultSetRowList* SQLResultSet::rows() const
-{
- return m_rows.get();
-}
-
-void SQLResultSet::setInsertId(int64_t id)
-{
- ASSERT(!m_insertIdSet);
-
- m_insertId = id;
- m_insertIdSet = true;
-}
-
-void SQLResultSet::setRowsAffected(int count)
-{
- m_rowsAffected = count;
+ if (!m_insertId)
+ return Exception { INVALID_ACCESS_ERR };
+ return m_insertId.value();
}
}
-
-#endif