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

Side by Side Diff: content/browser/indexed_db/indexed_db_backing_store.h

Issue 1170833004: Indexed DB: Simplify cursor iteration logic (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review feedback and comments Created 5 years, 6 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_BACKING_STORE_H_ 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_BACKING_STORE_H_
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_BACKING_STORE_H_ 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_BACKING_STORE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 331
332 IndexedDBBackingStore* backing_store_; 332 IndexedDBBackingStore* backing_store_;
333 Transaction* transaction_; 333 Transaction* transaction_;
334 int64 database_id_; 334 int64 database_id_;
335 const CursorOptions cursor_options_; 335 const CursorOptions cursor_options_;
336 scoped_ptr<LevelDBIterator> iterator_; 336 scoped_ptr<LevelDBIterator> iterator_;
337 scoped_ptr<IndexedDBKey> current_key_; 337 scoped_ptr<IndexedDBKey> current_key_;
338 IndexedDBBackingStore::RecordIdentifier record_identifier_; 338 IndexedDBBackingStore::RecordIdentifier record_identifier_;
339 339
340 private: 340 private:
341 // For cursors with direction Next or NextNoDuplicate.
342 bool ContinueNext(const IndexedDBKey* key,
343 const IndexedDBKey* primary_key,
344 IteratorState state,
345 leveldb::Status*);
346 // For cursors with direction Prev or PrevNoDuplicate.
347 // The PrevNoDuplicate case has additional complexity of not
348 // being symmetric with NextNoDuplicate.
349 bool ContinuePrevious(const IndexedDBKey* key,
350 const IndexedDBKey* primary_key,
351 IteratorState state,
352 leveldb::Status*);
353
341 DISALLOW_COPY_AND_ASSIGN(Cursor); 354 DISALLOW_COPY_AND_ASSIGN(Cursor);
342 }; 355 };
343 356
344 const GURL& origin_url() const { return origin_url_; } 357 const GURL& origin_url() const { return origin_url_; }
345 IndexedDBFactory* factory() const { return indexed_db_factory_; } 358 IndexedDBFactory* factory() const { return indexed_db_factory_; }
346 base::SequencedTaskRunner* task_runner() const { return task_runner_.get(); } 359 base::SequencedTaskRunner* task_runner() const { return task_runner_.get(); }
347 base::OneShotTimer<IndexedDBBackingStore>* close_timer() { 360 base::OneShotTimer<IndexedDBBackingStore>* close_timer() {
348 return &close_timer_; 361 return &close_timer_;
349 } 362 }
350 IndexedDBActiveBlobRegistry* active_blob_registry() { 363 IndexedDBActiveBlobRegistry* active_blob_registry() {
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 // complete. While > 0, temporary journal entries may exist so out-of-band 665 // complete. While > 0, temporary journal entries may exist so out-of-band
653 // journal cleaning must be deferred. 666 // journal cleaning must be deferred.
654 size_t committing_transaction_count_; 667 size_t committing_transaction_count_;
655 668
656 DISALLOW_COPY_AND_ASSIGN(IndexedDBBackingStore); 669 DISALLOW_COPY_AND_ASSIGN(IndexedDBBackingStore);
657 }; 670 };
658 671
659 } // namespace content 672 } // namespace content
660 673
661 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_BACKING_STORE_H_ 674 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_BACKING_STORE_H_
OLDNEW
« 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