Chromium Code Reviews| Index: content/browser/indexed_db/indexed_db_database.cc |
| diff --git a/content/browser/indexed_db/indexed_db_database.cc b/content/browser/indexed_db/indexed_db_database.cc |
| index f2212d3083d49677da5b802dcb2993bd3fc60cb9..60fbd2afc0513974e10bf08d60501d77e1f74966 100644 |
| --- a/content/browser/indexed_db/indexed_db_database.cc |
| +++ b/content/browser/indexed_db/indexed_db_database.cc |
| @@ -546,8 +546,19 @@ void IndexedDBDatabase::Observe(int64_t transaction_id, int64_t observer_id) { |
| IndexedDBTransaction* transaction = GetTransaction(transaction_id); |
| if (!transaction) |
| return; |
| - transaction->AddPendingObserver( |
| - base::WrapUnique(new IndexedDBObserver(observer_id))); |
| + transaction->AddPendingObserver(observer_id, |
| + new IndexedDBObserver(observer_id)); |
| +} |
| + |
| +void IndexedDBDatabase::Unobserve(std::vector<int64_t> observersToRemove) { |
| + // TODO (palakj): Remove observer from pending_observer queue of transactions |
| + typedef std::map<int64_t, IndexedDBObserver*>::iterator Iterator; |
| + for (uint32_t i = 0; i < observersToRemove.size(); i++) { |
| + Iterator obs = active_observers_.find(observersToRemove[i]); |
| + if (obs != active_observers_.end()) { |
| + active_observers_.erase(obs); |
|
dmurph
2016/06/16 07:30:33
I believe you can just do active_observers_.erase(
palakj1
2016/06/16 17:51:41
Done
palakj1
2016/06/16 17:51:41
Done
|
| + } |
| + } |
| } |
| void IndexedDBDatabase::GetAll(int64_t transaction_id, |