We need to call DatabaseTracker::removeOpenDatabase() in Database::close() instead of Database::~Database(), because once we get to Database::~Database(), we cannot addref the object, schedule tasks on it on another thread, and so on. At the same time, we need to preserve the order in which things are done (such as, calling DatabaseTracker::addOpenDatabase() before actually opening the DB file), because the Chromium implementation was designed with certain assumptions in mind.
Created attachment 45585 [details]
style-queue ran check-webkit-style on attachment 45585 [details] without any errors.
Comment on attachment 45585 [details]
Landed as r52631.
Thanks for the quick review, Maciej!