| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 81 |
| 82 String DatabaseTracker::fullPathForDatabase(SecurityOrigin* origin, const String
& name, bool) | 82 String DatabaseTracker::fullPathForDatabase(SecurityOrigin* origin, const String
& name, bool) |
| 83 { | 83 { |
| 84 return String(Platform::current()->databaseCreateOriginIdentifier(WebSecurit
yOrigin(origin))) + "/" + name + "#"; | 84 return String(Platform::current()->databaseCreateOriginIdentifier(WebSecurit
yOrigin(origin))) + "/" + name + "#"; |
| 85 } | 85 } |
| 86 | 86 |
| 87 void DatabaseTracker::addOpenDatabase(Database* database) | 87 void DatabaseTracker::addOpenDatabase(Database* database) |
| 88 { | 88 { |
| 89 MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard); | 89 MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard); |
| 90 if (!m_openDatabaseMap) | 90 if (!m_openDatabaseMap) |
| 91 m_openDatabaseMap = adoptPtr(new DatabaseOriginMap); | 91 m_openDatabaseMap = wrapUnique(new DatabaseOriginMap); |
| 92 | 92 |
| 93 String originString = database->getSecurityOrigin()->toString(); | 93 String originString = database->getSecurityOrigin()->toString(); |
| 94 DatabaseNameMap* nameMap = m_openDatabaseMap->get(originString); | 94 DatabaseNameMap* nameMap = m_openDatabaseMap->get(originString); |
| 95 if (!nameMap) { | 95 if (!nameMap) { |
| 96 nameMap = new DatabaseNameMap(); | 96 nameMap = new DatabaseNameMap(); |
| 97 m_openDatabaseMap->set(originString, nameMap); | 97 m_openDatabaseMap->set(originString, nameMap); |
| 98 } | 98 } |
| 99 | 99 |
| 100 String name(database->stringIdentifier()); | 100 String name(database->stringIdentifier()); |
| 101 DatabaseSet* databaseSet = nameMap->get(name); | 101 DatabaseSet* databaseSet = nameMap->get(name); |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 DatabaseSet::iterator found = databaseSet->find(database); | 247 DatabaseSet::iterator found = databaseSet->find(database); |
| 248 if (found == databaseSet->end()) | 248 if (found == databaseSet->end()) |
| 249 return; | 249 return; |
| 250 } | 250 } |
| 251 | 251 |
| 252 // And we have to call closeImmediately() without our collection lock being
held. | 252 // And we have to call closeImmediately() without our collection lock being
held. |
| 253 database->closeImmediately(); | 253 database->closeImmediately(); |
| 254 } | 254 } |
| 255 | 255 |
| 256 } // namespace blink | 256 } // namespace blink |
| OLD | NEW |