Chromium Code Reviews| Index: content/browser/indexed_db/indexed_db_cursor.cc |
| diff --git a/content/browser/indexed_db/indexed_db_cursor.cc b/content/browser/indexed_db/indexed_db_cursor.cc |
| index 005d541163d54b57cf7a6ab5c3db5ade2ba5a61c..1e62d6d87586949c3fe14c4b0efded8587438029 100644 |
| --- a/content/browser/indexed_db/indexed_db_cursor.cc |
| +++ b/content/browser/indexed_db/indexed_db_cursor.cc |
| @@ -65,9 +65,16 @@ IndexedDBCursor::IndexedDBCursor( |
| transaction_(transaction), |
| cursor_(std::move(cursor)), |
| closed_(false), |
| - ptr_factory_(this) {} |
| + ptr_factory_(this) { |
| + IDB_ASYNC_TRACE_BEGIN("IndexedDBCursor::lifetime", this); |
| +} |
| -IndexedDBCursor::~IndexedDBCursor() {} |
| +IndexedDBCursor::~IndexedDBCursor() { |
| + if (!closed_) { |
|
cmumford
2017/03/14 16:30:56
Nit: How about Having ::Close() to a:
if (close
dmurph
2017/03/29 23:02:19
Done.
|
| + // Call to make sure we complete our lifetime trace. |
| + Close(); |
| + } |
| +} |
| void IndexedDBCursor::Continue(std::unique_ptr<IndexedDBKey> key, |
| std::unique_ptr<IndexedDBKey> primary_key, |
| @@ -268,6 +275,7 @@ leveldb::Status IndexedDBCursor::PrefetchReset(int used_prefetches, |
| } |
| void IndexedDBCursor::Close() { |
| + IDB_ASYNC_TRACE_END("IndexedDBCursor::lifetime", this); |
|
cmumford
2017/03/14 16:30:56
::lifetime is better called from the destructor si
dmurph
2017/03/29 23:02:19
Changed to ::open
|
| IDB_TRACE("IndexedDBCursor::Close"); |
| closed_ = true; |
| cursor_.reset(); |