Commit a93c24d9 authored by Daniel Murphy's avatar Daniel Murphy Committed by Commit Bot

[IndexedDB] Adding sequence checkers in IndexedDBBackingStore

This change adds sequence checkers to all method calls in
* IndexedDBBackingStore
* IndexedDBBackingStore::Transaction
* IndexedDBBackingStore::Transaction::ChainedBlobWriterImpl
* LocalWriteClosure
* IndexedDBBackingStore::Cursor
* ObjectStoreKeyCursorImpl
* ObjectStoreCursorImpl
* IndexKeyCursorImpl
* IndexCursorImpl

R=enne@chromium.org

Bug: 1024966
Change-Id: I3c5912a73839a03ddb53aa058c694ec45d318cf7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1935028
Commit-Queue: Daniel Murphy <dmurph@chromium.org>
Reviewed-by: default avatarenne <enne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#719336}
parent c076cddf
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/sequence_checker.h"
#include "base/strings/string_piece.h" #include "base/strings/string_piece.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "base/timer/timer.h" #include "base/timer/timer.h"
...@@ -182,7 +183,7 @@ class CONTENT_EXPORT IndexedDBBackingStore { ...@@ -182,7 +183,7 @@ class CONTENT_EXPORT IndexedDBBackingStore {
// This holds a BlobEntryKey and the encoded IndexedDBBlobInfo vector stored // This holds a BlobEntryKey and the encoded IndexedDBBlobInfo vector stored
// under that key. // under that key.
typedef std::vector<std::pair<BlobEntryKey, std::string> > typedef std::vector<std::pair<BlobEntryKey, std::string>>
BlobEntryKeyValuePairVec; BlobEntryKeyValuePairVec;
class CONTENT_EXPORT WriteDescriptor { class CONTENT_EXPORT WriteDescriptor {
...@@ -271,6 +272,8 @@ class CONTENT_EXPORT IndexedDBBackingStore { ...@@ -271,6 +272,8 @@ class CONTENT_EXPORT IndexedDBBackingStore {
void PartitionBlobsToRemove(BlobJournalType* dead_blobs, void PartitionBlobsToRemove(BlobJournalType* dead_blobs,
BlobJournalType* live_blobs) const; BlobJournalType* live_blobs) const;
SEQUENCE_CHECKER(idb_sequence_checker_);
// This does NOT mean that this class can outlive the IndexedDBBackingStore. // This does NOT mean that this class can outlive the IndexedDBBackingStore.
// This is only to protect against security issues before this class is // This is only to protect against security issues before this class is
// refactored away and this isn't necessary. // refactored away and this isn't necessary.
...@@ -362,6 +365,8 @@ class CONTENT_EXPORT IndexedDBBackingStore { ...@@ -362,6 +365,8 @@ class CONTENT_EXPORT IndexedDBBackingStore {
bool IsPastBounds() const; bool IsPastBounds() const;
bool HaveEnteredRange() const; bool HaveEnteredRange() const;
SEQUENCE_CHECKER(idb_sequence_checker_);
// This does NOT mean that this class can outlive the Transaction. // This does NOT mean that this class can outlive the Transaction.
// This is only to protect against security issues before this class is // This is only to protect against security issues before this class is
// refactored away and this isn't necessary. // refactored away and this isn't necessary.
...@@ -653,6 +658,8 @@ class CONTENT_EXPORT IndexedDBBackingStore { ...@@ -653,6 +658,8 @@ class CONTENT_EXPORT IndexedDBBackingStore {
// Can run a journal cleaning job if one is pending. // Can run a journal cleaning job if one is pending.
void DidCommitTransaction(); void DidCommitTransaction();
SEQUENCE_CHECKER(idb_sequence_checker_);
Mode backing_store_mode_; Mode backing_store_mode_;
TransactionalLevelDBFactory* const transactional_leveldb_factory_; TransactionalLevelDBFactory* const transactional_leveldb_factory_;
const url::Origin origin_; const url::Origin origin_;
......
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