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

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

Issue 215063005: Oilpan: Prepare to move DatabaseContext to Oilpan heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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
Index: Source/modules/webdatabase/DatabaseContext.cpp
diff --git a/Source/modules/webdatabase/DatabaseContext.cpp b/Source/modules/webdatabase/DatabaseContext.cpp
index ec01219a4f5f62df6696b9855ecc38f75543a8e8..c470e742356160dff19d3f45dba2cb074e64db9d 100644
--- a/Source/modules/webdatabase/DatabaseContext.cpp
+++ b/Source/modules/webdatabase/DatabaseContext.cpp
@@ -87,9 +87,9 @@ namespace WebCore {
// The RefPtrs in the Databases and ExecutionContext will ensure that the
// DatabaseContext will outlive both regardless of which of the 2 destructs first.
-PassRefPtr<DatabaseContext> DatabaseContext::create(ExecutionContext* context)
+PassRefPtrWillBeRawPtr<DatabaseContext> DatabaseContext::create(ExecutionContext* context)
{
- RefPtr<DatabaseContext> self = adoptRef(new DatabaseContext(context));
+ RefPtrWillBeRawPtr<DatabaseContext> self = adoptRefWillBeNoop(new DatabaseContext(context));
DatabaseManager::manager().registerDatabaseContext(self.get());
return self.release();
}
@@ -109,13 +109,17 @@ DatabaseContext::DatabaseContext(ExecutionContext* context)
DatabaseContext::~DatabaseContext()
{
- ASSERT(!m_databaseThread || m_databaseThread->terminationRequested());
-
// For debug accounting only. We must call this last. The assertions assume
// this.
DatabaseManager::manager().didDestructDatabaseContext();
}
+void DatabaseContext::trace(Visitor* visitor)
+{
+ visitor->trace(m_databaseThread);
+ visitor->trace(m_openSyncDatabases);
+}
+
// This is called if the associated ExecutionContext is destructing while
// we're still associated with it. That's our cue to disassociate and shutdown.
// To do this, we stop the database and let everything shutdown naturally
@@ -123,7 +127,7 @@ DatabaseContext::~DatabaseContext()
// It is not safe to just delete the context here.
void DatabaseContext::contextDestroyed()
{
- RefPtr<DatabaseContext> protector(this);
+ RefPtrWillBeRawPtr<DatabaseContext> protector(this);
stopDatabases();
DatabaseManager::manager().unregisterDatabaseContext(this);
ActiveDOMObject::contextDestroyed();

Powered by Google App Engine
This is Rietveld 408576698