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/common/indexed_db/proxy_webidbdatabase_impl.h" | 5 #include "content/common/indexed_db/proxy_webidbdatabase_impl.h" |
6 | 6 |
7 #include "content/common/child_thread.h" | 7 #include "content/common/child_thread.h" |
8 #include "content/common/indexed_db/indexed_db_messages.h" | 8 #include "content/common/indexed_db/indexed_db_messages.h" |
9 #include "content/common/indexed_db/indexed_db_dispatcher.h" | 9 #include "content/common/indexed_db/indexed_db_dispatcher.h" |
10 #include "content/common/indexed_db/proxy_webidbobjectstore_impl.h" | 10 #include "content/common/indexed_db/proxy_webidbobjectstore_impl.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 : idb_database_id_(idb_database_id) { | 31 : idb_database_id_(idb_database_id) { |
32 } | 32 } |
33 | 33 |
34 RendererWebIDBDatabaseImpl::~RendererWebIDBDatabaseImpl() { | 34 RendererWebIDBDatabaseImpl::~RendererWebIDBDatabaseImpl() { |
35 // It's not possible for there to be pending callbacks that address this | 35 // It's not possible for there to be pending callbacks that address this |
36 // object since inside WebKit, they hold a reference to the object which owns | 36 // object since inside WebKit, they hold a reference to the object which owns |
37 // this object. But, if that ever changed, then we'd need to invalidate | 37 // this object. But, if that ever changed, then we'd need to invalidate |
38 // any such pointers. | 38 // any such pointers. |
39 IndexedDBDispatcher::Send(new IndexedDBHostMsg_DatabaseDestroyed( | 39 IndexedDBDispatcher::Send(new IndexedDBHostMsg_DatabaseDestroyed( |
40 idb_database_id_)); | 40 idb_database_id_)); |
| 41 IndexedDBDispatcher* dispatcher = |
| 42 IndexedDBDispatcher::ThreadSpecificInstance(); |
| 43 dispatcher->DatabaseDestroyed(idb_database_id_); |
41 } | 44 } |
42 | 45 |
43 WebIDBMetadata RendererWebIDBDatabaseImpl::metadata() const { | 46 WebIDBMetadata RendererWebIDBDatabaseImpl::metadata() const { |
44 IndexedDBDatabaseMetadata idb_metadata; | 47 IndexedDBDatabaseMetadata idb_metadata; |
45 IndexedDBDispatcher::Send( | 48 IndexedDBDispatcher::Send( |
46 new IndexedDBHostMsg_DatabaseMetadata(idb_database_id_, &idb_metadata)); | 49 new IndexedDBHostMsg_DatabaseMetadata(idb_database_id_, &idb_metadata)); |
47 | 50 |
48 WebIDBMetadata web_metadata; | 51 WebIDBMetadata web_metadata; |
49 web_metadata.name = idb_metadata.name; | 52 web_metadata.name = idb_metadata.name; |
50 web_metadata.version = idb_metadata.version; | 53 web_metadata.version = idb_metadata.version; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 IndexedDBDispatcher::ThreadSpecificInstance(); | 148 IndexedDBDispatcher::ThreadSpecificInstance(); |
146 dispatcher->RequestIDBDatabaseClose(idb_database_id_); | 149 dispatcher->RequestIDBDatabaseClose(idb_database_id_); |
147 } | 150 } |
148 | 151 |
149 void RendererWebIDBDatabaseImpl::open(WebIDBDatabaseCallbacks* callbacks) { | 152 void RendererWebIDBDatabaseImpl::open(WebIDBDatabaseCallbacks* callbacks) { |
150 IndexedDBDispatcher* dispatcher = | 153 IndexedDBDispatcher* dispatcher = |
151 IndexedDBDispatcher::ThreadSpecificInstance(); | 154 IndexedDBDispatcher::ThreadSpecificInstance(); |
152 DCHECK(dispatcher); | 155 DCHECK(dispatcher); |
153 dispatcher->RequestIDBDatabaseOpen(callbacks, idb_database_id_); | 156 dispatcher->RequestIDBDatabaseOpen(callbacks, idb_database_id_); |
154 } | 157 } |
OLD | NEW |