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

Unified Diff: content/browser/in_process_webkit/indexed_db_callbacks.h

Issue 8400061: IndexedDB: Recycle cursor objects when calling continue(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: New version Created 9 years, 2 months 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
Index: content/browser/in_process_webkit/indexed_db_callbacks.h
diff --git a/content/browser/in_process_webkit/indexed_db_callbacks.h b/content/browser/in_process_webkit/indexed_db_callbacks.h
index a5ef7deff3f81cef83559065f8b75d310bfcea8f..6bfbe76a47abdd6366c834f89ce733160c701d60 100644
--- a/content/browser/in_process_webkit/indexed_db_callbacks.h
+++ b/content/browser/in_process_webkit/indexed_db_callbacks.h
@@ -76,7 +76,8 @@ class IndexedDBCallbacks : public IndexedDBCallbacksBase {
DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks);
};
-// WebIDBCursor uses onSuccess(WebIDBCursor*) to indicate it has data, and
+// WebIDBCursor uses onSuccess(WebIDBCursor*) when a cursor has been opened,
+// onSuccessCursorContinue() when a continue() call has succeeded, or
// onSuccess() without params to indicate it does not contain any data, i.e.,
// there is no key within the key range, or it has reached the end.
template <>
@@ -84,13 +85,20 @@ class IndexedDBCallbacks<WebKit::WebIDBCursor>
: public IndexedDBCallbacksBase {
public:
IndexedDBCallbacks(
- IndexedDBDispatcherHost* dispatcher_host, int32 response_id)
- : IndexedDBCallbacksBase(dispatcher_host, response_id) { }
+ IndexedDBDispatcherHost* dispatcher_host, int32 response_id,
+ int32 cursor_id)
+ : IndexedDBCallbacksBase(dispatcher_host, response_id)
+ , cursor_id_(cursor_id) { }
michaeln 2011/11/01 18:38:37 chrome-style initializers don't put the ',' up fro
hans 2011/11/02 17:16:58 Done.
virtual void onSuccess(WebKit::WebIDBCursor* idb_object);
virtual void onSuccess(const WebKit::WebSerializedScriptValue& value);
+ virtual void onSuccessCursorContinue();
private:
+ // The id of the cursor this callback concerns, or -1 if the cursor
+ // does not exist yet.
+ int32 cursor_id_;
+
DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBCallbacks);
};

Powered by Google App Engine
This is Rietveld 408576698