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/render_messages.h" | 7 #include "chrome/common/render_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" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 void RendererWebIDBDatabaseImpl::createObjectStore( | 64 void RendererWebIDBDatabaseImpl::createObjectStore( |
65 const WebString& name, const WebString& key_path, bool auto_increment, | 65 const WebString& name, const WebString& key_path, bool auto_increment, |
66 WebIDBCallbacks* callbacks) { | 66 WebIDBCallbacks* callbacks) { |
67 IndexedDBDispatcher* dispatcher = | 67 IndexedDBDispatcher* dispatcher = |
68 RenderThread::current()->indexed_db_dispatcher(); | 68 RenderThread::current()->indexed_db_dispatcher(); |
69 dispatcher->RequestIDBDatabaseCreateObjectStore( | 69 dispatcher->RequestIDBDatabaseCreateObjectStore( |
70 name, key_path, auto_increment, callbacks, idb_database_id_); | 70 name, key_path, auto_increment, callbacks, idb_database_id_); |
71 } | 71 } |
72 | 72 |
| 73 void RendererWebIDBDatabaseImpl::removeObjectStore( |
| 74 const WebString& name, WebIDBCallbacks* callbacks) { |
| 75 IndexedDBDispatcher* dispatcher = |
| 76 RenderThread::current()->indexed_db_dispatcher(); |
| 77 dispatcher->RequestIDBDatabaseRemoveObjectStore( |
| 78 name, callbacks, idb_database_id_); |
| 79 } |
| 80 |
73 WebKit::WebIDBTransaction* RendererWebIDBDatabaseImpl::transaction( | 81 WebKit::WebIDBTransaction* RendererWebIDBDatabaseImpl::transaction( |
74 const WebDOMStringList& names, unsigned short mode, | 82 const WebDOMStringList& names, unsigned short mode, |
75 unsigned long timeout) { | 83 unsigned long timeout) { |
76 std::vector<string16> object_stores(names.length()); | 84 std::vector<string16> object_stores(names.length()); |
77 for (unsigned int i = 0; i < names.length(); ++i) { | 85 for (unsigned int i = 0; i < names.length(); ++i) { |
78 object_stores.push_back(names.item(i)); | 86 object_stores.push_back(names.item(i)); |
79 } | 87 } |
80 | 88 |
81 int transaction_id; | 89 int transaction_id; |
82 RenderThread::current()->Send( | 90 RenderThread::current()->Send( |
83 new ViewHostMsg_IDBDatabaseTransaction( | 91 new ViewHostMsg_IDBDatabaseTransaction( |
84 idb_database_id_, object_stores, mode, timeout, &transaction_id)); | 92 idb_database_id_, object_stores, mode, timeout, &transaction_id)); |
85 return new RendererWebIDBTransactionImpl(transaction_id); | 93 return new RendererWebIDBTransactionImpl(transaction_id); |
86 } | 94 } |
OLD | NEW |