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