| 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/IDBObserver.h" | 5 #include "modules/indexeddb/IDBObserver.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ExceptionState.h" | 7 #include "bindings/core/v8/ExceptionState.h" |
| 8 #include "bindings/modules/v8/IDBObserverCallback.h" | 8 #include "bindings/modules/v8/IDBObserverCallback.h" |
| 9 #include "bindings/modules/v8/ToV8ForModules.h" | 9 #include "bindings/modules/v8/ToV8ForModules.h" |
| 10 #include "bindings/modules/v8/V8BindingForModules.h" | 10 #include "bindings/modules/v8/V8BindingForModules.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 | 95 |
| 96 void IDBObserver::removeObserver(int32_t id) { | 96 void IDBObserver::removeObserver(int32_t id) { |
| 97 m_observerIds.remove(id); | 97 m_observerIds.remove(id); |
| 98 } | 98 } |
| 99 | 99 |
| 100 void IDBObserver::onChange(int32_t id, | 100 void IDBObserver::onChange(int32_t id, |
| 101 const WebVector<WebIDBObservation>& observations, | 101 const WebVector<WebIDBObservation>& observations, |
| 102 const WebVector<int32_t>& observationIndex) { | 102 const WebVector<int32_t>& observationIndex) { |
| 103 auto it = m_observerIds.find(id); | 103 auto it = m_observerIds.find(id); |
| 104 DCHECK(it != m_observerIds.end()); | 104 DCHECK(it != m_observerIds.end()); |
| 105 // TODO(bashi): Make sure that using TrackExceptionState is OK. | |
| 106 // crbug.com/653769 | |
| 107 TrackExceptionState exceptionState; | |
| 108 m_callback->call( | 105 m_callback->call( |
| 109 m_scriptState.get(), this, exceptionState, | 106 m_scriptState.get(), this, |
| 110 IDBObserverChanges::create(it->value, observations, observationIndex)); | 107 IDBObserverChanges::create(it->value, observations, observationIndex)); |
| 111 } | 108 } |
| 112 | 109 |
| 113 DEFINE_TRACE(IDBObserver) { | 110 DEFINE_TRACE(IDBObserver) { |
| 114 visitor->trace(m_callback); | 111 visitor->trace(m_callback); |
| 115 visitor->trace(m_observerIds); | 112 visitor->trace(m_observerIds); |
| 116 } | 113 } |
| 117 | 114 |
| 118 } // namespace blink | 115 } // namespace blink |
| OLD | NEW |