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

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

Issue 18023022: Blob support for IDB [Chromium] (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More small build fixes. Created 6 years, 7 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
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 3b9f0f63a3ba5a3789cb390626f48da25d145bed..ba7d65215da917c2e31f5b1b2498839f0c6d6ce0 100644
--- a/content/browser/indexed_db/indexed_db_backing_store.h
+++ b/content/browser/indexed_db/indexed_db_backing_store.h
@@ -203,6 +203,11 @@ class CONTENT_EXPORT IndexedDBBackingStore
int64 database_id,
int64 object_store_id,
const RecordIdentifier& record) WARN_UNUSED_RESULT;
+ virtual leveldb::Status DeleteRange(
+ IndexedDBBackingStore::Transaction* transaction,
+ int64 database_id,
+ int64 object_store_id,
+ const IndexedDBKeyRange&) WARN_UNUSED_RESULT;
virtual leveldb::Status GetKeyGeneratorCurrentNumber(
IndexedDBBackingStore::Transaction* transaction,
int64 database_id,
@@ -389,7 +394,10 @@ class CONTENT_EXPORT IndexedDBBackingStore
explicit Transaction(IndexedDBBackingStore* backing_store);
virtual ~Transaction();
virtual void Begin();
- virtual leveldb::Status Commit();
+ // The callback will be called eventually on success or failure, or
+ // immediately if phase one is complete due to lack of any blobs to write.
+ virtual leveldb::Status CommitPhaseOne(scoped_refptr<BlobWriteCallback>);
+ virtual leveldb::Status CommitPhaseTwo();
virtual void Rollback();
void Reset() {
backing_store_ = NULL;
@@ -458,16 +466,23 @@ class CONTENT_EXPORT IndexedDBBackingStore
private:
class BlobWriteCallbackWrapper;
+ // These return true on success, false on failure.
cmumford 2014/05/28 20:34:54 Nit: You say "these", but the first one (HandleBlo
ericu 2014/05/28 22:50:42 Yup; the first one used to return bool before I ch
+ leveldb::Status HandleBlobPreTransaction(
+ BlobEntryKeyValuePairVec* new_blob_entries,
+ WriteDescriptorVec* new_files_to_write);
+ bool CollectBlobFilesToRemove();
// The callback will be called eventually on success or failure.
void WriteNewBlobs(BlobEntryKeyValuePairVec& new_blob_entries,
WriteDescriptorVec& new_files_to_write,
scoped_refptr<BlobWriteCallback> callback);
+ leveldb::Status SortBlobsToRemove();
IndexedDBBackingStore* backing_store_;
scoped_refptr<LevelDBTransaction> transaction_;
BlobChangeMap blob_change_map_;
BlobChangeMap incognito_blob_map_;
int64 database_id_;
+ BlobJournalType blobs_to_remove_;
scoped_refptr<ChainedBlobWriter> chained_blob_writer_;
};

Powered by Google App Engine
This is Rietveld 408576698