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

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

Issue 248523003: Remove ActiveDOMObject::willStop, and introduce WorkerGlobalScope::TerminationObserver. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Linux build fix, comment update Created 6 years, 8 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') | no next file » | 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 5ff09d800b9396717989dfd74c75865ea4cf1a84..a9828bc84b95f4576ccf98e5b70b6a7a4e2f30bc 100644
--- a/Source/modules/webdatabase/DatabaseContext.cpp
+++ b/Source/modules/webdatabase/DatabaseContext.cpp
@@ -105,6 +105,8 @@ 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()
@@ -129,11 +131,13 @@ void DatabaseContext::contextDestroyed()
{
RefPtrWillBeRawPtr<DatabaseContext> protector(this);
stopDatabases();
+ if (executionContext()->isWorkerGlobalScope())
+ toWorkerGlobalScope(executionContext())->unregisterTerminationObserver(this);
DatabaseManager::manager().unregisterDatabaseContext(this);
ActiveDOMObject::contextDestroyed();
}
-void DatabaseContext::willStop()
+void DatabaseContext::wasRequestedToTerminate()
{
DatabaseManager::manager().interruptAllDatabasesForContext(this);
}
« no previous file with comments | « Source/modules/webdatabase/DatabaseContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698