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

Unified Diff: content/renderer/renderer_webidbcursor_impl.h

Issue 8662017: IndexedDB: Cursor pre-fetching. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix indentation Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/indexed_db_dispatcher.cc ('k') | content/renderer/renderer_webidbcursor_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/renderer_webidbcursor_impl.h
diff --git a/content/renderer/renderer_webidbcursor_impl.h b/content/renderer/renderer_webidbcursor_impl.h
index fbca6b293efc5963d0085a7121d1e40268a9b716..b03399087df6af41e208ff4170aa620f4531852b 100644
--- a/content/renderer/renderer_webidbcursor_impl.h
+++ b/content/renderer/renderer_webidbcursor_impl.h
@@ -5,6 +5,8 @@
#ifndef CONTENT_RENDERER_RENDERER_WEBIDBCURSOR_IMPL_H_
#define CONTENT_RENDERER_RENDERER_WEBIDBCURSOR_IMPL_H_
+#include <deque>
+
#include "base/basictypes.h"
#include "content/common/indexed_db_key.h"
#include "content/public/common/serialized_script_value.h"
@@ -30,15 +32,44 @@ class RendererWebIDBCursorImpl : public WebKit::WebIDBCursor {
WebKit::WebExceptionCode& ec);
virtual void deleteFunction(WebKit::WebIDBCallbacks* callback,
WebKit::WebExceptionCode& ec);
+ virtual void postSuccessHandlerCallback();
void SetKeyAndValue(const IndexedDBKey& key, const IndexedDBKey& primary_key,
const content::SerializedScriptValue& value);
+ void SetPrefetchData(
+ const std::vector<IndexedDBKey>& keys,
+ const std::vector<IndexedDBKey>& primary_keys,
+ const std::vector<content::SerializedScriptValue>& values);
+
+ void CachedContinue(WebKit::WebIDBCallbacks* callbacks);
+ void ResetPrefetchCache();
private:
int32 idb_cursor_id_;
IndexedDBKey key_;
IndexedDBKey primary_key_;
content::SerializedScriptValue value_;
+
+ // Prefetch cache.
+ std::deque<IndexedDBKey> prefetch_keys_;
+ std::deque<IndexedDBKey> prefetch_primary_keys_;
+ std::deque<content::SerializedScriptValue> prefetch_values_;
+
+ // Number of continue calls that would qualify for a pre-fetch.
+ int continue_count_;
+
+ // Number of items used from the last prefetch.
+ int used_prefetches_;
+
+ // Number of onsuccess handlers we are waiting for.
+ int pending_onsuccess_callbacks_;
+
+ // Number of items to request in next prefetch.
+ int prefetch_amount_;
+
+ enum { kPrefetchContinueThreshold = 2 };
+ enum { kMinPrefetchAmount = 5 };
+ enum { kMaxPrefetchAmount = 100 };
};
#endif // CONTENT_RENDERER_RENDERER_WEBIDBCURSOR_IMPL_H_
« no previous file with comments | « content/renderer/indexed_db_dispatcher.cc ('k') | content/renderer/renderer_webidbcursor_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698