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

Side by Side Diff: third_party/WebKit/Source/modules/webdatabase/DatabaseContext.cpp

Issue 2629593004: Disambiguate LifecycleObserver::contextDestroyed (Closed)
Patch Set: temp Created 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2011 Google, Inc. All Rights Reserved. 3 * Copyright (C) 2011 Google, Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 DEFINE_TRACE(DatabaseContext) { 118 DEFINE_TRACE(DatabaseContext) {
119 visitor->trace(m_databaseThread); 119 visitor->trace(m_databaseThread);
120 ContextLifecycleObserver::trace(visitor); 120 ContextLifecycleObserver::trace(visitor);
121 } 121 }
122 122
123 // This is called if the associated ExecutionContext is destructing while 123 // This is called if the associated ExecutionContext is destructing while
124 // we're still associated with it. That's our cue to disassociate and shutdown. 124 // we're still associated with it. That's our cue to disassociate and shutdown.
125 // To do this, we stop the database and let everything shutdown naturally 125 // To do this, we stop the database and let everything shutdown naturally
126 // because the database closing process may still make use of this context. 126 // because the database closing process may still make use of this context.
127 // It is not safe to just delete the context here. 127 // It is not safe to just delete the context here.
128 void DatabaseContext::contextDestroyed() { 128 void DatabaseContext::contextDestroyed(ExecutionContext*) {
129 stopDatabases(); 129 stopDatabases();
130 DatabaseManager::manager().unregisterDatabaseContext(this); 130 DatabaseManager::manager().unregisterDatabaseContext(this);
131 } 131 }
132 132
133 DatabaseContext* DatabaseContext::backend() { 133 DatabaseContext* DatabaseContext::backend() {
134 return this; 134 return this;
135 } 135 }
136 136
137 DatabaseThread* DatabaseContext::databaseThread() { 137 DatabaseThread* DatabaseContext::databaseThread() {
138 if (!m_databaseThread && !m_hasOpenDatabases) { 138 if (!m_databaseThread && !m_hasOpenDatabases) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 180
181 SecurityOrigin* DatabaseContext::getSecurityOrigin() const { 181 SecurityOrigin* DatabaseContext::getSecurityOrigin() const {
182 return getExecutionContext()->getSecurityOrigin(); 182 return getExecutionContext()->getSecurityOrigin();
183 } 183 }
184 184
185 bool DatabaseContext::isContextThread() const { 185 bool DatabaseContext::isContextThread() const {
186 return getExecutionContext()->isContextThread(); 186 return getExecutionContext()->isContextThread();
187 } 187 }
188 188
189 } // namespace blink 189 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698