OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/indexed_db/indexed_db_connection.h" | 5 #include "content/browser/indexed_db/indexed_db_connection.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "content/browser/indexed_db/indexed_db_class_factory.h" | 9 #include "content/browser/indexed_db/indexed_db_class_factory.h" |
10 #include "content/browser/indexed_db/indexed_db_database_callbacks.h" | 10 #include "content/browser/indexed_db/indexed_db_database_callbacks.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
151 base::WeakPtr<IndexedDBTransaction> transaction_ptr = | 151 base::WeakPtr<IndexedDBTransaction> transaction_ptr = |
152 transaction->ptr_factory_.GetWeakPtr(); | 152 transaction->ptr_factory_.GetWeakPtr(); |
153 transactions_[transaction->id()] = std::move(transaction); | 153 transactions_[transaction->id()] = std::move(transaction); |
154 return transaction_ptr; | 154 return transaction_ptr; |
155 } | 155 } |
156 | 156 |
157 void IndexedDBConnection::RemoveTransaction(int64_t id) { | 157 void IndexedDBConnection::RemoveTransaction(int64_t id) { |
158 transactions_.erase(id); | 158 transactions_.erase(id); |
159 } | 159 } |
160 | 160 |
161 int64_t IndexedDBConnection::NextObserverTransactionId() { | |
cmumford
2017/01/09 21:31:25
nit: "Next*" might be interpreted as a read-only o
dmurph
2017/01/10 00:17:38
NewObserverTransactionId?
| |
162 // If we ever overflow, just reset the ID. | |
163 if (next_observer_transaction_id_ == kMaxObserverTransactionId) { | |
164 next_observer_transaction_id_ = 1ll << 32; | |
165 } | |
166 return next_observer_transaction_id_++; | |
167 } | |
168 | |
161 } // namespace content | 169 } // namespace content |
OLD | NEW |