| Index: content/browser/indexed_db/indexed_db_cursor.h
|
| diff --git a/content/browser/indexed_db/indexed_db_cursor.h b/content/browser/indexed_db/indexed_db_cursor.h
|
| index 63cb7967afaf4c67a0c8d333b55fea722223fecc..4857c54b5df0d9f5bda02594d38e12a4d008f23a 100644
|
| --- a/content/browser/indexed_db/indexed_db_cursor.h
|
| +++ b/content/browser/indexed_db/indexed_db_cursor.h
|
| @@ -12,6 +12,7 @@
|
|
|
| #include "base/macros.h"
|
| #include "base/memory/ref_counted.h"
|
| +#include "base/memory/weak_ptr.h"
|
| #include "content/browser/indexed_db/indexed_db_backing_store.h"
|
| #include "content/browser/indexed_db/indexed_db_database.h"
|
| #include "content/common/indexed_db/indexed_db_key_range.h"
|
| @@ -21,13 +22,13 @@ namespace content {
|
|
|
| class IndexedDBTransaction;
|
|
|
| -class CONTENT_EXPORT IndexedDBCursor
|
| - : NON_EXPORTED_BASE(public base::RefCounted<IndexedDBCursor>) {
|
| +class CONTENT_EXPORT IndexedDBCursor {
|
| public:
|
| IndexedDBCursor(std::unique_ptr<IndexedDBBackingStore::Cursor> cursor,
|
| indexed_db::CursorType cursor_type,
|
| blink::WebIDBTaskType task_type,
|
| IndexedDBTransaction* transaction);
|
| + ~IndexedDBCursor();
|
|
|
| void Advance(uint32_t count, scoped_refptr<IndexedDBCallbacks> callbacks);
|
| void Continue(std::unique_ptr<IndexedDBKey> key,
|
| @@ -45,6 +46,8 @@ class CONTENT_EXPORT IndexedDBCursor
|
| }
|
| void Close();
|
|
|
| + void RemoveCursorFromTransaction();
|
| +
|
| void CursorIterationOperation(std::unique_ptr<IndexedDBKey> key,
|
| std::unique_ptr<IndexedDBKey> primary_key,
|
| scoped_refptr<IndexedDBCallbacks> callbacks,
|
| @@ -58,13 +61,11 @@ class CONTENT_EXPORT IndexedDBCursor
|
| IndexedDBTransaction* transaction);
|
|
|
| private:
|
| - friend class base::RefCounted<IndexedDBCursor>;
|
| -
|
| - ~IndexedDBCursor();
|
| -
|
| blink::WebIDBTaskType task_type_;
|
| indexed_db::CursorType cursor_type_;
|
| - const scoped_refptr<IndexedDBTransaction> transaction_;
|
| +
|
| + // We rely on the transaction calling Close() to clear this.
|
| + IndexedDBTransaction* transaction_;
|
|
|
| // Must be destroyed before transaction_.
|
| std::unique_ptr<IndexedDBBackingStore::Cursor> cursor_;
|
| @@ -73,6 +74,8 @@ class CONTENT_EXPORT IndexedDBCursor
|
|
|
| bool closed_;
|
|
|
| + base::WeakPtrFactory<IndexedDBCursor> ptr_factory_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(IndexedDBCursor);
|
| };
|
|
|
|
|