Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(668)

Unified Diff: content/browser/indexed_db/indexed_db_cursor.cc

Issue 2745703002: [IndexedDB] Added IndexedDBCursor lifetime tracing (Closed)
Patch Set: comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..40efc786e55a727cb55beac012c4b423681cfbeb 100644
--- a/content/browser/indexed_db/indexed_db_cursor.cc
+++ b/content/browser/indexed_db/indexed_db_cursor.cc
@@ -65,9 +65,14 @@ IndexedDBCursor::IndexedDBCursor(
transaction_(transaction),
cursor_(std::move(cursor)),
closed_(false),
- ptr_factory_(this) {}
+ ptr_factory_(this) {
+ IDB_ASYNC_TRACE_BEGIN("IndexedDBCursor::open", this);
+}
-IndexedDBCursor::~IndexedDBCursor() {}
+IndexedDBCursor::~IndexedDBCursor() {
+ // 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 +273,9 @@ leveldb::Status IndexedDBCursor::PrefetchReset(int used_prefetches,
}
void IndexedDBCursor::Close() {
+ if (closed_)
+ return;
+ IDB_ASYNC_TRACE_END("IndexedDBCursor::open", this);
IDB_TRACE("IndexedDBCursor::Close");
closed_ = true;
cursor_.reset();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698