⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 179774 in webkit


Ignore:
Timestamp:
Feb 6, 2015, 7:06:58 PM (12 years ago)
Author:
Chris Dumez
Message:

Have SQLiteStatement::database() return a reference
https://bugs.webkit.org/show_bug.cgi?id=141348

Reviewed by Andreas Kling.

Have SQLiteStatement::database() return a reference as it can never
return null.

Source/WebCore:

  • loader/icon/IconDatabase.cpp:

(WebCore::readySQLiteStatement):

  • platform/sql/SQLiteStatement.h:

(WebCore::SQLiteStatement::database):

Source/WebKit2:

  • DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp:

(WebKit::SQLiteIDBCursor::internalAdvanceOnce):

Location:
trunk/Source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r179773 r179774  
     12015-02-06  Chris Dumez  <cdumez@apple.com>
     2
     3        Have SQLiteStatement::database() return a reference
     4        https://bugs.webkit.org/show_bug.cgi?id=141348
     5
     6        Reviewed by Andreas Kling.
     7
     8        Have SQLiteStatement::database() return a reference as it can never
     9        return null.
     10
     11        * loader/icon/IconDatabase.cpp:
     12        (WebCore::readySQLiteStatement):
     13        * platform/sql/SQLiteStatement.h:
     14        (WebCore::SQLiteStatement::database):
     15
    1162015-02-06  Brent Fulgham  <bfulgham@apple.com>
    217
  • trunk/Source/WebCore/loader/icon/IconDatabase.cpp

    r176459 r179774  
    18131813inline void readySQLiteStatement(std::unique_ptr<SQLiteStatement>& statement, SQLiteDatabase& db, const String& str)
    18141814{
    1815     if (statement && (statement->database() != &db || statement->isExpired())) {
     1815    if (statement && (&statement->database() != &db || statement->isExpired())) {
    18161816        if (statement->isExpired())
    18171817            LOG(IconDatabase, "SQLiteStatement associated with %s is expired", str.ascii().data());
  • trunk/Source/WebCore/platform/sql/SQLiteStatement.h

    r173176 r179774  
    9191    bool returnDoubleResults(int col, Vector<double>&);
    9292
    93     SQLiteDatabase* database() { return &m_database; }
     93    SQLiteDatabase& database() { return m_database; }
    9494   
    9595    const String& query() const { return m_query; }
  • trunk/Source/WebKit2/ChangeLog

    r179754 r179774  
     12015-02-06  Chris Dumez  <cdumez@apple.com>
     2
     3        Have SQLiteStatement::database() return a reference
     4        https://bugs.webkit.org/show_bug.cgi?id=141348
     5
     6        Reviewed by Andreas Kling.
     7
     8        Have SQLiteStatement::database() return a reference as it can never
     9        return null.
     10
     11        * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp:
     12        (WebKit::SQLiteIDBCursor::internalAdvanceOnce):
     13
    1142015-02-06  Alexey Proskuryakov  <ap@apple.com>
    215
  • trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp

    r177453 r179774  
    330330        }
    331331
    332         SQLiteStatement objectStoreStatement(*m_statement->database(), "SELECT value FROM Records WHERE key = CAST(? AS TEXT) and objectStoreID = ?;");
     332        SQLiteStatement objectStoreStatement(m_statement->database(), "SELECT value FROM Records WHERE key = CAST(? AS TEXT) and objectStoreID = ?;");
    333333
    334334        if (objectStoreStatement.prepare() != SQLResultOk
    335335            || objectStoreStatement.bindBlob(1, m_currentValueBuffer.data(), m_currentValueBuffer.size()) != SQLResultOk
    336336            || objectStoreStatement.bindInt64(2, m_objectStoreID) != SQLResultOk) {
    337             LOG_ERROR("Could not create index cursor statement into object store records (%i) '%s'", m_statement->database()->lastError(), m_statement->database()->lastErrorMsg());
     337            LOG_ERROR("Could not create index cursor statement into object store records (%i) '%s'", m_statement->database().lastError(), m_statement->database().lastErrorMsg());
    338338            m_completed = true;
    339339            m_errored = true;
     
    350350            return AdvanceResult::ShouldAdvanceAgain;
    351351        } else {
    352             LOG_ERROR("Could not step index cursor statement into object store records (%i) '%s'", m_statement->database()->lastError(), m_statement->database()->lastErrorMsg());
     352            LOG_ERROR("Could not step index cursor statement into object store records (%i) '%s'", m_statement->database().lastError(), m_statement->database().lastErrorMsg());
    353353            m_completed = true;
    354354            m_errored = true;
Note: See TracChangeset for help on using the changeset viewer.