OLD | NEW |
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 Loading... |
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, databases_[p.ipc_database_id], metadata, p.data_loss); |
641 } | 641 } |
642 | 642 |
643 void IndexedDBDispatcher::OnError(int32 ipc_thread_id, | 643 void IndexedDBDispatcher::OnError(int32 ipc_thread_id, |
644 int32 ipc_callbacks_id, | 644 int32 ipc_callbacks_id, |
645 int code, | 645 int code, |
646 const string16& message) { | 646 const string16& message) { |
647 DCHECK_EQ(ipc_thread_id, CurrentWorkerId()); | 647 DCHECK_EQ(ipc_thread_id, CurrentWorkerId()); |
648 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(ipc_callbacks_id); | 648 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(ipc_callbacks_id); |
649 if (!callbacks) | 649 if (!callbacks) |
650 return; | 650 return; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 int32 ipc_exception_cursor_id) { | 704 int32 ipc_exception_cursor_id) { |
705 typedef std::map<int32, RendererWebIDBCursorImpl*>::iterator Iterator; | 705 typedef std::map<int32, RendererWebIDBCursorImpl*>::iterator Iterator; |
706 for (Iterator i = cursors_.begin(); i != cursors_.end(); ++i) { | 706 for (Iterator i = cursors_.begin(); i != cursors_.end(); ++i) { |
707 if (i->first == ipc_exception_cursor_id) | 707 if (i->first == ipc_exception_cursor_id) |
708 continue; | 708 continue; |
709 i->second->ResetPrefetchCache(); | 709 i->second->ResetPrefetchCache(); |
710 } | 710 } |
711 } | 711 } |
712 | 712 |
713 } // namespace content | 713 } // namespace content |
OLD | NEW |