Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(276)

Unified Diff: Source/WebCore/storage/chromium/DatabaseTrackerChromium.cpp

Issue 9255031: Merge 103429 - Source/WebCore: [Chromium] DatabaseTrackerChromium: iterating DatabaseSet races wi... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/storage/AbstractDatabase.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/storage/chromium/DatabaseTrackerChromium.cpp
===================================================================
--- Source/WebCore/storage/chromium/DatabaseTrackerChromium.cpp (revision 105355)
+++ Source/WebCore/storage/chromium/DatabaseTrackerChromium.cpp (working copy)
@@ -97,20 +97,25 @@
DatabaseObserver::databaseOpened(database);
}
-class TrackerRemoveOpenDatabaseTask : public ScriptExecutionContext::Task {
+class NotifyDatabaseObserverOnCloseTask : public ScriptExecutionContext::Task {
public:
- static PassOwnPtr<TrackerRemoveOpenDatabaseTask> create(PassRefPtr<AbstractDatabase> database)
+ static PassOwnPtr<NotifyDatabaseObserverOnCloseTask> create(PassRefPtr<AbstractDatabase> database)
{
- return adoptPtr(new TrackerRemoveOpenDatabaseTask(database));
+ return adoptPtr(new NotifyDatabaseObserverOnCloseTask(database));
}
virtual void performTask(ScriptExecutionContext* context)
{
- DatabaseTracker::tracker().removeOpenDatabase(m_database.get());
+ DatabaseObserver::databaseClosed(m_database.get());
}
+ virtual bool isCleanupTask() const
+ {
+ return true;
+ }
+
private:
- TrackerRemoveOpenDatabaseTask(PassRefPtr<AbstractDatabase> database)
+ NotifyDatabaseObserverOnCloseTask(PassRefPtr<AbstractDatabase> database)
: m_database(database)
{
}
@@ -120,11 +125,6 @@
void DatabaseTracker::removeOpenDatabase(AbstractDatabase* database)
{
- if (!database->scriptExecutionContext()->isContextThread()) {
- database->scriptExecutionContext()->postTask(TrackerRemoveOpenDatabaseTask::create(database));
- return;
- }
-
String originIdentifier = database->securityOrigin()->databaseIdentifier();
MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard);
ASSERT(m_openDatabaseMap);
@@ -151,7 +151,10 @@
}
}
- DatabaseObserver::databaseClosed(database);
+ if (!database->scriptExecutionContext()->isContextThread())
+ database->scriptExecutionContext()->postTask(NotifyDatabaseObserverOnCloseTask::create(database));
+ else
+ DatabaseObserver::databaseClosed(database);
}
void DatabaseTracker::getOpenDatabases(SecurityOrigin* origin, const String& name, HashSet<RefPtr<AbstractDatabase> >* databases)
« no previous file with comments | « Source/WebCore/storage/AbstractDatabase.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698