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

Unified Diff: Source/modules/webdatabase/DatabaseContext.cpp

Issue 561093003: Remove worker support of Web SQL Database. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 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/modules/webdatabase/DatabaseContext.h ('k') | Source/modules/webdatabase/DatabaseManager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webdatabase/DatabaseContext.cpp
diff --git a/Source/modules/webdatabase/DatabaseContext.cpp b/Source/modules/webdatabase/DatabaseContext.cpp
index 87e4900687cd93c1958820c6c997b86d7d960842..7313237502b80e8475f12a2edd5a25b0c801c393 100644
--- a/Source/modules/webdatabase/DatabaseContext.cpp
+++ b/Source/modules/webdatabase/DatabaseContext.cpp
@@ -105,8 +105,6 @@ DatabaseContext::DatabaseContext(ExecutionContext* context)
// For debug accounting only. We must do this before we register the
// instance. The assertions assume this.
DatabaseManager::manager().didConstructDatabaseContext();
- if (context->isWorkerGlobalScope())
- toWorkerGlobalScope(context)->registerTerminationObserver(this);
}
DatabaseContext::~DatabaseContext()
@@ -120,7 +118,6 @@ void DatabaseContext::trace(Visitor* visitor)
{
#if ENABLE(OILPAN)
visitor->trace(m_databaseThread);
- visitor->trace(m_openSyncDatabases);
#endif
}
@@ -137,11 +134,6 @@ void DatabaseContext::contextDestroyed()
ActiveDOMObject::contextDestroyed();
}
-void DatabaseContext::wasRequestedToTerminate()
-{
- DatabaseManager::manager().interruptAllDatabasesForContext(this);
-}
-
// stop() is from stopActiveDOMObjects() which indicates that the owner LocalFrame
// or WorkerThread is shutting down. Initiate the orderly shutdown by stopping
// the associated databases.
@@ -173,61 +165,8 @@ DatabaseThread* DatabaseContext::databaseThread()
return m_databaseThread.get();
}
-void DatabaseContext::didOpenDatabase(DatabaseBackendBase& database)
-{
- if (!database.isSyncDatabase())
- return;
- ASSERT(isContextThread());
-#if ENABLE(OILPAN)
- m_openSyncDatabases.add(&database, adoptPtr(new DatabaseCloser(database)));
-#else
- m_openSyncDatabases.add(&database);
-#endif
-}
-
-void DatabaseContext::didCloseDatabase(DatabaseBackendBase& database)
-{
-#if !ENABLE(OILPAN)
- if (!database.isSyncDatabase())
- return;
- ASSERT(isContextThread());
- m_openSyncDatabases.remove(&database);
-#endif
-}
-
-#if ENABLE(OILPAN)
-DatabaseContext::DatabaseCloser::~DatabaseCloser()
-{
- if (m_database.opened())
- m_database.closeDatabase();
-}
-#endif
-
-void DatabaseContext::stopSyncDatabases()
-{
- // SQLite is "multi-thread safe", but each database handle can only be used
- // on a single thread at a time.
- //
- // For DatabaseBackendSync, we open the SQLite database on the script
- // context thread. And hence we should also close it on that same
- // thread. This means that the SQLite database need to be closed here in the
- // destructor.
- ASSERT(isContextThread());
-#if ENABLE(OILPAN)
- m_openSyncDatabases.clear();
-#else
- Vector<DatabaseBackendBase*> syncDatabases;
- copyToVector(m_openSyncDatabases, syncDatabases);
- m_openSyncDatabases.clear();
- for (size_t i = 0; i < syncDatabases.size(); ++i)
- syncDatabases[i]->closeImmediately();
-#endif
-}
-
void DatabaseContext::stopDatabases()
{
- stopSyncDatabases();
-
// Though we initiate termination of the DatabaseThread here in
// stopDatabases(), we can't clear the m_databaseThread ref till we get to
// the destructor. This is because the Databases that are managed by
« no previous file with comments | « Source/modules/webdatabase/DatabaseContext.h ('k') | Source/modules/webdatabase/DatabaseManager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698