| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 m_openDatabaseMap->set(originString, nameMap); | 104 m_openDatabaseMap->set(originString, nameMap); |
| 105 } | 105 } |
| 106 | 106 |
| 107 String name(database->stringIdentifier()); | 107 String name(database->stringIdentifier()); |
| 108 DatabaseSet* databaseSet = nameMap->get(name); | 108 DatabaseSet* databaseSet = nameMap->get(name); |
| 109 if (!databaseSet) { | 109 if (!databaseSet) { |
| 110 databaseSet = new DatabaseSet(); | 110 databaseSet = new DatabaseSet(); |
| 111 nameMap->set(name, databaseSet); | 111 nameMap->set(name, databaseSet); |
| 112 } | 112 } |
| 113 | 113 |
| 114 databaseSet->add(database); | 114 databaseSet->insert(database); |
| 115 } | 115 } |
| 116 | 116 |
| 117 void DatabaseTracker::removeOpenDatabase(Database* database) { | 117 void DatabaseTracker::removeOpenDatabase(Database* database) { |
| 118 { | 118 { |
| 119 MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard); | 119 MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard); |
| 120 String originString = database->getSecurityOrigin()->toRawString(); | 120 String originString = database->getSecurityOrigin()->toRawString(); |
| 121 ASSERT(m_openDatabaseMap); | 121 ASSERT(m_openDatabaseMap); |
| 122 DatabaseNameMap* nameMap = m_openDatabaseMap->get(originString); | 122 DatabaseNameMap* nameMap = m_openDatabaseMap->get(originString); |
| 123 if (!nameMap) | 123 if (!nameMap) |
| 124 return; | 124 return; |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 if (found == databaseSet->end()) | 234 if (found == databaseSet->end()) |
| 235 return; | 235 return; |
| 236 } | 236 } |
| 237 | 237 |
| 238 // And we have to call closeImmediately() without our collection lock being | 238 // And we have to call closeImmediately() without our collection lock being |
| 239 // held. | 239 // held. |
| 240 database->closeImmediately(); | 240 database->closeImmediately(); |
| 241 } | 241 } |
| 242 | 242 |
| 243 } // namespace blink | 243 } // namespace blink |
| OLD | NEW |