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

Side by Side Diff: content/browser/in_process_webkit/indexed_db_dispatcher_host.cc

Issue 8400061: IndexedDB: Recycle cursor objects when calling continue(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "content/browser/in_process_webkit/indexed_db_dispatcher_host.h" 5 #include "content/browser/in_process_webkit/indexed_db_dispatcher_host.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "content/browser/browser_thread.h" 10 #include "content/browser/browser_thread.h"
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after
944 void IndexedDBDispatcherHost::CursorDispatcherHost::OnContinue( 944 void IndexedDBDispatcherHost::CursorDispatcherHost::OnContinue(
945 int32 cursor_id, 945 int32 cursor_id,
946 int32 response_id, 946 int32 response_id,
947 const IndexedDBKey& key, 947 const IndexedDBKey& key,
948 WebKit::WebExceptionCode* ec) { 948 WebKit::WebExceptionCode* ec) {
949 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); 949 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT));
950 WebIDBCursor* idb_cursor = parent_->GetOrTerminateProcess(&map_, cursor_id); 950 WebIDBCursor* idb_cursor = parent_->GetOrTerminateProcess(&map_, cursor_id);
951 if (!idb_cursor) 951 if (!idb_cursor)
952 return; 952 return;
953 953
954 parent_->pending_cursor_continues_[response_id] = cursor_id;
michaeln 2011/10/30 21:54:06 What if the continue call does not complete succes
michaeln 2011/10/31 15:08:18 Looks like there are two ways in which continue do
hans 2011/10/31 16:11:52 Right, passing the cursor_id into the callbacks ob
955
954 *ec = 0; 956 *ec = 0;
955 idb_cursor->continueFunction( 957 idb_cursor->continueFunction(
956 key, new IndexedDBCallbacks<WebIDBCursor>(parent_, response_id), *ec); 958 key, new IndexedDBCallbacks<WebIDBCursor>(parent_, response_id), *ec);
957 } 959 }
958 960
959 void IndexedDBDispatcherHost::CursorDispatcherHost::OnDelete( 961 void IndexedDBDispatcherHost::CursorDispatcherHost::OnDelete(
960 int32 cursor_id, 962 int32 cursor_id,
961 int32 response_id, 963 int32 response_id,
962 WebKit::WebExceptionCode* ec) { 964 WebKit::WebExceptionCode* ec) {
963 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); 965 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT));
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1066 } 1068 }
1067 idb_transaction->didCompleteTaskEvents(); 1069 idb_transaction->didCompleteTaskEvents();
1068 } 1070 }
1069 1071
1070 void IndexedDBDispatcherHost::TransactionDispatcherHost::OnDestroyed( 1072 void IndexedDBDispatcherHost::TransactionDispatcherHost::OnDestroyed(
1071 int32 object_id) { 1073 int32 object_id) {
1072 transaction_size_map_.erase(object_id); 1074 transaction_size_map_.erase(object_id);
1073 transaction_url_map_.erase(object_id); 1075 transaction_url_map_.erase(object_id);
1074 parent_->DestroyObject(&map_, object_id); 1076 parent_->DestroyObject(&map_, object_id);
1075 } 1077 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698