| 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 182     unsigned long long spaceAvailable = 0; | 182     unsigned long long spaceAvailable = 0; | 
| 183     unsigned long long databaseSize = 0; | 183     unsigned long long databaseSize = 0; | 
| 184     QuotaTracker::instance().getDatabaseSizeAndSpaceAvailableToOrigin( | 184     QuotaTracker::instance().getDatabaseSizeAndSpaceAvailableToOrigin( | 
| 185         database->securityOrigin()->databaseIdentifier(), | 185         database->securityOrigin()->databaseIdentifier(), | 
| 186         database->stringIdentifier(), &databaseSize, &spaceAvailable); | 186         database->stringIdentifier(), &databaseSize, &spaceAvailable); | 
| 187     return databaseSize + spaceAvailable; | 187     return databaseSize + spaceAvailable; | 
| 188 } | 188 } | 
| 189 | 189 | 
| 190 void DatabaseTracker::interruptAllDatabasesForContext(const ScriptExecutionConte
     xt* context) | 190 void DatabaseTracker::interruptAllDatabasesForContext(const ScriptExecutionConte
     xt* context) | 
| 191 { | 191 { | 
| 192     Vector<RefPtr<AbstractDatabase> > openDatabases; | 192     MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard); | 
| 193     { |  | 
| 194         MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard); |  | 
| 195 | 193 | 
| 196         if (!m_openDatabaseMap) | 194     if (!m_openDatabaseMap) | 
| 197             return; | 195         return; | 
| 198 | 196 | 
| 199         DatabaseNameMap* nameMap = m_openDatabaseMap->get(context->securityOrigi
     n()->databaseIdentifier()); | 197     DatabaseNameMap* nameMap = m_openDatabaseMap->get(context->securityOrigin()-
     >databaseIdentifier()); | 
| 200         if (!nameMap) | 198     if (!nameMap) | 
| 201             return; | 199         return; | 
| 202 | 200 | 
| 203         DatabaseNameMap::const_iterator dbNameMapEndIt = nameMap->end(); | 201     DatabaseNameMap::const_iterator dbNameMapEndIt = nameMap->end(); | 
| 204         for (DatabaseNameMap::const_iterator dbNameMapIt = nameMap->begin(); dbN
     ameMapIt != dbNameMapEndIt; ++dbNameMapIt) { | 202     for (DatabaseNameMap::const_iterator dbNameMapIt = nameMap->begin(); dbNameM
     apIt != dbNameMapEndIt; ++dbNameMapIt) { | 
| 205             DatabaseSet* databaseSet = dbNameMapIt->second; | 203         DatabaseSet* databaseSet = dbNameMapIt->second; | 
| 206             DatabaseSet::const_iterator dbSetEndIt = databaseSet->end(); | 204         DatabaseSet::const_iterator end = databaseSet->end(); | 
| 207             for (DatabaseSet::const_iterator dbSetIt = databaseSet->begin(); dbS
     etIt != dbSetEndIt; ++dbSetIt) { | 205         for (DatabaseSet::const_iterator it = databaseSet->begin(); it != end; +
     +it) { | 
| 208                 if ((*dbSetIt)->scriptExecutionContext() == context) | 206             if ((*it)->scriptExecutionContext() == context) | 
| 209                     openDatabases.append(*dbSetIt); | 207                 (*it)->interrupt(); | 
| 210             } |  | 
| 211         } | 208         } | 
| 212     } | 209     } | 
| 213 |  | 
| 214     Vector<RefPtr<AbstractDatabase> >::const_iterator openDatabasesEndIt = openD
     atabases.end(); |  | 
| 215     for (Vector<RefPtr<AbstractDatabase> >::const_iterator openDatabasesIt = ope
     nDatabases.begin(); openDatabasesIt != openDatabasesEndIt; ++openDatabasesIt) |  | 
| 216         (*openDatabasesIt)->interrupt(); |  | 
| 217 } | 210 } | 
| 218 | 211 | 
| 219 } | 212 } | 
| 220 | 213 | 
| 221 #endif // ENABLE(DATABASE) | 214 #endif // ENABLE(DATABASE) | 
| OLD | NEW | 
|---|