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

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

Issue 17033004: Tell IDB frontend about data loss (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ToT Created 7 years, 6 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/child/indexed_db/indexed_db_dispatcher.h" 5 #include "content/child/indexed_db/indexed_db_dispatcher.h"
6 6
7 #include "base/format_macros.h" 7 #include "base/format_macros.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/threading/thread_local.h" 10 #include "base/threading/thread_local.h"
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 void IndexedDBDispatcher::OnUpgradeNeeded( 630 void IndexedDBDispatcher::OnUpgradeNeeded(
631 const IndexedDBMsg_CallbacksUpgradeNeeded_Params& p) { 631 const IndexedDBMsg_CallbacksUpgradeNeeded_Params& p) {
632 DCHECK_EQ(p.ipc_thread_id, CurrentWorkerId()); 632 DCHECK_EQ(p.ipc_thread_id, CurrentWorkerId());
633 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(p.ipc_callbacks_id); 633 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(p.ipc_callbacks_id);
634 DCHECK(callbacks); 634 DCHECK(callbacks);
635 WebIDBMetadata metadata(ConvertMetadata(p.idb_metadata)); 635 WebIDBMetadata metadata(ConvertMetadata(p.idb_metadata));
636 DCHECK(!databases_.count(p.ipc_database_id)); 636 DCHECK(!databases_.count(p.ipc_database_id));
637 databases_[p.ipc_database_id] = new RendererWebIDBDatabaseImpl( 637 databases_[p.ipc_database_id] = new RendererWebIDBDatabaseImpl(
638 p.ipc_database_id, p.ipc_database_callbacks_id); 638 p.ipc_database_id, p.ipc_database_callbacks_id);
639 callbacks->onUpgradeNeeded( 639 callbacks->onUpgradeNeeded(
640 p.old_version, databases_[p.ipc_database_id], metadata); 640 p.old_version,
641 databases_[p.ipc_database_id],
642 metadata,
643 static_cast<WebIDBCallbacks::DataLoss>(p.data_loss));
641 } 644 }
642 645
643 void IndexedDBDispatcher::OnError(int32 ipc_thread_id, 646 void IndexedDBDispatcher::OnError(int32 ipc_thread_id,
644 int32 ipc_callbacks_id, 647 int32 ipc_callbacks_id,
645 int code, 648 int code,
646 const string16& message) { 649 const string16& message) {
647 DCHECK_EQ(ipc_thread_id, CurrentWorkerId()); 650 DCHECK_EQ(ipc_thread_id, CurrentWorkerId());
648 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(ipc_callbacks_id); 651 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(ipc_callbacks_id);
649 if (!callbacks) 652 if (!callbacks)
650 return; 653 return;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 int32 ipc_exception_cursor_id) { 707 int32 ipc_exception_cursor_id) {
705 typedef std::map<int32, RendererWebIDBCursorImpl*>::iterator Iterator; 708 typedef std::map<int32, RendererWebIDBCursorImpl*>::iterator Iterator;
706 for (Iterator i = cursors_.begin(); i != cursors_.end(); ++i) { 709 for (Iterator i = cursors_.begin(); i != cursors_.end(); ++i) {
707 if (i->first == ipc_exception_cursor_id) 710 if (i->first == ipc_exception_cursor_id)
708 continue; 711 continue;
709 i->second->ResetPrefetchCache(); 712 i->second->ResetPrefetchCache();
710 } 713 }
711 } 714 }
712 715
713 } // namespace content 716 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/indexed_db/indexed_db_factory.cc ('k') | content/common/indexed_db/indexed_db_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698