Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: Source/modules/indexeddb/IDBDatabase.cpp

Issue 14232020: Ensure IDB transactions started before success arrives see correct medata (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/modules/indexeddb/IDBDatabase.h ('k') | Source/modules/indexeddb/IDBObjectStore.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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(&currentTransactionId); 81 return atomicIncrement(&currentTransactionId);
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
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
OLDNEW
« no previous file with comments | « Source/modules/indexeddb/IDBDatabase.h ('k') | Source/modules/indexeddb/IDBObjectStore.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698