OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "content/common/indexed_db/proxy_webidbindex_impl.h" | |
6 | |
7 #include "content/common/indexed_db/indexed_db_dispatcher.h" | |
8 #include "content/common/indexed_db/indexed_db_messages.h" | |
9 #include "content/common/indexed_db/proxy_webidbtransaction_impl.h" | |
10 #include "content/common/child_thread.h" | |
11 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" | |
12 #include "third_party/WebKit/Source/Platform/chromium/public/WebVector.h" | |
13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKeyPath.h" | |
14 | |
15 using WebKit::WebExceptionCode; | |
16 using WebKit::WebDOMStringList; | |
17 using WebKit::WebIDBKeyPath; | |
18 using WebKit::WebString; | |
19 using WebKit::WebVector; | |
20 | |
21 namespace content { | |
22 | |
23 RendererWebIDBIndexImpl::RendererWebIDBIndexImpl(int32 ipc_index_id) | |
24 : ipc_index_id_(ipc_index_id) { | |
25 } | |
26 | |
27 RendererWebIDBIndexImpl::~RendererWebIDBIndexImpl() { | |
28 // It's not possible for there to be pending callbacks that address this | |
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. | |
32 IndexedDBDispatcher::Send(new IndexedDBHostMsg_IndexDestroyed( | |
33 ipc_index_id_)); | |
34 } | |
35 | |
36 void RendererWebIDBIndexImpl::openObjectCursor( | |
37 const WebKit::WebIDBKeyRange& range, | |
38 unsigned short direction, | |
39 WebKit::WebIDBCallbacks* callbacks, | |
40 const WebKit::WebIDBTransaction& transaction, | |
41 WebExceptionCode& ec) { | |
42 IndexedDBDispatcher* dispatcher = | |
43 IndexedDBDispatcher::ThreadSpecificInstance(); | |
44 dispatcher->RequestIDBIndexOpenObjectCursor( | |
45 range, direction, callbacks, ipc_index_id_, transaction, &ec); | |
46 } | |
47 | |
48 void RendererWebIDBIndexImpl::openKeyCursor( | |
49 const WebKit::WebIDBKeyRange& range, | |
50 unsigned short direction, | |
51 WebKit::WebIDBCallbacks* callbacks, | |
52 const WebKit::WebIDBTransaction& transaction, | |
53 WebExceptionCode& ec) { | |
54 IndexedDBDispatcher* dispatcher = | |
55 IndexedDBDispatcher::ThreadSpecificInstance(); | |
56 dispatcher->RequestIDBIndexOpenKeyCursor( | |
57 range, direction, callbacks, ipc_index_id_, transaction, &ec); | |
58 } | |
59 | |
60 void RendererWebIDBIndexImpl::count( | |
61 const WebKit::WebIDBKeyRange& range, | |
62 WebKit::WebIDBCallbacks* callbacks, | |
63 const WebKit::WebIDBTransaction& transaction, | |
64 WebExceptionCode& ec) { | |
65 IndexedDBDispatcher* dispatcher = | |
66 IndexedDBDispatcher::ThreadSpecificInstance(); | |
67 dispatcher->RequestIDBIndexCount( | |
68 range, callbacks, ipc_index_id_, transaction, &ec); | |
69 } | |
70 | |
71 void RendererWebIDBIndexImpl::getObject( | |
72 const WebKit::WebIDBKeyRange& key_range, | |
73 WebKit::WebIDBCallbacks* callbacks, | |
74 const WebKit::WebIDBTransaction& transaction, | |
75 WebExceptionCode& ec) { | |
76 IndexedDBDispatcher* dispatcher = | |
77 IndexedDBDispatcher::ThreadSpecificInstance(); | |
78 dispatcher->RequestIDBIndexGetObject( | |
79 IndexedDBKeyRange(key_range), callbacks, ipc_index_id_, | |
80 transaction, &ec); | |
81 } | |
82 | |
83 void RendererWebIDBIndexImpl::getKey( | |
84 const WebKit::WebIDBKeyRange& key_range, | |
85 WebKit::WebIDBCallbacks* callbacks, | |
86 const WebKit::WebIDBTransaction& transaction, | |
87 WebExceptionCode& ec) { | |
88 IndexedDBDispatcher* dispatcher = | |
89 IndexedDBDispatcher::ThreadSpecificInstance(); | |
90 dispatcher->RequestIDBIndexGetKey( | |
91 IndexedDBKeyRange(key_range), callbacks, ipc_index_id_, | |
92 transaction, &ec); | |
93 } | |
94 | |
95 } // namespace content | |
OLD | NEW |