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

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

Issue 8400061: IndexedDB: Recycle cursor objects when calling continue(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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_dispatcher_host.h
diff --git a/content/browser/in_process_webkit/indexed_db_dispatcher_host.h b/content/browser/in_process_webkit/indexed_db_dispatcher_host.h
index 874587c24729fe195e820592c3e3258f3397e8f8..a689f49e3e834976edeeee6b370e22291d6797c0 100644
--- a/content/browser/in_process_webkit/indexed_db_dispatcher_host.h
+++ b/content/browser/in_process_webkit/indexed_db_dispatcher_host.h
@@ -65,6 +65,16 @@ class IndexedDBDispatcherHost : public BrowserMessageFilter {
int32 Add(WebKit::WebIDBTransaction* idb_transaction, const GURL& origin_url);
int32 Add(WebKit::WebDOMStringList* domStringList);
+ WebKit::WebIDBCursor* getCursorFromId(int32 cursor_id) {
+ return GetOrTerminateProcess(&cursor_dispatcher_host_->map_, cursor_id);
+ }
+
+ int32 GetAndConsumeCursorIdForPendingContinue(int32 response_id) {
+ int32 cursor_id = pending_cursor_continues_[response_id];
+ pending_cursor_continues_.erase(response_id);
+ return cursor_id;
+ }
+
private:
virtual ~IndexedDBDispatcherHost();
@@ -269,6 +279,7 @@ class IndexedDBDispatcherHost : public BrowserMessageFilter {
WebIDBTransactionIDToSizeMap transaction_size_map_;
};
+
// Data shared between renderer processes with the same browser context.
scoped_refptr<WebKitContext> webkit_context_;
@@ -282,6 +293,9 @@ class IndexedDBDispatcherHost : public BrowserMessageFilter {
// Used to dispatch messages to the correct view host.
int process_id_;
+ // Map from response id to cursor id. Access on WebKit thread only.
+ std::map<int32,int32> pending_cursor_continues_;
+
DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBDispatcherHost);
};

Powered by Google App Engine
This is Rietveld 408576698