| 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 |
| 37 // TODO(jsbell): Remove this overload when WK90411 rolls. |
| 36 void RendererWebIDBFactoryImpl::open( | 38 void RendererWebIDBFactoryImpl::open( |
| 37 const WebString& name, | 39 const WebString& name, |
| 38 long long version, | 40 long long version, |
| 39 WebIDBCallbacks* callbacks, | 41 WebIDBCallbacks* 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, origin.databaseIdentifier(), web_frame); |
| 49 } | 51 } |
| 50 | 52 |
| 53 void RendererWebIDBFactoryImpl::open( |
| 54 const WebString& name, |
| 55 long long version, |
| 56 WebIDBCallbacks* callbacks, |
| 57 WebIDBDatabaseCallbacks* database_callbacks, |
| 58 const WebSecurityOrigin& origin, |
| 59 WebFrame* web_frame, |
| 60 const WebString& data_dir) { |
| 61 // Don't send the data_dir. We know what we want on the Browser side of |
| 62 // things. |
| 63 IndexedDBDispatcher* dispatcher = |
| 64 IndexedDBDispatcher::ThreadSpecificInstance(); |
| 65 dispatcher->RequestIDBFactoryOpen( |
| 66 name, version, callbacks, database_callbacks, origin.databaseIdentifier(), |
| 67 web_frame); |
| 68 } |
| 69 |
| 51 void RendererWebIDBFactoryImpl::deleteDatabase( | 70 void RendererWebIDBFactoryImpl::deleteDatabase( |
| 52 const WebString& name, | 71 const WebString& name, |
| 53 WebIDBCallbacks* callbacks, | 72 WebIDBCallbacks* callbacks, |
| 54 const WebSecurityOrigin& origin, | 73 const WebSecurityOrigin& origin, |
| 55 WebFrame* web_frame, | 74 WebFrame* web_frame, |
| 56 const WebString& data_dir) { | 75 const WebString& data_dir) { |
| 57 // Don't send the data_dir. We know what we want on the Browser side of | 76 // Don't send the data_dir. We know what we want on the Browser side of |
| 58 // things. | 77 // things. |
| 59 IndexedDBDispatcher* dispatcher = | 78 IndexedDBDispatcher* dispatcher = |
| 60 IndexedDBDispatcher::ThreadSpecificInstance(); | 79 IndexedDBDispatcher::ThreadSpecificInstance(); |
| 61 dispatcher->RequestIDBFactoryDeleteDatabase( | 80 dispatcher->RequestIDBFactoryDeleteDatabase( |
| 62 name, callbacks, origin.databaseIdentifier(), web_frame); | 81 name, callbacks, origin.databaseIdentifier(), web_frame); |
| 63 } | 82 } |
| OLD | NEW |