Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: content/child/indexed_db/webidbcursor_impl.h

Issue 104663007: IndexedDB: Optimize IDBCursor.advance() if it occurs within prefetched range (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added comments about virtual usage Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 22 matching lines...) Expand all
33 blink::WebIDBCallbacks* callback); 33 blink::WebIDBCallbacks* callback);
34 virtual void continueFunction(const blink::WebIDBKey& key, 34 virtual void continueFunction(const blink::WebIDBKey& key,
35 const blink::WebIDBKey& primary_key, 35 const blink::WebIDBKey& primary_key,
36 blink::WebIDBCallbacks* callback); 36 blink::WebIDBCallbacks* callback);
37 virtual void postSuccessHandlerCallback(); 37 virtual void postSuccessHandlerCallback();
38 38
39 void SetPrefetchData(const std::vector<IndexedDBKey>& keys, 39 void SetPrefetchData(const std::vector<IndexedDBKey>& keys,
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 CachedContinue(blink::WebIDBCallbacks* callbacks); 44 void CachedContinue(blink::WebIDBCallbacks* callbacks);
44 void ResetPrefetchCache(); 45 void ResetPrefetchCache();
45 46
46 private: 47 private:
47 FRIEND_TEST_ALL_PREFIXES(WebIDBCursorImplTest, PrefetchTest); 48 FRIEND_TEST_ALL_PREFIXES(WebIDBCursorImplTest, PrefetchTest);
49 FRIEND_TEST_ALL_PREFIXES(WebIDBCursorImplTest, AdvancePrefetchTest);
48 50
49 int32 ipc_cursor_id_; 51 int32 ipc_cursor_id_;
50 52
51 // Prefetch cache. 53 // Prefetch cache.
52 std::deque<IndexedDBKey> prefetch_keys_; 54 std::deque<IndexedDBKey> prefetch_keys_;
53 std::deque<IndexedDBKey> prefetch_primary_keys_; 55 std::deque<IndexedDBKey> prefetch_primary_keys_;
54 std::deque<blink::WebData> prefetch_values_; 56 std::deque<blink::WebData> prefetch_values_;
55 57
56 // Number of continue calls that would qualify for a pre-fetch. 58 // Number of continue calls that would qualify for a pre-fetch.
57 int continue_count_; 59 int continue_count_;
(...skipping 11 matching lines...) Expand all
69 71
70 enum { kInvalidCursorId = -1 }; 72 enum { kInvalidCursorId = -1 };
71 enum { kPrefetchContinueThreshold = 2 }; 73 enum { kPrefetchContinueThreshold = 2 };
72 enum { kMinPrefetchAmount = 5 }; 74 enum { kMinPrefetchAmount = 5 };
73 enum { kMaxPrefetchAmount = 100 }; 75 enum { kMaxPrefetchAmount = 100 };
74 }; 76 };
75 77
76 } // namespace content 78 } // namespace content
77 79
78 #endif // CONTENT_CHILD_INDEXED_DB_PROXY_WEBIDBCURSOR_IMPL_H_ 80 #endif // CONTENT_CHILD_INDEXED_DB_PROXY_WEBIDBCURSOR_IMPL_H_
OLDNEW
« no previous file with comments | « content/child/indexed_db/indexed_db_dispatcher.h ('k') | content/child/indexed_db/webidbcursor_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698