| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_LEVELDB_LEVELDB_ITERATOR_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_INDEXED_DB_LEVELDB_LEVELDB_ITERATOR_IMPL_H_ |
| 6 #define CONTENT_BROWSER_INDEXED_DB_LEVELDB_LEVELDB_ITERATOR_IMPL_H_ | 6 #define CONTENT_BROWSER_INDEXED_DB_LEVELDB_LEVELDB_ITERATOR_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "content/browser/indexed_db/leveldb/leveldb_iterator.h" | 9 #include "content/browser/indexed_db/leveldb/leveldb_iterator.h" |
| 10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| 11 #include "third_party/leveldatabase/src/include/leveldb/iterator.h" | 11 #include "third_party/leveldatabase/src/include/leveldb/iterator.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 | 14 |
| 15 class CONTENT_EXPORT LevelDBIteratorImpl : public content::LevelDBIterator { | 15 class CONTENT_EXPORT LevelDBIteratorImpl : public content::LevelDBIterator { |
| 16 public: | 16 public: |
| 17 virtual ~LevelDBIteratorImpl(); | 17 ~LevelDBIteratorImpl() override; |
| 18 virtual bool IsValid() const override; | 18 bool IsValid() const override; |
| 19 virtual leveldb::Status SeekToLast() override; | 19 leveldb::Status SeekToLast() override; |
| 20 virtual leveldb::Status Seek(const base::StringPiece& target) override; | 20 leveldb::Status Seek(const base::StringPiece& target) override; |
| 21 virtual leveldb::Status Next() override; | 21 leveldb::Status Next() override; |
| 22 virtual leveldb::Status Prev() override; | 22 leveldb::Status Prev() override; |
| 23 virtual base::StringPiece Key() const override; | 23 base::StringPiece Key() const override; |
| 24 virtual base::StringPiece Value() const override; | 24 base::StringPiece Value() const override; |
| 25 | 25 |
| 26 protected: | 26 protected: |
| 27 explicit LevelDBIteratorImpl(scoped_ptr<leveldb::Iterator> iterator); | 27 explicit LevelDBIteratorImpl(scoped_ptr<leveldb::Iterator> iterator); |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 void CheckStatus(); | 30 void CheckStatus(); |
| 31 | 31 |
| 32 friend class IndexedDBClassFactory; | 32 friend class IndexedDBClassFactory; |
| 33 friend class MockBrowserTestIndexedDBClassFactory; | 33 friend class MockBrowserTestIndexedDBClassFactory; |
| 34 | 34 |
| 35 scoped_ptr<leveldb::Iterator> iterator_; | 35 scoped_ptr<leveldb::Iterator> iterator_; |
| 36 | 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(LevelDBIteratorImpl); | 37 DISALLOW_COPY_AND_ASSIGN(LevelDBIteratorImpl); |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 } // namespace content | 40 } // namespace content |
| 41 | 41 |
| 42 #endif // CONTENT_BROWSER_INDEXED_DB_LEVELDB_LEVELDB_ITERATOR_IMPL_H_ | 42 #endif // CONTENT_BROWSER_INDEXED_DB_LEVELDB_LEVELDB_ITERATOR_IMPL_H_ |
| OLD | NEW |