| 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 "third_party/WebKit/WebKit/chromium/public/WebString.h" |
| 10 | 11 |
| 11 using WebKit::WebDOMStringList; | 12 using WebKit::WebDOMStringList; |
| 13 using WebKit::WebFrame; |
| 14 using WebKit::WebIDBCallbacks; |
| 12 using WebKit::WebString; | 15 using WebKit::WebString; |
| 13 using WebKit::WebVector; | 16 using WebKit::WebVector; |
| 14 | 17 |
| 15 RendererWebIDBDatabaseImpl::RendererWebIDBDatabaseImpl(int32 idb_database_id) | 18 RendererWebIDBDatabaseImpl::RendererWebIDBDatabaseImpl(int32 idb_database_id) |
| 16 : idb_database_id_(idb_database_id) { | 19 : idb_database_id_(idb_database_id) { |
| 17 } | 20 } |
| 18 | 21 |
| 19 RendererWebIDBDatabaseImpl::~RendererWebIDBDatabaseImpl() { | 22 RendererWebIDBDatabaseImpl::~RendererWebIDBDatabaseImpl() { |
| 20 // TODO(jorlow): Is it possible for this to be destroyed but still have | 23 // TODO(jorlow): Is it possible for this to be destroyed but still have |
| 21 // pending callbacks? If so, fix! | 24 // pending callbacks? If so, fix! |
| (...skipping 26 matching lines...) Expand all Loading... |
| 48 std::vector<string16> result; | 51 std::vector<string16> result; |
| 49 RenderThread::current()->Send( | 52 RenderThread::current()->Send( |
| 50 new ViewHostMsg_IDBDatabaseObjectStores(idb_database_id_, &result)); | 53 new ViewHostMsg_IDBDatabaseObjectStores(idb_database_id_, &result)); |
| 51 WebDOMStringList webResult; | 54 WebDOMStringList webResult; |
| 52 for (std::vector<string16>::const_iterator it = result.begin(); | 55 for (std::vector<string16>::const_iterator it = result.begin(); |
| 53 it != result.end(); ++it) { | 56 it != result.end(); ++it) { |
| 54 webResult.append(*it); | 57 webResult.append(*it); |
| 55 } | 58 } |
| 56 return webResult; | 59 return webResult; |
| 57 } | 60 } |
| 61 |
| 62 void RendererWebIDBDatabaseImpl::createObjectStore( |
| 63 const WebString& name, const WebString& key_path, bool auto_increment, |
| 64 WebIDBCallbacks* callbacks) { |
| 65 IndexedDBDispatcher* dispatcher = |
| 66 RenderThread::current()->indexed_db_dispatcher(); |
| 67 dispatcher->RequestIDBDatabaseCreateObjectStore( |
| 68 name, key_path, auto_increment, callbacks, idb_database_id_); |
| 69 } |
| OLD | NEW |