OLD | NEW |
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_CURSOR_H_ | 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CURSOR_H_ |
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CURSOR_H_ | 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CURSOR_H_ |
7 | 7 |
8 #include <vector> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "content/browser/indexed_db/indexed_db_backing_store.h" | 13 #include "content/browser/indexed_db/indexed_db_backing_store.h" |
14 #include "content/browser/indexed_db/indexed_db_database.h" | 14 #include "content/browser/indexed_db/indexed_db_database.h" |
15 #include "content/common/indexed_db/indexed_db_key_range.h" | 15 #include "content/common/indexed_db/indexed_db_key_range.h" |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 | 18 |
(...skipping 24 matching lines...) Expand all Loading... |
43 // IndexedDBCursor | 43 // IndexedDBCursor |
44 void Advance(uint32 count, scoped_refptr<IndexedDBCallbacks> callbacks); | 44 void Advance(uint32 count, scoped_refptr<IndexedDBCallbacks> callbacks); |
45 void ContinueFunction(scoped_ptr<IndexedDBKey> key, | 45 void ContinueFunction(scoped_ptr<IndexedDBKey> key, |
46 scoped_refptr<IndexedDBCallbacks> callbacks); | 46 scoped_refptr<IndexedDBCallbacks> callbacks); |
47 void PrefetchContinue(int number_to_fetch, | 47 void PrefetchContinue(int number_to_fetch, |
48 scoped_refptr<IndexedDBCallbacks> callbacks); | 48 scoped_refptr<IndexedDBCallbacks> callbacks); |
49 void PrefetchReset(int used_prefetches, int unused_prefetches); | 49 void PrefetchReset(int used_prefetches, int unused_prefetches); |
50 | 50 |
51 const IndexedDBKey& key() const { return cursor_->key(); } | 51 const IndexedDBKey& key() const { return cursor_->key(); } |
52 const IndexedDBKey& primary_key() const { return cursor_->primary_key(); } | 52 const IndexedDBKey& primary_key() const { return cursor_->primary_key(); } |
53 std::vector<char>* Value() const { | 53 std::string* Value() const { |
54 return (cursor_type_ == indexed_db::CURSOR_KEY_ONLY) ? NULL | 54 return (cursor_type_ == indexed_db::CURSOR_KEY_ONLY) ? NULL |
55 : cursor_->Value(); | 55 : cursor_->Value(); |
56 } | 56 } |
57 void Close(); | 57 void Close(); |
58 | 58 |
59 private: | 59 private: |
60 friend class base::RefCounted<IndexedDBCursor>; | 60 friend class base::RefCounted<IndexedDBCursor>; |
61 | 61 |
62 IndexedDBCursor(scoped_ptr<IndexedDBBackingStore::Cursor> cursor, | 62 IndexedDBCursor(scoped_ptr<IndexedDBBackingStore::Cursor> cursor, |
63 indexed_db::CursorType cursor_type, | 63 indexed_db::CursorType cursor_type, |
(...skipping 13 matching lines...) Expand all Loading... |
77 scoped_ptr<IndexedDBBackingStore::Cursor> cursor_; | 77 scoped_ptr<IndexedDBBackingStore::Cursor> cursor_; |
78 // Must be destroyed before transaction_. | 78 // Must be destroyed before transaction_. |
79 scoped_ptr<IndexedDBBackingStore::Cursor> saved_cursor_; | 79 scoped_ptr<IndexedDBBackingStore::Cursor> saved_cursor_; |
80 | 80 |
81 bool closed_; | 81 bool closed_; |
82 }; | 82 }; |
83 | 83 |
84 } // namespace content | 84 } // namespace content |
85 | 85 |
86 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CURSOR_H_ | 86 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CURSOR_H_ |
OLD | NEW |