[chromium] DatabaseObserver needs threadsafe fixes and other clean-up.
authorlevin@chromium.org <levin@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Dec 2011 06:51:20 +0000 (06:51 +0000)
committerlevin@chromium.org <levin@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Dec 2011 06:51:20 +0000 (06:51 +0000)
commitaf9d04ad8ebae2e9ec94c8debd32df66bd92c85e
treeb232d7d80b810751fd86e0eada4b17fda51a0581
parent4a7f6d27bc222e510c7a5f61dd8a98b4ad46ef51
[chromium] DatabaseObserver needs threadsafe fixes and other clean-up.
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: https://svn.webkit.org/repository/webkit/trunk@102894 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/workers/interrupt-database-sync-open-crash.html [new file with mode: 0644]
LayoutTests/http/tests/workers/resources/open-database-sync.js [new file with mode: 0644]
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/DatabaseObserver.cpp