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_webidbtransaction_impl.h" | 5 #include "chrome/renderer/renderer_webidbtransaction_impl.h" |
6 | 6 |
| 7 #include "chrome/renderer/indexed_db_dispatcher.h" |
7 #include "chrome/common/render_messages.h" | 8 #include "chrome/common/render_messages.h" |
8 #include "chrome/renderer/render_thread.h" | 9 #include "chrome/renderer/render_thread.h" |
9 #include "chrome/renderer/indexed_db_dispatcher.h" | 10 #include "chrome/renderer/renderer_webidbobjectstore_impl.h" |
10 #include "third_party/WebKit/WebKit/chromium/public/WebIDBObjectStore.h" | 11 #include "third_party/WebKit/WebKit/chromium/public/WebIDBObjectStore.h" |
11 #include "third_party/WebKit/WebKit/chromium/public/WebIDBTransactionCallbacks.h
" | 12 #include "third_party/WebKit/WebKit/chromium/public/WebIDBTransactionCallbacks.h
" |
12 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" | 13 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" |
13 | 14 |
14 using WebKit::WebIDBObjectStore; | 15 using WebKit::WebIDBObjectStore; |
15 using WebKit::WebIDBTransactionCallbacks; | 16 using WebKit::WebIDBTransactionCallbacks; |
16 using WebKit::WebString; | 17 using WebKit::WebString; |
17 | 18 |
18 RendererWebIDBTransactionImpl::RendererWebIDBTransactionImpl( | 19 RendererWebIDBTransactionImpl::RendererWebIDBTransactionImpl( |
19 int32 idb_transaction_id) | 20 int32 idb_transaction_id) |
20 : idb_transaction_id_(idb_transaction_id) { | 21 : idb_transaction_id_(idb_transaction_id) { |
21 } | 22 } |
22 | 23 |
23 RendererWebIDBTransactionImpl::~RendererWebIDBTransactionImpl() { | 24 RendererWebIDBTransactionImpl::~RendererWebIDBTransactionImpl() { |
24 RenderThread::current()->Send(new ViewHostMsg_IDBTransactionDestroyed( | 25 RenderThread::current()->Send(new ViewHostMsg_IDBTransactionDestroyed( |
25 idb_transaction_id_)); | 26 idb_transaction_id_)); |
26 } | 27 } |
27 | 28 |
28 int RendererWebIDBTransactionImpl::mode() const | 29 int RendererWebIDBTransactionImpl::mode() const |
29 { | 30 { |
30 // TODO: implement | 31 // TODO: implement |
31 DCHECK(false); | 32 DCHECK(false); |
32 return 0; | 33 return 0; |
33 } | 34 } |
34 | 35 |
35 WebIDBObjectStore* RendererWebIDBTransactionImpl::objectStore( | 36 WebIDBObjectStore* RendererWebIDBTransactionImpl::objectStore( |
36 const WebString& name) | 37 const WebString& name) |
37 { | 38 { |
38 // TODO: implement | 39 int object_store_id; |
39 DCHECK(false); | 40 RenderThread::current()->Send( |
40 return 0; | 41 new ViewHostMsg_IDBTransactionObjectStore( |
| 42 idb_transaction_id_, name, &object_store_id)); |
| 43 return new RendererWebIDBObjectStoreImpl(object_store_id); |
41 } | 44 } |
42 | 45 |
43 void RendererWebIDBTransactionImpl::abort() | 46 void RendererWebIDBTransactionImpl::abort() |
44 { | 47 { |
45 // TODO: implement | 48 // TODO: implement |
46 DCHECK(false); | 49 DCHECK(false); |
47 } | 50 } |
48 | 51 |
49 int RendererWebIDBTransactionImpl::id() const | 52 int RendererWebIDBTransactionImpl::id() const |
50 { | 53 { |
51 return idb_transaction_id_; | 54 return idb_transaction_id_; |
52 } | 55 } |
53 | 56 |
54 void RendererWebIDBTransactionImpl::setCallbacks( | 57 void RendererWebIDBTransactionImpl::setCallbacks( |
55 WebIDBTransactionCallbacks* callbacks) | 58 WebIDBTransactionCallbacks* callbacks) |
56 { | 59 { |
57 IndexedDBDispatcher* dispatcher = | 60 IndexedDBDispatcher* dispatcher = |
58 RenderThread::current()->indexed_db_dispatcher(); | 61 RenderThread::current()->indexed_db_dispatcher(); |
59 dispatcher->RequestIDBTransactionSetCallbacks(callbacks); | 62 dispatcher->RequestIDBTransactionSetCallbacks(callbacks); |
60 } | 63 } |
OLD | NEW |