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/browser/in_process_webkit/indexed_db_dispatcher_host.h" | 5 #include "content/browser/in_process_webkit/indexed_db_dispatcher_host.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "content/common/indexed_db/indexed_db_messages.h" | 22 #include "content/common/indexed_db/indexed_db_messages.h" |
23 #include "content/public/browser/browser_thread.h" | 23 #include "content/public/browser/browser_thread.h" |
24 #include "content/public/browser/user_metrics.h" | 24 #include "content/public/browser/user_metrics.h" |
25 #include "content/public/common/content_switches.h" | 25 #include "content/public/common/content_switches.h" |
26 #include "content/public/common/result_codes.h" | 26 #include "content/public/common/result_codes.h" |
27 #include "googleurl/src/gurl.h" | 27 #include "googleurl/src/gurl.h" |
28 #include "third_party/WebKit/public/platform/WebIDBDatabase.h" | 28 #include "third_party/WebKit/public/platform/WebIDBDatabase.h" |
29 #include "third_party/WebKit/public/platform/WebIDBDatabaseError.h" | 29 #include "third_party/WebKit/public/platform/WebIDBDatabaseError.h" |
30 #include "third_party/WebKit/public/platform/WebIDBDatabaseException.h" | 30 #include "third_party/WebKit/public/platform/WebIDBDatabaseException.h" |
31 #include "webkit/base/file_path_string_conversions.h" | 31 #include "webkit/base/file_path_string_conversions.h" |
32 #include "webkit/base/origin_url_conversions.h" | |
33 #include "webkit/browser/database/database_util.h" | 32 #include "webkit/browser/database/database_util.h" |
| 33 #include "webkit/common/database/database_identifier.h" |
34 | 34 |
35 using webkit_database::DatabaseUtil; | 35 using webkit_database::DatabaseUtil; |
36 using WebKit::WebIDBDatabaseError; | 36 using WebKit::WebIDBDatabaseError; |
37 using WebKit::WebIDBKey; | 37 using WebKit::WebIDBKey; |
38 | 38 |
39 namespace content { | 39 namespace content { |
40 namespace { | 40 namespace { |
41 | 41 |
42 template <class T> | 42 template <class T> |
43 void DeleteOnWebKitThread(T* obj) { | 43 void DeleteOnWebKitThread(T* obj) { |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 WebKit::WebString::fromUTF8(params.database_identifier), | 226 WebKit::WebString::fromUTF8(params.database_identifier), |
227 webkit_base::FilePathToWebString(indexed_db_path)); | 227 webkit_base::FilePathToWebString(indexed_db_path)); |
228 } | 228 } |
229 | 229 |
230 void IndexedDBDispatcherHost::OnIDBFactoryOpen( | 230 void IndexedDBDispatcherHost::OnIDBFactoryOpen( |
231 const IndexedDBHostMsg_FactoryOpen_Params& params) { | 231 const IndexedDBHostMsg_FactoryOpen_Params& params) { |
232 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); | 232 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); |
233 base::FilePath indexed_db_path = indexed_db_context_->data_path(); | 233 base::FilePath indexed_db_path = indexed_db_context_->data_path(); |
234 | 234 |
235 GURL origin_url = | 235 GURL origin_url = |
236 webkit_base::GetOriginURLFromIdentifier(params.database_identifier); | 236 webkit_database::GetOriginFromIdentifier(params.database_identifier); |
237 | 237 |
238 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); | 238 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); |
239 | 239 |
240 int64 host_transaction_id = HostTransactionId(params.transaction_id); | 240 int64 host_transaction_id = HostTransactionId(params.transaction_id); |
241 | 241 |
242 // TODO(dgrogan): Don't let a non-existing database be opened (and therefore | 242 // TODO(dgrogan): Don't let a non-existing database be opened (and therefore |
243 // created) if this origin is already over quota. | 243 // created) if this origin is already over quota. |
244 Context()->GetIDBFactory() | 244 Context()->GetIDBFactory() |
245 ->open(params.name, | 245 ->open(params.name, |
246 params.version, | 246 params.version, |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
814 | 814 |
815 idb_cursor->prefetchReset(used_prefetches, unused_prefetches); | 815 idb_cursor->prefetchReset(used_prefetches, unused_prefetches); |
816 } | 816 } |
817 | 817 |
818 void IndexedDBDispatcherHost::CursorDispatcherHost::OnDestroyed( | 818 void IndexedDBDispatcherHost::CursorDispatcherHost::OnDestroyed( |
819 int32 ipc_object_id) { | 819 int32 ipc_object_id) { |
820 parent_->DestroyObject(&map_, ipc_object_id); | 820 parent_->DestroyObject(&map_, ipc_object_id); |
821 } | 821 } |
822 | 822 |
823 } // namespace content | 823 } // namespace content |
OLD | NEW |