| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 97 |
| 98 String dbIdentifier = getDatabaseIdentifier(transaction); | 98 String dbIdentifier = getDatabaseIdentifier(transaction); |
| 99 | 99 |
| 100 CoordinationInfoHeapMap::iterator coordinationInfoIterator = | 100 CoordinationInfoHeapMap::iterator coordinationInfoIterator = |
| 101 m_coordinationInfoMap.find(dbIdentifier); | 101 m_coordinationInfoMap.find(dbIdentifier); |
| 102 SECURITY_DCHECK(coordinationInfoIterator != m_coordinationInfoMap.end()); | 102 SECURITY_DCHECK(coordinationInfoIterator != m_coordinationInfoMap.end()); |
| 103 CoordinationInfo& info = coordinationInfoIterator->value; | 103 CoordinationInfo& info = coordinationInfoIterator->value; |
| 104 | 104 |
| 105 if (transaction->isReadOnly()) { | 105 if (transaction->isReadOnly()) { |
| 106 ASSERT(info.activeReadTransactions.contains(transaction)); | 106 ASSERT(info.activeReadTransactions.contains(transaction)); |
| 107 info.activeReadTransactions.remove(transaction); | 107 info.activeReadTransactions.erase(transaction); |
| 108 } else { | 108 } else { |
| 109 ASSERT(info.activeWriteTransaction == transaction); | 109 ASSERT(info.activeWriteTransaction == transaction); |
| 110 info.activeWriteTransaction = nullptr; | 110 info.activeWriteTransaction = nullptr; |
| 111 } | 111 } |
| 112 | 112 |
| 113 processPendingTransactions(info); | 113 processPendingTransactions(info); |
| 114 } | 114 } |
| 115 | 115 |
| 116 void SQLTransactionCoordinator::shutdown() { | 116 void SQLTransactionCoordinator::shutdown() { |
| 117 // Prevent releaseLock() from accessing / changing the coordinationInfo | 117 // Prevent releaseLock() from accessing / changing the coordinationInfo |
| (...skipping 24 matching lines...) Expand all Loading... |
| 142 SQLTransactionBackend* transaction = info.pendingTransactions.takeFirst(); | 142 SQLTransactionBackend* transaction = info.pendingTransactions.takeFirst(); |
| 143 transaction->notifyDatabaseThreadIsShuttingDown(); | 143 transaction->notifyDatabaseThreadIsShuttingDown(); |
| 144 } | 144 } |
| 145 } | 145 } |
| 146 | 146 |
| 147 // Clean up all pending transactions for all databases | 147 // Clean up all pending transactions for all databases |
| 148 m_coordinationInfoMap.clear(); | 148 m_coordinationInfoMap.clear(); |
| 149 } | 149 } |
| 150 | 150 |
| 151 } // namespace blink | 151 } // namespace blink |
| OLD | NEW |