| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 "content/common/indexed_db/proxy_webidbdatabase_impl.h" | 5 #include "content/common/indexed_db/proxy_webidbdatabase_impl.h" |
| 6 | 6 |
| 7 #include "content/common/child_thread.h" | 7 #include "content/common/child_thread.h" |
| 8 #include "content/common/indexed_db/indexed_db_messages.h" | 8 #include "content/common/indexed_db/indexed_db_messages.h" |
| 9 #include "content/common/indexed_db/indexed_db_dispatcher.h" | 9 #include "content/common/indexed_db/indexed_db_dispatcher.h" |
| 10 #include "content/common/indexed_db/proxy_webidbobjectstore_impl.h" | 10 #include "content/common/indexed_db/proxy_webidbobjectstore_impl.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 web_index_metadata.name = idb_index_metadata.name; | 72 web_index_metadata.name = idb_index_metadata.name; |
| 73 web_index_metadata.keyPath = idb_index_metadata.keyPath; | 73 web_index_metadata.keyPath = idb_index_metadata.keyPath; |
| 74 web_index_metadata.unique = idb_index_metadata.unique; | 74 web_index_metadata.unique = idb_index_metadata.unique; |
| 75 web_index_metadata.multiEntry = idb_index_metadata.multiEntry; | 75 web_index_metadata.multiEntry = idb_index_metadata.multiEntry; |
| 76 } | 76 } |
| 77 } | 77 } |
| 78 | 78 |
| 79 return web_metadata; | 79 return web_metadata; |
| 80 } | 80 } |
| 81 | 81 |
| 82 WebString RendererWebIDBDatabaseImpl::name() const { | |
| 83 string16 result; | |
| 84 IndexedDBDispatcher::Send( | |
| 85 new IndexedDBHostMsg_DatabaseName(idb_database_id_, &result)); | |
| 86 return result; | |
| 87 } | |
| 88 | |
| 89 WebString RendererWebIDBDatabaseImpl::version() const { | |
| 90 string16 result; | |
| 91 IndexedDBDispatcher::Send( | |
| 92 new IndexedDBHostMsg_DatabaseVersion(idb_database_id_, &result)); | |
| 93 return result; | |
| 94 } | |
| 95 | |
| 96 WebDOMStringList RendererWebIDBDatabaseImpl::objectStoreNames() const { | |
| 97 std::vector<string16> result; | |
| 98 IndexedDBDispatcher::Send( | |
| 99 new IndexedDBHostMsg_DatabaseObjectStoreNames(idb_database_id_, &result)); | |
| 100 WebDOMStringList webResult; | |
| 101 for (std::vector<string16>::const_iterator it = result.begin(); | |
| 102 it != result.end(); ++it) { | |
| 103 webResult.append(*it); | |
| 104 } | |
| 105 return webResult; | |
| 106 } | |
| 107 | |
| 108 WebKit::WebIDBObjectStore* RendererWebIDBDatabaseImpl::createObjectStore( | 82 WebKit::WebIDBObjectStore* RendererWebIDBDatabaseImpl::createObjectStore( |
| 109 const WebKit::WebString& name, | 83 const WebKit::WebString& name, |
| 110 const WebKit::WebIDBKeyPath& key_path, | 84 const WebKit::WebIDBKeyPath& key_path, |
| 111 bool auto_increment, | 85 bool auto_increment, |
| 112 const WebKit::WebIDBTransaction& transaction, | 86 const WebKit::WebIDBTransaction& transaction, |
| 113 WebExceptionCode& ec) { | 87 WebExceptionCode& ec) { |
| 114 IndexedDBHostMsg_DatabaseCreateObjectStore_Params params; | 88 IndexedDBHostMsg_DatabaseCreateObjectStore_Params params; |
| 115 params.name = name; | 89 params.name = name; |
| 116 params.key_path = content::IndexedDBKeyPath(key_path); | 90 params.key_path = content::IndexedDBKeyPath(key_path); |
| 117 params.auto_increment = auto_increment; | 91 params.auto_increment = auto_increment; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 IndexedDBDispatcher::ThreadSpecificInstance(); | 144 IndexedDBDispatcher::ThreadSpecificInstance(); |
| 171 dispatcher->RequestIDBDatabaseClose(idb_database_id_); | 145 dispatcher->RequestIDBDatabaseClose(idb_database_id_); |
| 172 } | 146 } |
| 173 | 147 |
| 174 void RendererWebIDBDatabaseImpl::open(WebIDBDatabaseCallbacks* callbacks) { | 148 void RendererWebIDBDatabaseImpl::open(WebIDBDatabaseCallbacks* callbacks) { |
| 175 IndexedDBDispatcher* dispatcher = | 149 IndexedDBDispatcher* dispatcher = |
| 176 IndexedDBDispatcher::ThreadSpecificInstance(); | 150 IndexedDBDispatcher::ThreadSpecificInstance(); |
| 177 DCHECK(dispatcher); | 151 DCHECK(dispatcher); |
| 178 dispatcher->RequestIDBDatabaseOpen(callbacks, idb_database_id_); | 152 dispatcher->RequestIDBDatabaseOpen(callbacks, idb_database_id_); |
| 179 } | 153 } |
| OLD | NEW |