| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 DatabaseBackend* database = transaction->database(); | 42 DatabaseBackend* database = transaction->database(); |
| 43 ASSERT(database); | 43 ASSERT(database); |
| 44 return database->stringIdentifier(); | 44 return database->stringIdentifier(); |
| 45 } | 45 } |
| 46 | 46 |
| 47 SQLTransactionCoordinator::SQLTransactionCoordinator() | 47 SQLTransactionCoordinator::SQLTransactionCoordinator() |
| 48 : m_isShuttingDown(false) | 48 : m_isShuttingDown(false) |
| 49 { | 49 { |
| 50 } | 50 } |
| 51 | 51 |
| 52 void SQLTransactionCoordinator::trace(Visitor* visitor) |
| 53 { |
| 54 visitor->trace(m_coordinationInfoMap); |
| 55 } |
| 56 |
| 52 void SQLTransactionCoordinator::processPendingTransactions(CoordinationInfo& inf
o) | 57 void SQLTransactionCoordinator::processPendingTransactions(CoordinationInfo& inf
o) |
| 53 { | 58 { |
| 54 if (info.activeWriteTransaction || info.pendingTransactions.isEmpty()) | 59 if (info.activeWriteTransaction || info.pendingTransactions.isEmpty()) |
| 55 return; | 60 return; |
| 56 | 61 |
| 57 RefPtrWillBeRawPtr<SQLTransactionBackend> firstPendingTransaction = info.pen
dingTransactions.first(); | 62 RefPtrWillBeRawPtr<SQLTransactionBackend> firstPendingTransaction = info.pen
dingTransactions.first(); |
| 58 if (firstPendingTransaction->isReadOnly()) { | 63 if (firstPendingTransaction->isReadOnly()) { |
| 59 do { | 64 do { |
| 60 firstPendingTransaction = info.pendingTransactions.takeFirst(); | 65 firstPendingTransaction = info.pendingTransactions.takeFirst(); |
| 61 info.activeReadTransactions.add(firstPendingTransaction); | 66 info.activeReadTransactions.add(firstPendingTransaction); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 RefPtrWillBeRawPtr<SQLTransactionBackend> transaction = info.pending
Transactions.first(); | 145 RefPtrWillBeRawPtr<SQLTransactionBackend> transaction = info.pending
Transactions.first(); |
| 141 transaction->notifyDatabaseThreadIsShuttingDown(); | 146 transaction->notifyDatabaseThreadIsShuttingDown(); |
| 142 } | 147 } |
| 143 } | 148 } |
| 144 | 149 |
| 145 // Clean up all pending transactions for all databases | 150 // Clean up all pending transactions for all databases |
| 146 m_coordinationInfoMap.clear(); | 151 m_coordinationInfoMap.clear(); |
| 147 } | 152 } |
| 148 | 153 |
| 149 } // namespace WebCore | 154 } // namespace WebCore |
| OLD | NEW |