OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 } | 74 } |
75 | 75 |
76 int64_t IDBDatabase::nextTransactionId() | 76 int64_t IDBDatabase::nextTransactionId() |
77 { | 77 { |
78 // Only keep a 32-bit counter to allow ports to use the other 32 | 78 // Only keep a 32-bit counter to allow ports to use the other 32 |
79 // bits of the id. | 79 // bits of the id. |
80 AtomicallyInitializedStatic(int, currentTransactionId = 0); | 80 AtomicallyInitializedStatic(int, currentTransactionId = 0); |
81 return atomicIncrement(¤tTransactionId); | 81 return atomicIncrement(¤tTransactionId); |
82 } | 82 } |
83 | 83 |
| 84 void IDBDatabase::indexCreated(int64_t objectStoreId, const IDBIndexMetadata& me
tadata) |
| 85 { |
| 86 IDBDatabaseMetadata::ObjectStoreMap::iterator it = m_metadata.objectStores.f
ind(objectStoreId); |
| 87 ASSERT(it != m_metadata.objectStores.end()); |
| 88 it->value.indexes.set(metadata.id, metadata); |
| 89 } |
| 90 |
| 91 void IDBDatabase::indexDeleted(int64_t objectStoreId, int64_t indexId) |
| 92 { |
| 93 IDBDatabaseMetadata::ObjectStoreMap::iterator it = m_metadata.objectStores.f
ind(objectStoreId); |
| 94 ASSERT(it != m_metadata.objectStores.end()); |
| 95 it->value.indexes.remove(indexId); |
| 96 } |
| 97 |
84 void IDBDatabase::transactionCreated(IDBTransaction* transaction) | 98 void IDBDatabase::transactionCreated(IDBTransaction* transaction) |
85 { | 99 { |
86 ASSERT(transaction); | 100 ASSERT(transaction); |
87 ASSERT(!m_transactions.contains(transaction->id())); | 101 ASSERT(!m_transactions.contains(transaction->id())); |
88 m_transactions.add(transaction->id(), transaction); | 102 m_transactions.add(transaction->id(), transaction); |
89 | 103 |
90 if (transaction->isVersionChange()) { | 104 if (transaction->isVersionChange()) { |
91 ASSERT(!m_versionChangeTransaction); | 105 ASSERT(!m_versionChangeTransaction); |
92 m_versionChangeTransaction = transaction; | 106 m_versionChangeTransaction = transaction; |
93 } | 107 } |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 { | 390 { |
377 return &m_eventTargetData; | 391 return &m_eventTargetData; |
378 } | 392 } |
379 | 393 |
380 EventTargetData* IDBDatabase::ensureEventTargetData() | 394 EventTargetData* IDBDatabase::ensureEventTargetData() |
381 { | 395 { |
382 return &m_eventTargetData; | 396 return &m_eventTargetData; |
383 } | 397 } |
384 | 398 |
385 } // namespace WebCore | 399 } // namespace WebCore |
OLD | NEW |