| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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_CHILD_INDEXED_DB_WEBIDBCURSOR_IMPL_H_ | 5 #ifndef CONTENT_CHILD_INDEXED_DB_WEBIDBCURSOR_IMPL_H_ |
| 6 #define CONTENT_CHILD_INDEXED_DB_WEBIDBCURSOR_IMPL_H_ | 6 #define CONTENT_CHILD_INDEXED_DB_WEBIDBCURSOR_IMPL_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 int64 transaction_id() const { return transaction_id_; } | 53 int64 transaction_id() const { return transaction_id_; } |
| 54 | 54 |
| 55 private: | 55 private: |
| 56 FRIEND_TEST_ALL_PREFIXES(IndexedDBDispatcherTest, CursorReset); | 56 FRIEND_TEST_ALL_PREFIXES(IndexedDBDispatcherTest, CursorReset); |
| 57 FRIEND_TEST_ALL_PREFIXES(IndexedDBDispatcherTest, CursorTransactionId); | 57 FRIEND_TEST_ALL_PREFIXES(IndexedDBDispatcherTest, CursorTransactionId); |
| 58 FRIEND_TEST_ALL_PREFIXES(WebIDBCursorImplTest, AdvancePrefetchTest); | 58 FRIEND_TEST_ALL_PREFIXES(WebIDBCursorImplTest, AdvancePrefetchTest); |
| 59 FRIEND_TEST_ALL_PREFIXES(WebIDBCursorImplTest, PrefetchReset); | 59 FRIEND_TEST_ALL_PREFIXES(WebIDBCursorImplTest, PrefetchReset); |
| 60 FRIEND_TEST_ALL_PREFIXES(WebIDBCursorImplTest, PrefetchTest); | 60 FRIEND_TEST_ALL_PREFIXES(WebIDBCursorImplTest, PrefetchTest); |
| 61 | 61 |
| 62 enum { kInvalidCursorId = -1 }; |
| 63 enum { kPrefetchContinueThreshold = 2 }; |
| 64 enum { kMinPrefetchAmount = 5 }; |
| 65 enum { kMaxPrefetchAmount = 100 }; |
| 66 |
| 62 int32 ipc_cursor_id_; | 67 int32 ipc_cursor_id_; |
| 63 int64 transaction_id_; | 68 int64 transaction_id_; |
| 64 | 69 |
| 65 // Prefetch cache. | 70 // Prefetch cache. |
| 66 std::deque<IndexedDBKey> prefetch_keys_; | 71 std::deque<IndexedDBKey> prefetch_keys_; |
| 67 std::deque<IndexedDBKey> prefetch_primary_keys_; | 72 std::deque<IndexedDBKey> prefetch_primary_keys_; |
| 68 std::deque<blink::WebData> prefetch_values_; | 73 std::deque<blink::WebData> prefetch_values_; |
| 69 std::deque<blink::WebVector<blink::WebBlobInfo> > prefetch_blob_info_; | 74 std::deque<blink::WebVector<blink::WebBlobInfo> > prefetch_blob_info_; |
| 70 | 75 |
| 71 // Number of continue calls that would qualify for a pre-fetch. | 76 // Number of continue calls that would qualify for a pre-fetch. |
| 72 int continue_count_; | 77 int continue_count_; |
| 73 | 78 |
| 74 // Number of items used from the last prefetch. | 79 // Number of items used from the last prefetch. |
| 75 int used_prefetches_; | 80 int used_prefetches_; |
| 76 | 81 |
| 77 // Number of onsuccess handlers we are waiting for. | 82 // Number of onsuccess handlers we are waiting for. |
| 78 int pending_onsuccess_callbacks_; | 83 int pending_onsuccess_callbacks_; |
| 79 | 84 |
| 80 // Number of items to request in next prefetch. | 85 // Number of items to request in next prefetch. |
| 81 int prefetch_amount_; | 86 int prefetch_amount_; |
| 82 | 87 |
| 83 scoped_refptr<ThreadSafeSender> thread_safe_sender_; | 88 scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
| 84 | |
| 85 enum { kInvalidCursorId = -1 }; | |
| 86 enum { kPrefetchContinueThreshold = 2 }; | |
| 87 enum { kMinPrefetchAmount = 5 }; | |
| 88 enum { kMaxPrefetchAmount = 100 }; | |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 } // namespace content | 91 } // namespace content |
| 92 | 92 |
| 93 #endif // CONTENT_CHILD_INDEXED_DB_WEBIDBCURSOR_IMPL_H_ | 93 #endif // CONTENT_CHILD_INDEXED_DB_WEBIDBCURSOR_IMPL_H_ |
| OLD | NEW |