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