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 <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 static scoped_refptr<IndexedDBCursor> Create( | 35 static scoped_refptr<IndexedDBCursor> Create( |
36 scoped_ptr<IndexedDBBackingStore::Cursor> cursor, | 36 scoped_ptr<IndexedDBBackingStore::Cursor> cursor, |
37 indexed_db::CursorType cursor_type, | 37 indexed_db::CursorType cursor_type, |
38 IndexedDBDatabase::TaskType task_type, | 38 IndexedDBDatabase::TaskType task_type, |
39 IndexedDBTransaction* transaction) { | 39 IndexedDBTransaction* transaction) { |
40 return make_scoped_refptr(new IndexedDBCursor( | 40 return make_scoped_refptr(new IndexedDBCursor( |
41 cursor.Pass(), cursor_type, task_type, transaction)); | 41 cursor.Pass(), cursor_type, task_type, transaction)); |
42 } | 42 } |
43 | 43 |
44 // IndexedDBCursor | 44 // IndexedDBCursor |
45 void Advance(uint32 count, | 45 void Advance(uint32 count, scoped_refptr<IndexedDBCallbacks> callbacks); |
46 scoped_refptr<IndexedDBCallbacksWrapper> callbacks); | |
47 void ContinueFunction(scoped_ptr<IndexedDBKey> key, | 46 void ContinueFunction(scoped_ptr<IndexedDBKey> key, |
48 scoped_refptr<IndexedDBCallbacksWrapper> callbacks); | 47 scoped_refptr<IndexedDBCallbacks> callbacks); |
49 void PrefetchContinue(int number_to_fetch, | 48 void PrefetchContinue(int number_to_fetch, |
50 scoped_refptr<IndexedDBCallbacksWrapper> callbacks); | 49 scoped_refptr<IndexedDBCallbacks> callbacks); |
51 void PrefetchReset(int used_prefetches, int unused_prefetches); | 50 void PrefetchReset(int used_prefetches, int unused_prefetches); |
52 | 51 |
53 const IndexedDBKey& key() const { return cursor_->key(); } | 52 const IndexedDBKey& key() const { return cursor_->key(); } |
54 const IndexedDBKey& primary_key() const { return cursor_->primary_key(); } | 53 const IndexedDBKey& primary_key() const { return cursor_->primary_key(); } |
55 std::vector<char>* Value() const { | 54 std::vector<char>* Value() const { |
56 return (cursor_type_ == indexed_db::CURSOR_KEY_ONLY) ? NULL | 55 return (cursor_type_ == indexed_db::CURSOR_KEY_ONLY) ? NULL |
57 : cursor_->Value(); | 56 : cursor_->Value(); |
58 } | 57 } |
59 void Close(); | 58 void Close(); |
60 | 59 |
(...skipping 18 matching lines...) Expand all Loading... |
79 scoped_ptr<IndexedDBBackingStore::Cursor> cursor_; | 78 scoped_ptr<IndexedDBBackingStore::Cursor> cursor_; |
80 // Must be destroyed before transaction_. | 79 // Must be destroyed before transaction_. |
81 scoped_ptr<IndexedDBBackingStore::Cursor> saved_cursor_; | 80 scoped_ptr<IndexedDBBackingStore::Cursor> saved_cursor_; |
82 | 81 |
83 bool closed_; | 82 bool closed_; |
84 }; | 83 }; |
85 | 84 |
86 } // namespace content | 85 } // namespace content |
87 | 86 |
88 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CURSOR_H_ | 87 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CURSOR_H_ |
OLD | NEW |