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

Side by Side Diff: content/renderer/indexed_db/indexed_db_dispatcher.cc

Issue 9389025: IndexedDB: Implement IPC plumbing for IDBObjectStore.delete(IDBKeyRange) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/renderer/indexed_db/indexed_db_dispatcher.h" 5 #include "content/renderer/indexed_db/indexed_db_dispatcher.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/threading/thread_local.h" 8 #include "base/threading/thread_local.h"
9 #include "content/common/indexed_db/indexed_db_messages.h" 9 #include "content/common/indexed_db/indexed_db_messages.h"
10 #include "content/renderer/indexed_db/renderer_webidbcursor_impl.h" 10 #include "content/renderer/indexed_db/renderer_webidbcursor_impl.h"
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr); 423 scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr);
424 424
425 int32 response_id = pending_callbacks_.Add(callbacks.release()); 425 int32 response_id = pending_callbacks_.Add(callbacks.release());
426 Send(new IndexedDBHostMsg_ObjectStoreDelete( 426 Send(new IndexedDBHostMsg_ObjectStoreDelete(
427 idb_object_store_id, CurrentWorkerId(), response_id, key, 427 idb_object_store_id, CurrentWorkerId(), response_id, key,
428 TransactionId(transaction), ec)); 428 TransactionId(transaction), ec));
429 if (*ec) 429 if (*ec)
430 pending_callbacks_.Remove(response_id); 430 pending_callbacks_.Remove(response_id);
431 } 431 }
432 432
433 void IndexedDBDispatcher::RequestIDBObjectStoreDelete(
434 const IndexedDBKeyRange& key_range,
435 WebIDBCallbacks* callbacks_ptr,
436 int32 idb_object_store_id,
437 const WebIDBTransaction& transaction,
438 WebExceptionCode* ec) {
439 ResetCursorPrefetchCaches();
440 scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr);
441
442 int32 response_id = pending_callbacks_.Add(callbacks.release());
443 Send(new IndexedDBHostMsg_ObjectStoreDeleteRange(
444 idb_object_store_id, CurrentWorkerId(), response_id, key_range,
445 TransactionId(transaction), ec));
446 if (*ec)
447 pending_callbacks_.Remove(response_id);
448 }
449
433 void IndexedDBDispatcher::RequestIDBObjectStoreClear( 450 void IndexedDBDispatcher::RequestIDBObjectStoreClear(
434 WebIDBCallbacks* callbacks_ptr, 451 WebIDBCallbacks* callbacks_ptr,
435 int32 idb_object_store_id, 452 int32 idb_object_store_id,
436 const WebIDBTransaction& transaction, 453 const WebIDBTransaction& transaction,
437 WebExceptionCode* ec) { 454 WebExceptionCode* ec) {
438 ResetCursorPrefetchCaches(); 455 ResetCursorPrefetchCaches();
439 scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr); 456 scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr);
440 457
441 int32 response_id = pending_callbacks_.Add(callbacks.release()); 458 int32 response_id = pending_callbacks_.Add(callbacks.release());
442 Send(new IndexedDBHostMsg_ObjectStoreClear( 459 Send(new IndexedDBHostMsg_ObjectStoreClear(
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 } 696 }
680 697
681 void IndexedDBDispatcher::ResetCursorPrefetchCaches(int32 exception_cursor_id) { 698 void IndexedDBDispatcher::ResetCursorPrefetchCaches(int32 exception_cursor_id) {
682 typedef std::map<int32, RendererWebIDBCursorImpl*>::iterator Iterator; 699 typedef std::map<int32, RendererWebIDBCursorImpl*>::iterator Iterator;
683 for (Iterator i = cursors_.begin(); i != cursors_.end(); ++i) { 700 for (Iterator i = cursors_.begin(); i != cursors_.end(); ++i) {
684 if (i->first == exception_cursor_id) 701 if (i->first == exception_cursor_id)
685 continue; 702 continue;
686 i->second->ResetPrefetchCache(); 703 i->second->ResetPrefetchCache();
687 } 704 }
688 } 705 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698