| 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/core/v8/ExceptionStatePlaceholder.h" | 8 #include "bindings/core/v8/ExceptionStatePlaceholder.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 27 matching lines...) Expand all Loading... |
| 38 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase::
transactionInactiveErrorMessage); | 38 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase::
transactionInactiveErrorMessage); |
| 39 return; | 39 return; |
| 40 } | 40 } |
| 41 if (!database->backend()) { | 41 if (!database->backend()) { |
| 42 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::databas
eClosedErrorMessage); | 42 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::databas
eClosedErrorMessage); |
| 43 return; | 43 return; |
| 44 } | 44 } |
| 45 database->backend()->observe(this, transaction->id()); | 45 database->backend()->observe(this, transaction->id()); |
| 46 } | 46 } |
| 47 | 47 |
| 48 void IDBObserver::unobserve(IDBDatabase* database, ExceptionState& exceptionStat
e) |
| 49 { |
| 50 if (!database->backend()) { |
| 51 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::databas
eClosedErrorMessage); |
| 52 return; |
| 53 } |
| 54 database->backend()->unobserve(this); |
| 55 } |
| 56 |
| 48 DEFINE_TRACE(IDBObserver) | 57 DEFINE_TRACE(IDBObserver) |
| 49 { | 58 { |
| 50 visitor->trace(m_callback); | 59 visitor->trace(m_callback); |
| 51 } | 60 } |
| 52 | 61 |
| 53 } // namespace blink | 62 } // namespace blink |
| OLD | NEW |