| 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_webidbfactory_impl.h" | 5 #include "content/common/indexed_db/proxy_webidbfactory_impl.h" |
| 6 | 6 |
| 7 #include "content/common/indexed_db/indexed_db_dispatcher.h" | 7 #include "content/common/indexed_db/indexed_db_dispatcher.h" |
| 8 #include "content/common/child_thread.h" | 8 #include "content/common/child_thread.h" |
| 9 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" | 9 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" |
| 10 | 10 |
| 11 using WebKit::WebFrame; | 11 using WebKit::WebFrame; |
| 12 using WebKit::WebIDBCallbacks; | 12 using WebKit::WebIDBCallbacks; |
| 13 using WebKit::WebIDBDatabase; | 13 using WebKit::WebIDBDatabase; |
| 14 using WebKit::WebIDBDatabaseCallbacks; | 14 using WebKit::WebIDBDatabaseCallbacks; |
| 15 using WebKit::WebSecurityOrigin; | |
| 16 using WebKit::WebString; | 15 using WebKit::WebString; |
| 17 | 16 |
| 18 namespace content { | 17 namespace content { |
| 19 | 18 |
| 20 RendererWebIDBFactoryImpl::RendererWebIDBFactoryImpl() { | 19 RendererWebIDBFactoryImpl::RendererWebIDBFactoryImpl() { |
| 21 } | 20 } |
| 22 | 21 |
| 23 RendererWebIDBFactoryImpl::~RendererWebIDBFactoryImpl() { | 22 RendererWebIDBFactoryImpl::~RendererWebIDBFactoryImpl() { |
| 24 } | 23 } |
| 25 | 24 |
| 26 void RendererWebIDBFactoryImpl::getDatabaseNames( | 25 void RendererWebIDBFactoryImpl::getDatabaseNames( |
| 27 WebIDBCallbacks* callbacks, | 26 WebIDBCallbacks* callbacks, |
| 28 const WebSecurityOrigin& origin, | 27 const WebString& database_identifier, |
| 29 WebFrame* web_frame, | |
| 30 const WebString& data_dir_unused) { | 28 const WebString& data_dir_unused) { |
| 31 IndexedDBDispatcher* dispatcher = | 29 IndexedDBDispatcher* dispatcher = |
| 32 IndexedDBDispatcher::ThreadSpecificInstance(); | 30 IndexedDBDispatcher::ThreadSpecificInstance(); |
| 33 dispatcher->RequestIDBFactoryGetDatabaseNames( | 31 dispatcher->RequestIDBFactoryGetDatabaseNames( |
| 34 callbacks, origin.databaseIdentifier(), web_frame); | 32 callbacks, database_identifier); |
| 35 } | 33 } |
| 36 | 34 |
| 37 void RendererWebIDBFactoryImpl::open( | 35 void RendererWebIDBFactoryImpl::open( |
| 38 const WebString& name, | 36 const WebString& name, |
| 39 long long version, | 37 long long version, |
| 40 long long transaction_id, | 38 long long transaction_id, |
| 41 WebIDBCallbacks* callbacks, | 39 WebIDBCallbacks* callbacks, |
| 42 WebIDBDatabaseCallbacks* database_callbacks, | 40 WebIDBDatabaseCallbacks* database_callbacks, |
| 43 const WebSecurityOrigin& origin, | 41 const WebString& database_identifier, |
| 44 WebFrame* web_frame, | |
| 45 const WebString& data_dir) { | 42 const WebString& data_dir) { |
| 46 // Don't send the data_dir. We know what we want on the Browser side of | 43 // Don't send the data_dir. We know what we want on the Browser side of |
| 47 // things. | 44 // things. |
| 48 IndexedDBDispatcher* dispatcher = | 45 IndexedDBDispatcher* dispatcher = |
| 49 IndexedDBDispatcher::ThreadSpecificInstance(); | 46 IndexedDBDispatcher::ThreadSpecificInstance(); |
| 50 dispatcher->RequestIDBFactoryOpen( | 47 dispatcher->RequestIDBFactoryOpen( |
| 51 name, version, transaction_id, callbacks, database_callbacks, | 48 name, version, transaction_id, callbacks, database_callbacks, |
| 52 origin.databaseIdentifier(), | 49 database_identifier); |
| 53 web_frame); | |
| 54 } | 50 } |
| 55 | 51 |
| 56 void RendererWebIDBFactoryImpl::deleteDatabase( | 52 void RendererWebIDBFactoryImpl::deleteDatabase( |
| 57 const WebString& name, | 53 const WebString& name, |
| 58 WebIDBCallbacks* callbacks, | 54 WebIDBCallbacks* callbacks, |
| 59 const WebSecurityOrigin& origin, | 55 const WebString& database_identifier, |
| 60 WebFrame* web_frame, | |
| 61 const WebString& data_dir) { | 56 const WebString& data_dir) { |
| 62 // Don't send the data_dir. We know what we want on the Browser side of | 57 // Don't send the data_dir. We know what we want on the Browser side of |
| 63 // things. | 58 // things. |
| 64 IndexedDBDispatcher* dispatcher = | 59 IndexedDBDispatcher* dispatcher = |
| 65 IndexedDBDispatcher::ThreadSpecificInstance(); | 60 IndexedDBDispatcher::ThreadSpecificInstance(); |
| 66 dispatcher->RequestIDBFactoryDeleteDatabase( | 61 dispatcher->RequestIDBFactoryDeleteDatabase( |
| 67 name, callbacks, origin.databaseIdentifier(), web_frame); | 62 name, callbacks, database_identifier); |
| 68 } | 63 } |
| 69 | 64 |
| 70 } // namespace content | 65 } // namespace content |
| OLD | NEW |