| OLD | NEW |
| 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/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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_FactoryOpen, OnIDBFactoryOpen) | 128 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_FactoryOpen, OnIDBFactoryOpen) |
| 129 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_FactoryDeleteDatabase, | 129 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_FactoryDeleteDatabase, |
| 130 OnIDBFactoryDeleteDatabase) | 130 OnIDBFactoryDeleteDatabase) |
| 131 IPC_MESSAGE_UNHANDLED(handled = false) | 131 IPC_MESSAGE_UNHANDLED(handled = false) |
| 132 IPC_END_MESSAGE_MAP() | 132 IPC_END_MESSAGE_MAP() |
| 133 } | 133 } |
| 134 return handled; | 134 return handled; |
| 135 } | 135 } |
| 136 | 136 |
| 137 int32 IndexedDBDispatcherHost::Add(WebIDBCursor* idb_cursor) { | 137 int32 IndexedDBDispatcherHost::Add(WebIDBCursor* idb_cursor) { |
| 138 if (!cursor_dispatcher_host_.get()) { | 138 if (!cursor_dispatcher_host_) { |
| 139 delete idb_cursor; | 139 delete idb_cursor; |
| 140 return 0; | 140 return 0; |
| 141 } | 141 } |
| 142 return cursor_dispatcher_host_->map_.Add(idb_cursor); | 142 return cursor_dispatcher_host_->map_.Add(idb_cursor); |
| 143 } | 143 } |
| 144 | 144 |
| 145 int32 IndexedDBDispatcherHost::Add(WebIDBDatabase* idb_database, | 145 int32 IndexedDBDispatcherHost::Add(WebIDBDatabase* idb_database, |
| 146 int32 ipc_thread_id, | 146 int32 ipc_thread_id, |
| 147 const GURL& origin_url) { | 147 const GURL& origin_url) { |
| 148 if (!database_dispatcher_host_.get()) { | 148 if (!database_dispatcher_host_) { |
| 149 delete idb_database; | 149 delete idb_database; |
| 150 return 0; | 150 return 0; |
| 151 } | 151 } |
| 152 int32 ipc_database_id = database_dispatcher_host_->map_.Add(idb_database); | 152 int32 ipc_database_id = database_dispatcher_host_->map_.Add(idb_database); |
| 153 Context()->ConnectionOpened(origin_url, idb_database); | 153 Context()->ConnectionOpened(origin_url, idb_database); |
| 154 database_dispatcher_host_->database_url_map_[ipc_database_id] = origin_url; | 154 database_dispatcher_host_->database_url_map_[ipc_database_id] = origin_url; |
| 155 return ipc_database_id; | 155 return ipc_database_id; |
| 156 } | 156 } |
| 157 | 157 |
| 158 void IndexedDBDispatcherHost::RegisterTransactionId( | 158 void IndexedDBDispatcherHost::RegisterTransactionId( |
| (...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 ipc_callbacks_id), ec); | 845 ipc_callbacks_id), ec); |
| 846 DCHECK(!ec); | 846 DCHECK(!ec); |
| 847 } | 847 } |
| 848 | 848 |
| 849 void IndexedDBDispatcherHost::CursorDispatcherHost::OnDestroyed( | 849 void IndexedDBDispatcherHost::CursorDispatcherHost::OnDestroyed( |
| 850 int32 ipc_object_id) { | 850 int32 ipc_object_id) { |
| 851 parent_->DestroyObject(&map_, ipc_object_id); | 851 parent_->DestroyObject(&map_, ipc_object_id); |
| 852 } | 852 } |
| 853 | 853 |
| 854 } // namespace content | 854 } // namespace content |
| OLD | NEW |