| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "modules/indexeddb/IDBObserverChanges.h" | 5 #include "modules/indexeddb/IDBObserverChanges.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ExceptionState.h" | 7 #include "bindings/core/v8/ExceptionState.h" |
| 8 #include "bindings/core/v8/ScriptState.h" | 8 #include "bindings/core/v8/ScriptState.h" |
| 9 #include "bindings/core/v8/V8Binding.h" | 9 #include "bindings/core/v8/V8Binding.h" |
| 10 #include "bindings/modules/v8/ToV8ForModules.h" | 10 #include "bindings/modules/v8/ToV8ForModules.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 : m_database(database), m_transaction(transaction) { | 53 : m_database(database), m_transaction(transaction) { |
| 54 extractChanges(observations, observationIndices); | 54 extractChanges(observations, observationIndices); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void IDBObserverChanges::extractChanges( | 57 void IDBObserverChanges::extractChanges( |
| 58 const WebVector<WebIDBObservation>& observations, | 58 const WebVector<WebIDBObservation>& observations, |
| 59 const WebVector<int32_t>& observationIndices) { | 59 const WebVector<int32_t>& observationIndices) { |
| 60 // TODO(dmurph): Avoid getting and setting repeated times. | 60 // TODO(dmurph): Avoid getting and setting repeated times. |
| 61 for (const auto& idx : observationIndices) { | 61 for (const auto& idx : observationIndices) { |
| 62 m_records | 62 m_records |
| 63 .add(observations[idx].objectStoreId, | 63 .insert(observations[idx].objectStoreId, |
| 64 HeapVector<Member<IDBObservation>>()) | 64 HeapVector<Member<IDBObservation>>()) |
| 65 .storedValue->value.push_back( | 65 .storedValue->value.push_back( |
| 66 IDBObservation::create(observations[idx])); | 66 IDBObservation::create(observations[idx])); |
| 67 } | 67 } |
| 68 } | 68 } |
| 69 | 69 |
| 70 DEFINE_TRACE(IDBObserverChanges) { | 70 DEFINE_TRACE(IDBObserverChanges) { |
| 71 visitor->trace(m_database); | 71 visitor->trace(m_database); |
| 72 visitor->trace(m_transaction); | 72 visitor->trace(m_transaction); |
| 73 visitor->trace(m_records); | 73 visitor->trace(m_records); |
| 74 } | 74 } |
| 75 | 75 |
| 76 } // namespace blink | 76 } // namespace blink |
| OLD | NEW |