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 18 matching lines...) Expand all Loading... |
29 #include "modules/indexeddb/IDBBackingStore.h" | 29 #include "modules/indexeddb/IDBBackingStore.h" |
30 #include "modules/indexeddb/IDBCursorBackendImpl.h" | 30 #include "modules/indexeddb/IDBCursorBackendImpl.h" |
31 #include "modules/indexeddb/IDBDatabaseBackendImpl.h" | 31 #include "modules/indexeddb/IDBDatabaseBackendImpl.h" |
32 #include "modules/indexeddb/IDBDatabaseCallbacks.h" | 32 #include "modules/indexeddb/IDBDatabaseCallbacks.h" |
33 #include "modules/indexeddb/IDBDatabaseException.h" | 33 #include "modules/indexeddb/IDBDatabaseException.h" |
34 #include "modules/indexeddb/IDBTracing.h" | 34 #include "modules/indexeddb/IDBTracing.h" |
35 #include "modules/indexeddb/IDBTransactionCoordinator.h" | 35 #include "modules/indexeddb/IDBTransactionCoordinator.h" |
36 | 36 |
37 namespace WebCore { | 37 namespace WebCore { |
38 | 38 |
39 PassRefPtr<IDBTransactionBackendImpl> IDBTransactionBackendImpl::create(int64_t
id, PassRefPtr<IDBDatabaseCallbacks> callbacks, const Vector<int64_t>& objectSto
reIds, IndexedDB::TransactionMode mode, IDBDatabaseBackendImpl* database) | 39 PassRefPtr<IDBTransactionBackendImpl> IDBTransactionBackendImpl::create(int64_t
id, IDBDatabaseCallbacks* callbacks, const Vector<int64_t>& objectStoreIds, Inde
xedDB::TransactionMode mode, IDBDatabaseBackendImpl* database) |
40 { | 40 { |
41 HashSet<int64_t> objectStoreHashSet; | 41 HashSet<int64_t> objectStoreHashSet; |
42 for (size_t i = 0; i < objectStoreIds.size(); ++i) | 42 for (size_t i = 0; i < objectStoreIds.size(); ++i) |
43 objectStoreHashSet.add(objectStoreIds[i]); | 43 objectStoreHashSet.add(objectStoreIds[i]); |
44 | 44 |
45 return adoptRef(new IDBTransactionBackendImpl(id, callbacks, objectStoreHash
Set, mode, database)); | 45 return adoptRef(new IDBTransactionBackendImpl(id, callbacks, objectStoreHash
Set, mode, database)); |
46 } | 46 } |
47 | 47 |
48 IDBTransactionBackendImpl::IDBTransactionBackendImpl(int64_t id, PassRefPtr<IDBD
atabaseCallbacks> callbacks, const HashSet<int64_t>& objectStoreIds, IndexedDB::
TransactionMode mode, IDBDatabaseBackendImpl* database) | 48 IDBTransactionBackendImpl::IDBTransactionBackendImpl(int64_t id, IDBDatabaseCall
backs* callbacks, const HashSet<int64_t>& objectStoreIds, IndexedDB::Transaction
Mode mode, IDBDatabaseBackendImpl* database) |
49 : m_id(id) | 49 : m_id(id) |
50 , m_objectStoreIds(objectStoreIds) | 50 , m_objectStoreIds(objectStoreIds) |
51 , m_mode(mode) | 51 , m_mode(mode) |
52 , m_state(Unused) | 52 , m_state(Unused) |
53 , m_commitPending(false) | 53 , m_commitPending(false) |
54 , m_callbacks(callbacks) | 54 , m_callbacks(callbacks) |
55 , m_database(database) | 55 , m_database(database) |
56 , m_transaction(database->backingStore().get()) | 56 , m_transaction(database->backingStore().get()) |
57 , m_taskTimer(this, &IDBTransactionBackendImpl::taskTimerFired) | 57 , m_taskTimer(this, &IDBTransactionBackendImpl::taskTimerFired) |
58 , m_pendingPreemptiveEvents(0) | 58 , m_pendingPreemptiveEvents(0) |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 } | 259 } |
260 | 260 |
261 void IDBTransactionBackendImpl::closeOpenCursors() | 261 void IDBTransactionBackendImpl::closeOpenCursors() |
262 { | 262 { |
263 for (HashSet<IDBCursorBackendImpl*>::iterator i = m_openCursors.begin(); i !
= m_openCursors.end(); ++i) | 263 for (HashSet<IDBCursorBackendImpl*>::iterator i = m_openCursors.begin(); i !
= m_openCursors.end(); ++i) |
264 (*i)->close(); | 264 (*i)->close(); |
265 m_openCursors.clear(); | 265 m_openCursors.clear(); |
266 } | 266 } |
267 | 267 |
268 } // namespace WebCore | 268 } // namespace WebCore |
OLD | NEW |