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

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: Merged out--bot failed due to staleness. 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
« no previous file with comments | « no previous file | content/browser/indexed_db/indexed_db_backing_store.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..febcd70acdc2acc468b3bb06c0c262ebc264cf54 100644
--- a/content/browser/indexed_db/indexed_db_backing_store.h
+++ b/content/browser/indexed_db/indexed_db_backing_store.h
@@ -64,7 +64,7 @@ class CONTENT_EXPORT IndexedDBBackingStore
public:
class CONTENT_EXPORT Transaction;
- class Comparator : public LevelDBComparator {
+ class CONTENT_EXPORT Comparator : public LevelDBComparator {
public:
virtual int Compare(const base::StringPiece& a,
const base::StringPiece& b) const OVERRIDE;
@@ -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;
+ leveldb::Status HandleBlobPreTransaction(
+ BlobEntryKeyValuePairVec* new_blob_entries,
+ WriteDescriptorVec* new_files_to_write);
+ // Returns true on success, false on failure.
+ 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_;
};
« no previous file with comments | « no previous file | content/browser/indexed_db/indexed_db_backing_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698