Skip to content
  • levin@chromium.org's avatar
    [chromium] DatabaseObserver needs threadsafe fixes and other clean-up. · f9e8280a
    levin@chromium.org authored
    https://bugs.webkit.org/show_bug.cgi?id=74558
    
    Reviewed by Dmitry Titov.
    
    Source/WebKit/chromium:
    
    The important part of this fix is the removal of AllowCrossThreadAccess so
    that ref counting happens appropriately.
    
    Minor clean up throughout: Removed unnecessary WTF prefix in many
    of these places and unnecessary String().
    
    * src/DatabaseObserver.cpp:
    (WebKit::AllowDatabaseMainThreadBridge::create):
    (WebKit::AllowDatabaseMainThreadBridge::signalCompleted): Get rid of
    AllowCrossThreadAccess so that "this" get ref counted and remove mode from being
    a member variable since a String in a ThreadSafeRefCounted class is bad.
    (WebKit::AllowDatabaseMainThreadBridge::AllowDatabaseMainThreadBridge): Ditto.
    (WebKit::AllowDatabaseMainThreadBridge::allowDatabaseTask): Pass through mode
    and minor code cleaning to do only one call to signalCompleted.
    (WebKit::allowDatabaseForWorker): Just removed unnecessary String()'s.
    
    LayoutTests:
    
    Added a test which would fail without some of these fixes.
    
    * http/tests/workers/interrupt-database-sync-open-crash.html: Added.
    * http/tests/workers/resources/open-database-sync.js: Added.
    (onmessage):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@102894 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    f9e8280a