OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "content/browser/in_process_webkit/indexed_db_callbacks.h" | 10 #include "content/browser/in_process_webkit/indexed_db_callbacks.h" |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 | 252 |
253 void IndexedDBDispatcherHost::OnIDBFactoryDeleteDatabase( | 253 void IndexedDBDispatcherHost::OnIDBFactoryDeleteDatabase( |
254 const IndexedDBHostMsg_FactoryDeleteDatabase_Params& params) { | 254 const IndexedDBHostMsg_FactoryDeleteDatabase_Params& params) { |
255 FilePath base_path = webkit_context_->data_path(); | 255 FilePath base_path = webkit_context_->data_path(); |
256 FilePath indexed_db_path; | 256 FilePath indexed_db_path; |
257 if (!base_path.empty()) { | 257 if (!base_path.empty()) { |
258 indexed_db_path = base_path.Append( | 258 indexed_db_path = base_path.Append( |
259 IndexedDBContext::kIndexedDBDirectory); | 259 IndexedDBContext::kIndexedDBDirectory); |
260 } | 260 } |
261 | 261 |
262 WebSecurityOrigin origin( | |
263 WebSecurityOrigin::createFromDatabaseIdentifier(params.origin)); | |
264 GURL url(origin.toString()); | |
265 | |
266 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); | 262 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); |
267 Context()->GetIDBFactory()->deleteDatabase( | 263 Context()->GetIDBFactory()->deleteDatabase( |
268 params.name, | 264 params.name, |
269 new IndexedDBCallbacks<WebIDBDatabase>(this, params.response_id, url), | 265 new IndexedDBCallbacks<WebSerializedScriptValue>(this, |
| 266 params.response_id), |
270 WebSecurityOrigin::createFromDatabaseIdentifier(params.origin), NULL, | 267 WebSecurityOrigin::createFromDatabaseIdentifier(params.origin), NULL, |
271 webkit_glue::FilePathToWebString(indexed_db_path)); | 268 webkit_glue::FilePathToWebString(indexed_db_path)); |
272 } | 269 } |
273 | 270 |
274 void IndexedDBDispatcherHost::TransactionComplete(int32 transaction_id) { | 271 void IndexedDBDispatcherHost::TransactionComplete(int32 transaction_id) { |
275 Context()->TransactionComplete( | 272 Context()->TransactionComplete( |
276 transaction_dispatcher_host_->transaction_url_map_[transaction_id]); | 273 transaction_dispatcher_host_->transaction_url_map_[transaction_id]); |
277 } | 274 } |
278 | 275 |
279 ////////////////////////////////////////////////////////////////////// | 276 ////////////////////////////////////////////////////////////////////// |
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1106 } | 1103 } |
1107 idb_transaction->didCompleteTaskEvents(); | 1104 idb_transaction->didCompleteTaskEvents(); |
1108 } | 1105 } |
1109 | 1106 |
1110 void IndexedDBDispatcherHost::TransactionDispatcherHost::OnDestroyed( | 1107 void IndexedDBDispatcherHost::TransactionDispatcherHost::OnDestroyed( |
1111 int32 object_id) { | 1108 int32 object_id) { |
1112 transaction_size_map_.erase(object_id); | 1109 transaction_size_map_.erase(object_id); |
1113 transaction_url_map_.erase(object_id); | 1110 transaction_url_map_.erase(object_id); |
1114 parent_->DestroyObject(&map_, object_id); | 1111 parent_->DestroyObject(&map_, object_id); |
1115 } | 1112 } |
OLD | NEW |