Changeset 60729 in webkit


Ignore:
Timestamp:
Jun 4, 2010 8:40:22 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-06-04 Lyon Chen <liachen@rim.com>

Reviewed by Darin Adler.

ApplicationCacheStorage::storeNewestCache() Crash WebKit when openDatabase(true) failed
https://bugs.webkit.org/show_bug.cgi?id=40074

Adding m_database.isOpen() check for every openDatabase(true) call, this is needed because
openDatabase(true) could still fail, for example when cacheStorage is full or no longer available.

  • loader/appcache/ApplicationCacheStorage.cpp: (WebCore::ApplicationCacheStorage::store): (WebCore::ApplicationCacheStorage::storeNewestCache):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r60728 r60729  
     12010-06-04  Lyon Chen  <liachen@rim.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        ApplicationCacheStorage::storeNewestCache() Crash WebKit when openDatabase(true) failed
     6        https://bugs.webkit.org/show_bug.cgi?id=40074
     7
     8        Adding m_database.isOpen() check for every openDatabase(true) call, this is needed because
     9        openDatabase(true) could still fail, for example when cacheStorage is full or no longer available.
     10
     11        * loader/appcache/ApplicationCacheStorage.cpp:
     12        (WebCore::ApplicationCacheStorage::store):
     13        (WebCore::ApplicationCacheStorage::storeNewestCache):
     14
    1152010-06-04  Sheriff Bot  <webkit.review.bot@gmail.com>
    216
  • trunk/WebCore/loader/appcache/ApplicationCacheStorage.cpp

    r60408 r60729  
    626626   
    627627    openDatabase(true);
    628    
     628
     629    // openDatabase(true) could still fail, for example when cacheStorage is full or no longer available.
     630    if (!m_database.isOpen())
     631        return false;
     632
    629633    // First, insert the data
    630634    SQLiteStatement dataStatement(m_database, "INSERT INTO CacheResourceData (data) VALUES (?)");
     
    712716   
    713717    openDatabase(true);
     718
     719    if (!m_database.isOpen())
     720        return false;
    714721 
    715722    m_isMaximumSizeReached = false;
     
    742749{
    743750    openDatabase(true);
     751
     752    if (!m_database.isOpen())
     753        return false;
    744754
    745755    m_isMaximumSizeReached = false;
Note: See TracChangeset for help on using the changeset viewer.