Commit 5a910a6e authored by ericu@chromium.org's avatar ericu@chromium.org

Add most of the metadata-handling code for blobs. It's not quite all there, but

this is the biggest chunk I can pull out vaguely cleanly.  It does contain a
couple of fake calls to keep the compiler happy.
This CL also makes SetUpMetadata a member in order to ease testing in a later CL.

This depends on https://codereview.chromium.org/261843004/.

BUG=108012

Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=270016

Review URL: https://codereview.chromium.org/266333002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273048 0039d316-1c4b-4281-b951-d872f2087c98
parent 13a16eb5
......@@ -308,7 +308,9 @@ class CONTENT_EXPORT IndexedDBBackingStore
virtual bool LoadCurrentRow() = 0;
protected:
Cursor(LevelDBTransaction* transaction,
Cursor(scoped_refptr<IndexedDBBackingStore> backing_store,
Transaction* transaction,
int64 database_id,
const CursorOptions& cursor_options);
explicit Cursor(const IndexedDBBackingStore::Cursor* other);
......@@ -319,7 +321,9 @@ class CONTENT_EXPORT IndexedDBBackingStore
bool IsPastBounds() const;
bool HaveEnteredRange() const;
LevelDBTransaction* transaction_;
IndexedDBBackingStore* backing_store_;
Transaction* transaction_;
int64 database_id_;
const CursorOptions cursor_options_;
scoped_ptr<LevelDBIterator> iterator_;
scoped_ptr<IndexedDBKey> current_key_;
......@@ -399,6 +403,11 @@ class CONTENT_EXPORT IndexedDBBackingStore
LevelDBTransaction* transaction() { return transaction_; }
leveldb::Status GetBlobInfoForRecord(
int64 database_id,
const std::string& object_store_data_key,
IndexedDBValue* value);
// This holds a BlobEntryKey and the encoded IndexedDBBlobInfo vector stored
// under that key.
typedef std::vector<std::pair<BlobEntryKey, std::string> >
......@@ -475,6 +484,8 @@ class CONTENT_EXPORT IndexedDBBackingStore
bool is_incognito() const { return !indexed_db_factory_; }
bool SetUpMetadata();
virtual bool WriteBlobFile(
int64 database_id,
const Transaction::WriteDescriptor& descriptor,
......
......@@ -46,7 +46,8 @@
// <0, 0, 0, 2> => SerializedScriptValue version [DataVersionKey]
// <0, 0, 0, 3>
// => Blob journal
// The format of the journal is: {database_id, blobKey}*.
// The format of the journal is:
// {database_id (var int), blobKey (var int)}*.
// If the blobKey is kAllBlobsKey, the whole database should be deleted.
// [BlobJournalKey]
// <0, 0, 0, 4> => Live blob journal; same format. [LiveBlobJournalKey]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment