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_webidbindex_impl.h" | 5 #include "chrome/renderer/renderer_webidbindex_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_webidbtransaction_impl.h" | 10 #include "chrome/renderer/renderer_webidbtransaction_impl.h" |
11 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" | 11 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" |
12 #include "third_party/WebKit/WebKit/chromium/public/WebVector.h" | 12 #include "third_party/WebKit/WebKit/chromium/public/WebVector.h" |
13 | 13 |
14 using WebKit::WebExceptionCode; | 14 using WebKit::WebExceptionCode; |
15 using WebKit::WebDOMStringList; | 15 using WebKit::WebDOMStringList; |
16 using WebKit::WebString; | 16 using WebKit::WebString; |
17 using WebKit::WebVector; | 17 using WebKit::WebVector; |
18 | 18 |
19 RendererWebIDBIndexImpl::RendererWebIDBIndexImpl(int32 idb_index_id) | 19 RendererWebIDBIndexImpl::RendererWebIDBIndexImpl(int32 idb_index_id) |
20 : idb_index_id_(idb_index_id) { | 20 : idb_index_id_(idb_index_id) { |
21 } | 21 } |
22 | 22 |
23 RendererWebIDBIndexImpl::~RendererWebIDBIndexImpl() { | 23 RendererWebIDBIndexImpl::~RendererWebIDBIndexImpl() { |
24 // TODO(jorlow): Is it possible for this to be destroyed but still have | 24 // It's not possible for there to be pending callbacks that address this |
25 // pending callbacks? If so, fix! | 25 // object since inside WebKit, they hold a reference to the object wich owns |
| 26 // this object. But, if that ever changed, then we'd need to invalidate |
| 27 // any such pointers. |
26 RenderThread::current()->Send(new IndexedDBHostMsg_IndexDestroyed( | 28 RenderThread::current()->Send(new IndexedDBHostMsg_IndexDestroyed( |
27 idb_index_id_)); | 29 idb_index_id_)); |
28 } | 30 } |
29 | 31 |
30 WebString RendererWebIDBIndexImpl::name() const { | 32 WebString RendererWebIDBIndexImpl::name() const { |
31 string16 result; | 33 string16 result; |
32 RenderThread::current()->Send( | 34 RenderThread::current()->Send( |
33 new IndexedDBHostMsg_IndexName(idb_index_id_, &result)); | 35 new IndexedDBHostMsg_IndexName(idb_index_id_, &result)); |
34 return result; | 36 return result; |
35 } | 37 } |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 void RendererWebIDBIndexImpl::getKey( | 95 void RendererWebIDBIndexImpl::getKey( |
94 const WebKit::WebIDBKey& key, | 96 const WebKit::WebIDBKey& key, |
95 WebKit::WebIDBCallbacks* callbacks, | 97 WebKit::WebIDBCallbacks* callbacks, |
96 const WebKit::WebIDBTransaction& transaction, | 98 const WebKit::WebIDBTransaction& transaction, |
97 WebExceptionCode& ec) { | 99 WebExceptionCode& ec) { |
98 IndexedDBDispatcher* dispatcher = | 100 IndexedDBDispatcher* dispatcher = |
99 RenderThread::current()->indexed_db_dispatcher(); | 101 RenderThread::current()->indexed_db_dispatcher(); |
100 dispatcher->RequestIDBIndexGetKey( | 102 dispatcher->RequestIDBIndexGetKey( |
101 IndexedDBKey(key), callbacks, idb_index_id_, transaction, &ec); | 103 IndexedDBKey(key), callbacks, idb_index_id_, transaction, &ec); |
102 } | 104 } |
OLD | NEW |