OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/renderer/renderer_webidbdatabase_impl.h" | 5 #include "chrome/renderer/renderer_webidbdatabase_impl.h" |
6 | 6 |
7 #include "chrome/common/indexed_db_messages.h" | 7 #include "chrome/common/indexed_db_messages.h" |
8 #include "chrome/renderer/render_thread.h" | 8 #include "chrome/renderer/render_thread.h" |
9 #include "chrome/renderer/indexed_db_dispatcher.h" | 9 #include "chrome/renderer/indexed_db_dispatcher.h" |
10 #include "chrome/renderer/renderer_webidbobjectstore_impl.h" | 10 #include "chrome/renderer/renderer_webidbobjectstore_impl.h" |
11 #include "chrome/renderer/renderer_webidbtransaction_impl.h" | 11 #include "chrome/renderer/renderer_webidbtransaction_impl.h" |
12 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" | 12 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" |
13 #include "third_party/WebKit/WebKit/chromium/public/WebVector.h" | 13 #include "third_party/WebKit/WebKit/chromium/public/WebVector.h" |
14 | 14 |
15 using WebKit::WebDOMStringList; | 15 using WebKit::WebDOMStringList; |
16 using WebKit::WebExceptionCode; | 16 using WebKit::WebExceptionCode; |
17 using WebKit::WebFrame; | 17 using WebKit::WebFrame; |
18 using WebKit::WebIDBCallbacks; | 18 using WebKit::WebIDBCallbacks; |
19 using WebKit::WebIDBTransaction; | 19 using WebKit::WebIDBTransaction; |
20 using WebKit::WebString; | 20 using WebKit::WebString; |
21 using WebKit::WebVector; | 21 using WebKit::WebVector; |
22 | 22 |
23 RendererWebIDBDatabaseImpl::RendererWebIDBDatabaseImpl(int32 idb_database_id) | 23 RendererWebIDBDatabaseImpl::RendererWebIDBDatabaseImpl(int32 idb_database_id) |
24 : idb_database_id_(idb_database_id) { | 24 : idb_database_id_(idb_database_id) { |
25 } | 25 } |
26 | 26 |
27 RendererWebIDBDatabaseImpl::~RendererWebIDBDatabaseImpl() { | 27 RendererWebIDBDatabaseImpl::~RendererWebIDBDatabaseImpl() { |
28 // TODO(jorlow): Is it possible for this to be destroyed but still have | 28 // It's not possible for there to be pending callbacks that address this |
29 // pending callbacks? If so, fix! | 29 // object since inside WebKit, they hold a reference to the object wich owns |
| 30 // this object. But, if that ever changed, then we'd need to invalidate |
| 31 // any such pointers. |
30 RenderThread::current()->Send(new IndexedDBHostMsg_DatabaseDestroyed( | 32 RenderThread::current()->Send(new IndexedDBHostMsg_DatabaseDestroyed( |
31 idb_database_id_)); | 33 idb_database_id_)); |
32 } | 34 } |
33 | 35 |
34 WebString RendererWebIDBDatabaseImpl::name() const { | 36 WebString RendererWebIDBDatabaseImpl::name() const { |
35 string16 result; | 37 string16 result; |
36 RenderThread::current()->Send( | 38 RenderThread::current()->Send( |
37 new IndexedDBHostMsg_DatabaseName(idb_database_id_, &result)); | 39 new IndexedDBHostMsg_DatabaseName(idb_database_id_, &result)); |
38 return result; | 40 return result; |
39 } | 41 } |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 | 112 |
111 int transaction_id; | 113 int transaction_id; |
112 RenderThread::current()->Send( | 114 RenderThread::current()->Send( |
113 new IndexedDBHostMsg_DatabaseTransaction( | 115 new IndexedDBHostMsg_DatabaseTransaction( |
114 idb_database_id_, object_stores, mode, | 116 idb_database_id_, object_stores, mode, |
115 timeout, &transaction_id, &ec)); | 117 timeout, &transaction_id, &ec)); |
116 if (!transaction_id) | 118 if (!transaction_id) |
117 return NULL; | 119 return NULL; |
118 return new RendererWebIDBTransactionImpl(transaction_id); | 120 return new RendererWebIDBTransactionImpl(transaction_id); |
119 } | 121 } |
OLD | NEW |