OLD | NEW |
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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 | 126 |
127 // This is called if the associated ExecutionContext is destructing while | 127 // This is called if the associated ExecutionContext is destructing while |
128 // we're still associated with it. That's our cue to disassociate and shutdown. | 128 // we're still associated with it. That's our cue to disassociate and shutdown. |
129 // To do this, we stop the database and let everything shutdown naturally | 129 // To do this, we stop the database and let everything shutdown naturally |
130 // because the database closing process may still make use of this context. | 130 // because the database closing process may still make use of this context. |
131 // It is not safe to just delete the context here. | 131 // It is not safe to just delete the context here. |
132 void DatabaseContext::contextDestroyed() | 132 void DatabaseContext::contextDestroyed() |
133 { | 133 { |
134 RefPtrWillBeRawPtr<DatabaseContext> protector(this); | 134 RefPtrWillBeRawPtr<DatabaseContext> protector(this); |
135 stopDatabases(); | 135 stopDatabases(); |
136 if (executionContext()->isWorkerGlobalScope()) | |
137 toWorkerGlobalScope(executionContext())->unregisterTerminationObserver(t
his); | |
138 DatabaseManager::manager().unregisterDatabaseContext(this); | 136 DatabaseManager::manager().unregisterDatabaseContext(this); |
139 ActiveDOMObject::contextDestroyed(); | 137 ActiveDOMObject::contextDestroyed(); |
140 } | 138 } |
141 | 139 |
142 void DatabaseContext::wasRequestedToTerminate() | 140 void DatabaseContext::wasRequestedToTerminate() |
143 { | 141 { |
144 DatabaseManager::manager().interruptAllDatabasesForContext(this); | 142 DatabaseManager::manager().interruptAllDatabasesForContext(this); |
145 } | 143 } |
146 | 144 |
147 // stop() is from stopActiveDOMObjects() which indicates that the owner LocalFra
me | 145 // stop() is from stopActiveDOMObjects() which indicates that the owner LocalFra
me |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 { | 259 { |
262 return executionContext()->securityOrigin(); | 260 return executionContext()->securityOrigin(); |
263 } | 261 } |
264 | 262 |
265 bool DatabaseContext::isContextThread() const | 263 bool DatabaseContext::isContextThread() const |
266 { | 264 { |
267 return executionContext()->isContextThread(); | 265 return executionContext()->isContextThread(); |
268 } | 266 } |
269 | 267 |
270 } // namespace blink | 268 } // namespace blink |
OLD | NEW |