| 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_PROXY_WEBIDBCURSOR_IMPL_H_ | 5 #ifndef CONTENT_CHILD_INDEXED_DB_PROXY_WEBIDBCURSOR_IMPL_H_ |
| 6 #define CONTENT_CHILD_INDEXED_DB_PROXY_WEBIDBCURSOR_IMPL_H_ | 6 #define CONTENT_CHILD_INDEXED_DB_PROXY_WEBIDBCURSOR_IMPL_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 const std::vector<IndexedDBKey>& primary_keys, | 40 const std::vector<IndexedDBKey>& primary_keys, |
| 41 const std::vector<blink::WebData>& values); | 41 const std::vector<blink::WebData>& values); |
| 42 | 42 |
| 43 void CachedAdvance(unsigned long count, blink::WebIDBCallbacks* callbacks); | 43 void CachedAdvance(unsigned long count, blink::WebIDBCallbacks* callbacks); |
| 44 void CachedContinue(blink::WebIDBCallbacks* callbacks); | 44 void CachedContinue(blink::WebIDBCallbacks* callbacks); |
| 45 void ResetPrefetchCache(); | 45 void ResetPrefetchCache(); |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 FRIEND_TEST_ALL_PREFIXES(WebIDBCursorImplTest, PrefetchTest); | 48 FRIEND_TEST_ALL_PREFIXES(WebIDBCursorImplTest, PrefetchTest); |
| 49 FRIEND_TEST_ALL_PREFIXES(WebIDBCursorImplTest, AdvancePrefetchTest); | 49 FRIEND_TEST_ALL_PREFIXES(WebIDBCursorImplTest, AdvancePrefetchTest); |
| 50 FRIEND_TEST_ALL_PREFIXES(WebIDBCursorImplTest, PrefetchReset); |
| 50 | 51 |
| 51 int32 ipc_cursor_id_; | 52 int32 ipc_cursor_id_; |
| 52 | 53 |
| 53 // Prefetch cache. | 54 // Prefetch cache. |
| 54 std::deque<IndexedDBKey> prefetch_keys_; | 55 std::deque<IndexedDBKey> prefetch_keys_; |
| 55 std::deque<IndexedDBKey> prefetch_primary_keys_; | 56 std::deque<IndexedDBKey> prefetch_primary_keys_; |
| 56 std::deque<blink::WebData> prefetch_values_; | 57 std::deque<blink::WebData> prefetch_values_; |
| 57 | 58 |
| 58 // Number of continue calls that would qualify for a pre-fetch. | 59 // Number of continue calls that would qualify for a pre-fetch. |
| 59 int continue_count_; | 60 int continue_count_; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 71 | 72 |
| 72 enum { kInvalidCursorId = -1 }; | 73 enum { kInvalidCursorId = -1 }; |
| 73 enum { kPrefetchContinueThreshold = 2 }; | 74 enum { kPrefetchContinueThreshold = 2 }; |
| 74 enum { kMinPrefetchAmount = 5 }; | 75 enum { kMinPrefetchAmount = 5 }; |
| 75 enum { kMaxPrefetchAmount = 100 }; | 76 enum { kMaxPrefetchAmount = 100 }; |
| 76 }; | 77 }; |
| 77 | 78 |
| 78 } // namespace content | 79 } // namespace content |
| 79 | 80 |
| 80 #endif // CONTENT_CHILD_INDEXED_DB_PROXY_WEBIDBCURSOR_IMPL_H_ | 81 #endif // CONTENT_CHILD_INDEXED_DB_PROXY_WEBIDBCURSOR_IMPL_H_ |
| OLD | NEW |