| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2013 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 void SQLTransactionCoordinator::acquireLock(SQLTransactionBackend* transaction) | 71 void SQLTransactionCoordinator::acquireLock(SQLTransactionBackend* transaction) |
| 72 { | 72 { |
| 73 ASSERT(!m_isShuttingDown); | 73 ASSERT(!m_isShuttingDown); |
| 74 | 74 |
| 75 String dbIdentifier = getDatabaseIdentifier(transaction); | 75 String dbIdentifier = getDatabaseIdentifier(transaction); |
| 76 | 76 |
| 77 CoordinationInfoMap::iterator coordinationInfoIterator = m_coordinationInfoM
ap.find(dbIdentifier); | 77 CoordinationInfoMap::iterator coordinationInfoIterator = m_coordinationInfoM
ap.find(dbIdentifier); |
| 78 if (coordinationInfoIterator == m_coordinationInfoMap.end()) { | 78 if (coordinationInfoIterator == m_coordinationInfoMap.end()) { |
| 79 // No pending transactions for this DB | 79 // No pending transactions for this DB |
| 80 coordinationInfoIterator = m_coordinationInfoMap.add(dbIdentifier, Coord
inationInfo()).iterator; | 80 CoordinationInfo& info = m_coordinationInfoMap.add(dbIdentifier, Coordin
ationInfo()).iterator->value; |
| 81 info.pendingTransactions.append(transaction); |
| 82 processPendingTransactions(info); |
| 83 } else { |
| 84 CoordinationInfo& info = coordinationInfoIterator->value; |
| 85 info.pendingTransactions.append(transaction); |
| 86 processPendingTransactions(info); |
| 81 } | 87 } |
| 82 | 88 |
| 83 CoordinationInfo& info = coordinationInfoIterator->value; | |
| 84 info.pendingTransactions.append(transaction); | |
| 85 processPendingTransactions(info); | |
| 86 } | 89 } |
| 87 | 90 |
| 88 void SQLTransactionCoordinator::releaseLock(SQLTransactionBackend* transaction) | 91 void SQLTransactionCoordinator::releaseLock(SQLTransactionBackend* transaction) |
| 89 { | 92 { |
| 90 if (m_isShuttingDown) | 93 if (m_isShuttingDown) |
| 91 return; | 94 return; |
| 92 | 95 |
| 93 String dbIdentifier = getDatabaseIdentifier(transaction); | 96 String dbIdentifier = getDatabaseIdentifier(transaction); |
| 94 | 97 |
| 95 CoordinationInfoMap::iterator coordinationInfoIterator = m_coordinationInfoM
ap.find(dbIdentifier); | 98 CoordinationInfoMap::iterator coordinationInfoIterator = m_coordinationInfoM
ap.find(dbIdentifier); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 RefPtr<SQLTransactionBackend> transaction = info.pendingTransactions
.first(); | 140 RefPtr<SQLTransactionBackend> transaction = info.pendingTransactions
.first(); |
| 138 transaction->notifyDatabaseThreadIsShuttingDown(); | 141 transaction->notifyDatabaseThreadIsShuttingDown(); |
| 139 } | 142 } |
| 140 } | 143 } |
| 141 | 144 |
| 142 // Clean up all pending transactions for all databases | 145 // Clean up all pending transactions for all databases |
| 143 m_coordinationInfoMap.clear(); | 146 m_coordinationInfoMap.clear(); |
| 144 } | 147 } |
| 145 | 148 |
| 146 } // namespace WebCore | 149 } // namespace WebCore |
| OLD | NEW |