| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 if (m_openDatabaseSet.size() > 0) { | 98 if (m_openDatabaseSet.size() > 0) { |
| 99 // As the call to close will modify the original set, we must take a cop
y to iterate over. | 99 // As the call to close will modify the original set, we must take a cop
y to iterate over. |
| 100 DatabaseSet openSetCopy; | 100 DatabaseSet openSetCopy; |
| 101 openSetCopy.swap(m_openDatabaseSet); | 101 openSetCopy.swap(m_openDatabaseSet); |
| 102 DatabaseSet::iterator end = openSetCopy.end(); | 102 DatabaseSet::iterator end = openSetCopy.end(); |
| 103 for (DatabaseSet::iterator it = openSetCopy.begin(); it != end; ++it) | 103 for (DatabaseSet::iterator it = openSetCopy.begin(); it != end; ++it) |
| 104 (*it).get()->close(); | 104 (*it).get()->close(); |
| 105 } | 105 } |
| 106 | 106 |
| 107 if (m_cleanupSync) // Someone wanted to know when we were done cleaning up. | 107 if (m_cleanupSync) // Someone wanted to know when we were done cleaning up. |
| 108 m_cleanupSync->taskCompleted(); | 108 m_thread->postTask(new Task(WTF::bind(&DatabaseTaskSynchronizer::taskCom
pleted, m_cleanupSync))); |
| 109 } | 109 } |
| 110 | 110 |
| 111 void DatabaseThread::recordDatabaseOpen(DatabaseBackend* database) | 111 void DatabaseThread::recordDatabaseOpen(DatabaseBackend* database) |
| 112 { | 112 { |
| 113 ASSERT(isDatabaseThread()); | 113 ASSERT(isDatabaseThread()); |
| 114 ASSERT(database); | 114 ASSERT(database); |
| 115 ASSERT(!m_openDatabaseSet.contains(database)); | 115 ASSERT(!m_openDatabaseSet.contains(database)); |
| 116 m_openDatabaseSet.add(database); | 116 m_openDatabaseSet.add(database); |
| 117 } | 117 } |
| 118 | 118 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 137 | 137 |
| 138 void DatabaseThread::scheduleTask(PassOwnPtr<DatabaseTask> task) | 138 void DatabaseThread::scheduleTask(PassOwnPtr<DatabaseTask> task) |
| 139 { | 139 { |
| 140 ASSERT(m_thread); | 140 ASSERT(m_thread); |
| 141 ASSERT(!task->hasSynchronizer() || task->hasCheckedForTermination()); | 141 ASSERT(!task->hasSynchronizer() || task->hasCheckedForTermination()); |
| 142 // WebThread takes ownership of the task. | 142 // WebThread takes ownership of the task. |
| 143 m_thread->postTask(task.leakPtr()); | 143 m_thread->postTask(task.leakPtr()); |
| 144 } | 144 } |
| 145 | 145 |
| 146 } // namespace WebCore | 146 } // namespace WebCore |
| OLD | NEW |