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 17 matching lines...) Expand all Loading... |
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 "config.h" | 31 #include "config.h" |
32 #include "modules/webdatabase/DatabaseTracker.h" | 32 #include "modules/webdatabase/DatabaseTracker.h" |
33 | 33 |
34 #include "core/dom/ScriptExecutionContext.h" | 34 #include "core/dom/ScriptExecutionContext.h" |
35 #include "core/platform/sql/SQLiteFileSystem.h" | 35 #include "core/platform/sql/SQLiteFileSystem.h" |
36 #include "modules/webdatabase/DatabaseBackendBase.h" | 36 #include "modules/webdatabase/DatabaseBackendBase.h" |
37 #include "modules/webdatabase/DatabaseBackendContext.h" | 37 #include "modules/webdatabase/DatabaseBackendContext.h" |
38 #include "modules/webdatabase/chromium/DatabaseObserver.h" | 38 #include "modules/webdatabase/DatabaseObserver.h" |
39 #include "modules/webdatabase/chromium/QuotaTracker.h" | 39 #include "modules/webdatabase/QuotaTracker.h" |
40 #include "weborigin/DatabaseIdentifier.h" | 40 #include "weborigin/DatabaseIdentifier.h" |
41 #include "weborigin/SecurityOrigin.h" | 41 #include "weborigin/SecurityOrigin.h" |
42 #include "weborigin/SecurityOriginHash.h" | 42 #include "weborigin/SecurityOriginHash.h" |
43 #include "wtf/Assertions.h" | 43 #include "wtf/Assertions.h" |
44 #include "wtf/StdLibExtras.h" | 44 #include "wtf/StdLibExtras.h" |
45 #include "wtf/text/WTFString.h" | 45 #include "wtf/text/WTFString.h" |
46 | 46 |
47 namespace WebCore { | 47 namespace WebCore { |
48 | 48 |
49 DatabaseTracker& DatabaseTracker::tracker() | 49 DatabaseTracker& DatabaseTracker::tracker() |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 , m_name(name.isolatedCopy()) | 220 , m_name(name.isolatedCopy()) |
221 , m_database(database) | 221 , m_database(database) |
222 { | 222 { |
223 } | 223 } |
224 | 224 |
225 String m_originIdentifier; | 225 String m_originIdentifier; |
226 String m_name; | 226 String m_name; |
227 DatabaseBackendBase* m_database; // Intentionally a raw pointer. | 227 DatabaseBackendBase* m_database; // Intentionally a raw pointer. |
228 }; | 228 }; |
229 | 229 |
230 void DatabaseTracker::closeDatabasesImmediately(const String& originIdentifier,
const String& name) { | 230 void DatabaseTracker::closeDatabasesImmediately(const String& originIdentifier,
const String& name) |
| 231 { |
231 MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard); | 232 MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard); |
232 if (!m_openDatabaseMap) | 233 if (!m_openDatabaseMap) |
233 return; | 234 return; |
234 | 235 |
235 DatabaseNameMap* nameMap = m_openDatabaseMap->get(originIdentifier); | 236 DatabaseNameMap* nameMap = m_openDatabaseMap->get(originIdentifier); |
236 if (!nameMap) | 237 if (!nameMap) |
237 return; | 238 return; |
238 | 239 |
239 DatabaseSet* databaseSet = nameMap->get(name); | 240 DatabaseSet* databaseSet = nameMap->get(name); |
240 if (!databaseSet) | 241 if (!databaseSet) |
(...skipping 25 matching lines...) Expand all Loading... |
266 DatabaseSet::iterator found = databaseSet->find(database); | 267 DatabaseSet::iterator found = databaseSet->find(database); |
267 if (found == databaseSet->end()) | 268 if (found == databaseSet->end()) |
268 return; | 269 return; |
269 } | 270 } |
270 | 271 |
271 // And we have to call closeImmediately() without our collection lock being
held. | 272 // And we have to call closeImmediately() without our collection lock being
held. |
272 database->closeImmediately(); | 273 database->closeImmediately(); |
273 } | 274 } |
274 | 275 |
275 } | 276 } |
OLD | NEW |