Skip to content
  • benm@google.com's avatar
    Stale database version persists through browser refresh (changeVersion doesn't work) · f7e0cd81
    benm@google.com authored
    https://bugs.webkit.org/show_bug.cgi?id=27836
    
    WebCore: 
    
    Reviewed by David Kilzer.
    
    Tests: storage/change-version-handle-reuse.html
           storage/change-version.html
    
    * bindings/v8/custom/V8DatabaseCustom.cpp:
    (WebCore::CALLBACK_FUNC_DECL): Implement the V8 binding for database.changeVersion().
    (WebCore::createTransaction): Fix a bug that was checking the wrong argument index to save the success callback.
    * storage/Database.cpp:
    (WebCore::updateGuidVersionMap): Safely update the Guid/version hash map.
    (WebCore::Database::~Database): Remove code that removes the database from the guid->database and guid->version maps.
    (WebCore::Database::setVersionInDatabase): Add a comment to explain some behaviour.
    (WebCore::Database::close): Move the code that updates the maps from the destructor to here.
    (WebCore::Database::performOpenAndVerify): Call updateGuidVersionMap instead of setting the hash map directly.
    (WebCore::Database::setExpectedVersion): Update the in memory guid->version map when we want to update the database version.
    
    LayoutTests: 
    
    Reviewed by  David Kilzer.
    
    * storage/change-version-expected.txt: Added.
    * storage/change-version-handle-reuse-expected.txt: Added.
    * storage/change-version-handle-reuse.html: Added.
    * storage/change-version.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49018 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    f7e0cd81