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

Unified Diff: content/browser/indexed_db/indexed_db_backing_store.h

Issue 2472213003: [IndexedDB] Refactoring to remove ref ptrs and host transaction ids. (Closed)
Patch Set: rebase Created 4 years 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
Index: content/browser/indexed_db/indexed_db_backing_store.h
diff --git a/content/browser/indexed_db/indexed_db_backing_store.h b/content/browser/indexed_db/indexed_db_backing_store.h
index 00d6678f6df333b87daeb6b430f7466b5d0740c3..acbfa6746cadc6681267f2c85004f91246c111c6 100644
--- a/content/browser/indexed_db/indexed_db_backing_store.h
+++ b/content/browser/indexed_db/indexed_db_backing_store.h
@@ -19,6 +19,7 @@
#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
#include "base/strings/string_piece.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
@@ -90,9 +91,17 @@ class CONTENT_EXPORT IndexedDBBackingStore
DISALLOW_COPY_AND_ASSIGN(RecordIdentifier);
};
+ enum class BlobWriteResult {
+ FAIILURE_ASYNC,
cmumford 2016/12/01 19:14:50 You have two I's in FAIILURE_ASYNC. Also clang-fo
dmurph 2016/12/01 21:12:23 Done. I just upload whatever 'git cl format' does.
+ SUCCESS_ASYNC,
+ SUCCESS_SYNC
+ };
+
class BlobWriteCallback : public base::RefCounted<BlobWriteCallback> {
public:
- virtual void Run(bool succeeded) = 0;
+ // TODO(dmurph): Make all calls to this method async after measuring
+ // performance.
+ virtual leveldb::Status Run(BlobWriteResult result) = 0;
protected:
friend class base::RefCounted<BlobWriteCallback>;
@@ -282,6 +291,8 @@ class CONTENT_EXPORT IndexedDBBackingStore
// has been bumped, and journal cleaning should be deferred.
bool committing_;
+ base::WeakPtrFactory<Transaction> ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(Transaction);
};

Powered by Google App Engine
This is Rietveld 408576698