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

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

Issue 2745703002: [IndexedDB] Added IndexedDBCursor lifetime tracing (Closed)
Patch Set: Trace end on close 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..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();
« 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