OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 15 matching lines...) Expand all Loading... |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "modules/webdatabase/DatabaseTracker.h" | 31 #include "modules/webdatabase/DatabaseTracker.h" |
32 | 32 |
33 #include "core/dom/Document.h" | 33 #include "core/dom/Document.h" |
34 #include "core/dom/ExecutionContext.h" | 34 #include "core/dom/ExecutionContext.h" |
35 #include "core/dom/ExecutionContextTask.h" | 35 #include "core/dom/ExecutionContextTask.h" |
| 36 #include "core/dom/TaskRunnerHelper.h" |
36 #include "modules/webdatabase/Database.h" | 37 #include "modules/webdatabase/Database.h" |
37 #include "modules/webdatabase/DatabaseClient.h" | 38 #include "modules/webdatabase/DatabaseClient.h" |
38 #include "modules/webdatabase/DatabaseContext.h" | 39 #include "modules/webdatabase/DatabaseContext.h" |
39 #include "modules/webdatabase/QuotaTracker.h" | 40 #include "modules/webdatabase/QuotaTracker.h" |
40 #include "modules/webdatabase/sqlite/SQLiteFileSystem.h" | 41 #include "modules/webdatabase/sqlite/SQLiteFileSystem.h" |
41 #include "platform/weborigin/SecurityOrigin.h" | 42 #include "platform/weborigin/SecurityOrigin.h" |
42 #include "platform/weborigin/SecurityOriginHash.h" | 43 #include "platform/weborigin/SecurityOriginHash.h" |
43 #include "public/platform/Platform.h" | 44 #include "public/platform/Platform.h" |
44 #include "public/platform/WebDatabaseObserver.h" | 45 #include "public/platform/WebDatabaseObserver.h" |
45 #include "public/platform/WebSecurityOrigin.h" | 46 #include "public/platform/WebSecurityOrigin.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 return; | 182 return; |
182 | 183 |
183 DatabaseSet* databaseSet = nameMap->get(name); | 184 DatabaseSet* databaseSet = nameMap->get(name); |
184 if (!databaseSet) | 185 if (!databaseSet) |
185 return; | 186 return; |
186 | 187 |
187 // We have to call closeImmediately() on the context thread. | 188 // We have to call closeImmediately() on the context thread. |
188 for (DatabaseSet::iterator it = databaseSet->begin(); | 189 for (DatabaseSet::iterator it = databaseSet->begin(); |
189 it != databaseSet->end(); ++it) | 190 it != databaseSet->end(); ++it) |
190 (*it)->getDatabaseContext()->getExecutionContext()->postTask( | 191 (*it)->getDatabaseContext()->getExecutionContext()->postTask( |
191 BLINK_FROM_HERE, | 192 TaskType::DatabaseAccess, BLINK_FROM_HERE, |
192 createCrossThreadTask(&DatabaseTracker::closeOneDatabaseImmediately, | 193 createCrossThreadTask(&DatabaseTracker::closeOneDatabaseImmediately, |
193 crossThreadUnretained(this), originString, name, | 194 crossThreadUnretained(this), originString, name, |
194 *it)); | 195 *it)); |
195 } | 196 } |
196 | 197 |
197 void DatabaseTracker::forEachOpenDatabaseInPage( | 198 void DatabaseTracker::forEachOpenDatabaseInPage( |
198 Page* page, | 199 Page* page, |
199 std::unique_ptr<DatabaseCallback> callback) { | 200 std::unique_ptr<DatabaseCallback> callback) { |
200 MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard); | 201 MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard); |
201 if (!m_openDatabaseMap) | 202 if (!m_openDatabaseMap) |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 if (found == databaseSet->end()) | 234 if (found == databaseSet->end()) |
234 return; | 235 return; |
235 } | 236 } |
236 | 237 |
237 // And we have to call closeImmediately() without our collection lock being | 238 // And we have to call closeImmediately() without our collection lock being |
238 // held. | 239 // held. |
239 database->closeImmediately(); | 240 database->closeImmediately(); |
240 } | 241 } |
241 | 242 |
242 } // namespace blink | 243 } // namespace blink |
OLD | NEW |