Chromium Code Reviews| 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 175 // destructor, we're guaranteed that the databases are destructed (which is | 175 // destructor, we're guaranteed that the databases are destructed (which is |
| 176 // why our ref count is 0 then and we're destructing). Then, the | 176 // why our ref count is 0 then and we're destructing). Then, the |
| 177 // m_databaseThread RefPtr destructor will deref and delete the | 177 // m_databaseThread RefPtr destructor will deref and delete the |
| 178 // DatabaseThread. | 178 // DatabaseThread. |
| 179 | 179 |
| 180 if (m_databaseThread && !m_hasRequestedTermination) { | 180 if (m_databaseThread && !m_hasRequestedTermination) { |
| 181 TaskSynchronizer sync; | 181 TaskSynchronizer sync; |
| 182 m_databaseThread->requestTermination(&sync); | 182 m_databaseThread->requestTermination(&sync); |
| 183 m_hasRequestedTermination = true; | 183 m_hasRequestedTermination = true; |
| 184 sync.waitForTaskCompletion(); | 184 sync.waitForTaskCompletion(); |
| 185 m_databaseThread->dispose(); | |
|
wibling-chromium
2014/09/23 08:40:59
It would be nice with a comment explaining why it
zerny-chromium
2014/09/23 08:46:29
Alternatively we could encapsulate this in the dat
| |
| 185 } | 186 } |
| 186 } | 187 } |
| 187 | 188 |
| 188 bool DatabaseContext::allowDatabaseAccess() const | 189 bool DatabaseContext::allowDatabaseAccess() const |
| 189 { | 190 { |
| 190 return toDocument(executionContext())->isActive(); | 191 return toDocument(executionContext())->isActive(); |
| 191 } | 192 } |
| 192 | 193 |
| 193 SecurityOrigin* DatabaseContext::securityOrigin() const | 194 SecurityOrigin* DatabaseContext::securityOrigin() const |
| 194 { | 195 { |
| 195 return executionContext()->securityOrigin(); | 196 return executionContext()->securityOrigin(); |
| 196 } | 197 } |
| 197 | 198 |
| 198 bool DatabaseContext::isContextThread() const | 199 bool DatabaseContext::isContextThread() const |
| 199 { | 200 { |
| 200 return executionContext()->isContextThread(); | 201 return executionContext()->isContextThread(); |
| 201 } | 202 } |
| 202 | 203 |
| 203 } // namespace blink | 204 } // namespace blink |
| OLD | NEW |