| Index: content/browser/indexed_db/indexed_db_database.h
|
| diff --git a/content/browser/indexed_db/indexed_db_database.h b/content/browser/indexed_db/indexed_db_database.h
|
| index 49cf2372f38e41df9118d84056c667a0660cd129..c779251cfb116107e95aadb90b6e4f1d96d3797b 100644
|
| --- a/content/browser/indexed_db/indexed_db_database.h
|
| +++ b/content/browser/indexed_db/indexed_db_database.h
|
| @@ -49,6 +49,7 @@ class CONTENT_EXPORT IndexedDBDatabase
|
| public:
|
| // Identifier is pair of (origin, database name).
|
| using Identifier = std::pair<url::Origin, base::string16>;
|
| + using OperationResult = leveldb::Status;
|
|
|
| static const int64_t kInvalidId = 0;
|
| static const int64_t kMinimumIndexId = 30;
|
| @@ -65,6 +66,7 @@ class CONTENT_EXPORT IndexedDBDatabase
|
|
|
| int64_t id() const { return metadata_.id; }
|
| const base::string16& name() const { return metadata_.name; }
|
| + const url::Origin& origin() const { return identifier_.first; }
|
|
|
| void AddObjectStore(const IndexedDBObjectStoreMetadata& metadata,
|
| int64_t new_max_object_store_id);
|
| @@ -136,9 +138,6 @@ class CONTENT_EXPORT IndexedDBDatabase
|
| void TransactionCreated(IndexedDBTransaction* transaction);
|
| void TransactionFinished(IndexedDBTransaction* transaction, bool committed);
|
|
|
| - // Called by transactions to report failure committing to the backing store.
|
| - void TransactionCommitFailed(const leveldb::Status& status);
|
| -
|
| void AddPendingObserver(int64_t transaction_id,
|
| int32_t observer_id,
|
| const IndexedDBObserver::Options& options);
|
| @@ -212,69 +211,66 @@ class CONTENT_EXPORT IndexedDBDatabase
|
| size_t PendingOpenDeleteCount() const { return pending_requests_.size(); }
|
|
|
| // Asynchronous tasks scheduled within transactions:
|
| - void CreateObjectStoreAbortOperation(int64_t object_store_id,
|
| - IndexedDBTransaction* transaction);
|
| - void DeleteObjectStoreOperation(int64_t object_store_id,
|
| - IndexedDBTransaction* transaction);
|
| + void CreateObjectStoreAbortOperation(int64_t object_store_id);
|
| + OperationResult DeleteObjectStoreOperation(int64_t object_store_id,
|
| + IndexedDBTransaction* transaction);
|
| void DeleteObjectStoreAbortOperation(
|
| - const IndexedDBObjectStoreMetadata& object_store_metadata,
|
| - IndexedDBTransaction* transaction);
|
| + const IndexedDBObjectStoreMetadata& object_store_metadata);
|
| void RenameObjectStoreAbortOperation(int64_t object_store_id,
|
| - const base::string16& old_name,
|
| + const base::string16& old_name);
|
| + OperationResult VersionChangeOperation(
|
| + int64_t version,
|
| + scoped_refptr<IndexedDBCallbacks> callbacks,
|
| + IndexedDBTransaction* transaction);
|
| + void VersionChangeAbortOperation(int64_t previous_version);
|
| + OperationResult DeleteIndexOperation(int64_t object_store_id,
|
| + int64_t index_id,
|
| IndexedDBTransaction* transaction);
|
| - void VersionChangeOperation(int64_t version,
|
| - scoped_refptr<IndexedDBCallbacks> callbacks,
|
| - IndexedDBTransaction* transaction);
|
| - void VersionChangeAbortOperation(int64_t previous_version,
|
| - IndexedDBTransaction* transaction);
|
| - void DeleteIndexOperation(int64_t object_store_id,
|
| - int64_t index_id,
|
| - IndexedDBTransaction* transaction);
|
| - void CreateIndexAbortOperation(int64_t object_store_id,
|
| - int64_t index_id,
|
| - IndexedDBTransaction* transaction);
|
| + void CreateIndexAbortOperation(int64_t object_store_id, int64_t index_id);
|
| void DeleteIndexAbortOperation(int64_t object_store_id,
|
| - const IndexedDBIndexMetadata& index_metadata,
|
| - IndexedDBTransaction* transaction);
|
| + const IndexedDBIndexMetadata& index_metadata);
|
| void RenameIndexAbortOperation(int64_t object_store_id,
|
| int64_t index_id,
|
| - const base::string16& old_name,
|
| - IndexedDBTransaction* transaction);
|
| - void GetOperation(int64_t object_store_id,
|
| - int64_t index_id,
|
| - std::unique_ptr<IndexedDBKeyRange> key_range,
|
| - indexed_db::CursorType cursor_type,
|
| - scoped_refptr<IndexedDBCallbacks> callbacks,
|
| - IndexedDBTransaction* transaction);
|
| - void GetAllOperation(int64_t object_store_id,
|
| - int64_t index_id,
|
| - std::unique_ptr<IndexedDBKeyRange> key_range,
|
| - indexed_db::CursorType cursor_type,
|
| - int64_t max_count,
|
| - scoped_refptr<IndexedDBCallbacks> callbacks,
|
| - IndexedDBTransaction* transaction);
|
| + const base::string16& old_name);
|
| + OperationResult GetOperation(int64_t object_store_id,
|
| + int64_t index_id,
|
| + std::unique_ptr<IndexedDBKeyRange> key_range,
|
| + indexed_db::CursorType cursor_type,
|
| + scoped_refptr<IndexedDBCallbacks> callbacks,
|
| + IndexedDBTransaction* transaction);
|
| + OperationResult GetAllOperation(int64_t object_store_id,
|
| + int64_t index_id,
|
| + std::unique_ptr<IndexedDBKeyRange> key_range,
|
| + indexed_db::CursorType cursor_type,
|
| + int64_t max_count,
|
| + scoped_refptr<IndexedDBCallbacks> callbacks,
|
| + IndexedDBTransaction* transaction);
|
| struct PutOperationParams;
|
| - void PutOperation(std::unique_ptr<PutOperationParams> params,
|
| - IndexedDBTransaction* transaction);
|
| - void SetIndexesReadyOperation(size_t index_count,
|
| - IndexedDBTransaction* transaction);
|
| + OperationResult PutOperation(std::unique_ptr<PutOperationParams> params,
|
| + IndexedDBTransaction* transaction);
|
| + OperationResult SetIndexesReadyOperation(size_t index_count,
|
| + IndexedDBTransaction* transaction);
|
| struct OpenCursorOperationParams;
|
| - void OpenCursorOperation(std::unique_ptr<OpenCursorOperationParams> params,
|
| - IndexedDBTransaction* transaction);
|
| - void CountOperation(int64_t object_store_id,
|
| - int64_t index_id,
|
| - std::unique_ptr<IndexedDBKeyRange> key_range,
|
| - scoped_refptr<IndexedDBCallbacks> callbacks,
|
| - IndexedDBTransaction* transaction);
|
| - void DeleteRangeOperation(int64_t object_store_id,
|
| - std::unique_ptr<IndexedDBKeyRange> key_range,
|
| - scoped_refptr<IndexedDBCallbacks> callbacks,
|
| - IndexedDBTransaction* transaction);
|
| - void ClearOperation(int64_t object_store_id,
|
| - scoped_refptr<IndexedDBCallbacks> callbacks,
|
| - IndexedDBTransaction* transaction);
|
| + OperationResult OpenCursorOperation(
|
| + std::unique_ptr<OpenCursorOperationParams> params,
|
| + IndexedDBTransaction* transaction);
|
| + OperationResult CountOperation(int64_t object_store_id,
|
| + int64_t index_id,
|
| + std::unique_ptr<IndexedDBKeyRange> key_range,
|
| + scoped_refptr<IndexedDBCallbacks> callbacks,
|
| + IndexedDBTransaction* transaction);
|
| + OperationResult DeleteRangeOperation(
|
| + int64_t object_store_id,
|
| + std::unique_ptr<IndexedDBKeyRange> key_range,
|
| + scoped_refptr<IndexedDBCallbacks> callbacks,
|
| + IndexedDBTransaction* transaction);
|
| + OperationResult ClearOperation(int64_t object_store_id,
|
| + scoped_refptr<IndexedDBCallbacks> callbacks,
|
| + IndexedDBTransaction* transaction);
|
|
|
| protected:
|
| + friend class IndexedDBTransaction;
|
| +
|
| IndexedDBDatabase(const base::string16& name,
|
| IndexedDBBackingStore* backing_store,
|
| IndexedDBFactory* factory,
|
| @@ -284,6 +280,8 @@ class CONTENT_EXPORT IndexedDBDatabase
|
| // May be overridden in tests.
|
| virtual size_t GetMaxMessageSizeInBytes() const;
|
|
|
| + IndexedDBFactory* factory() const { return factory_.get(); }
|
| +
|
| private:
|
| friend class base::RefCounted<IndexedDBDatabase>;
|
| friend class IndexedDBClassFactory;
|
|
|