Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: content/browser/indexed_db/indexed_db_dispatcher_host.cc

Issue 16870007: Switch database/file_identifier to std::string, remove createFromDatabaseIdentifier calls (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/indexed_db/indexed_db_dispatcher_host.h" 5 #include "content/browser/indexed_db/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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 } 208 }
209 209
210 void IndexedDBDispatcherHost::OnIDBFactoryGetDatabaseNames( 210 void IndexedDBDispatcherHost::OnIDBFactoryGetDatabaseNames(
211 const IndexedDBHostMsg_FactoryGetDatabaseNames_Params& params) { 211 const IndexedDBHostMsg_FactoryGetDatabaseNames_Params& params) {
212 DCHECK(indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); 212 DCHECK(indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread());
213 base::FilePath indexed_db_path = indexed_db_context_->data_path(); 213 base::FilePath indexed_db_path = indexed_db_context_->data_path();
214 214
215 Context()->GetIDBFactory()->GetDatabaseNames( 215 Context()->GetIDBFactory()->GetDatabaseNames(
216 IndexedDBCallbacks::Create( 216 IndexedDBCallbacks::Create(
217 this, params.ipc_thread_id, params.ipc_callbacks_id), 217 this, params.ipc_thread_id, params.ipc_callbacks_id),
218 base::UTF8ToUTF16(params.database_identifier), 218 params.database_identifier,
219 indexed_db_path); 219 indexed_db_path);
220 } 220 }
221 221
222 void IndexedDBDispatcherHost::OnIDBFactoryOpen( 222 void IndexedDBDispatcherHost::OnIDBFactoryOpen(
223 const IndexedDBHostMsg_FactoryOpen_Params& params) { 223 const IndexedDBHostMsg_FactoryOpen_Params& params) {
224 DCHECK(indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); 224 DCHECK(indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread());
225 base::FilePath indexed_db_path = indexed_db_context_->data_path(); 225 base::FilePath indexed_db_path = indexed_db_context_->data_path();
226 226
227 GURL origin_url = 227 GURL origin_url =
228 webkit_database::GetOriginFromIdentifier(params.database_identifier); 228 webkit_database::GetOriginFromIdentifier(params.database_identifier);
(...skipping 11 matching lines...) Expand all
240 origin_url); 240 origin_url);
241 scoped_refptr<IndexedDBDatabaseCallbacks> database_callbacks = 241 scoped_refptr<IndexedDBDatabaseCallbacks> database_callbacks =
242 IndexedDBDatabaseCallbacks::Create( 242 IndexedDBDatabaseCallbacks::Create(
243 this, params.ipc_thread_id, params.ipc_database_callbacks_id); 243 this, params.ipc_thread_id, params.ipc_database_callbacks_id);
244 Context()->GetIDBFactory()-> 244 Context()->GetIDBFactory()->
245 Open(params.name, 245 Open(params.name,
246 params.version, 246 params.version,
247 host_transaction_id, 247 host_transaction_id,
248 callbacks, 248 callbacks,
249 database_callbacks, 249 database_callbacks,
250 base::UTF8ToUTF16(params.database_identifier), 250 params.database_identifier,
251 indexed_db_path); 251 indexed_db_path);
252 } 252 }
253 253
254 void IndexedDBDispatcherHost::OnIDBFactoryDeleteDatabase( 254 void IndexedDBDispatcherHost::OnIDBFactoryDeleteDatabase(
255 const IndexedDBHostMsg_FactoryDeleteDatabase_Params& params) { 255 const IndexedDBHostMsg_FactoryDeleteDatabase_Params& params) {
256 DCHECK(indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); 256 DCHECK(indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread());
257 base::FilePath indexed_db_path = indexed_db_context_->data_path(); 257 base::FilePath indexed_db_path = indexed_db_context_->data_path();
258 Context()->GetIDBFactory()->DeleteDatabase( 258 Context()->GetIDBFactory()->DeleteDatabase(
259 params.name, 259 params.name,
260 IndexedDBCallbacks::Create( 260 IndexedDBCallbacks::Create(
261 this, params.ipc_thread_id, params.ipc_callbacks_id), 261 this, params.ipc_thread_id, params.ipc_callbacks_id),
262 base::UTF8ToUTF16(params.database_identifier), 262 params.database_identifier,
263 indexed_db_path); 263 indexed_db_path);
264 } 264 }
265 265
266 void IndexedDBDispatcherHost::FinishTransaction(int64 host_transaction_id, 266 void IndexedDBDispatcherHost::FinishTransaction(int64 host_transaction_id,
267 bool committed) { 267 bool committed) {
268 DCHECK(indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); 268 DCHECK(indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread());
269 TransactionIDToURLMap& transaction_url_map = 269 TransactionIDToURLMap& transaction_url_map =
270 database_dispatcher_host_->transaction_url_map_; 270 database_dispatcher_host_->transaction_url_map_;
271 TransactionIDToSizeMap& transaction_size_map = 271 TransactionIDToSizeMap& transaction_size_map =
272 database_dispatcher_host_->transaction_size_map_; 272 database_dispatcher_host_->transaction_size_map_;
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 } 851 }
852 852
853 void IndexedDBDispatcherHost::CursorDispatcherHost::OnDestroyed( 853 void IndexedDBDispatcherHost::CursorDispatcherHost::OnDestroyed(
854 int32 ipc_object_id) { 854 int32 ipc_object_id) {
855 DCHECK( 855 DCHECK(
856 parent_->indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); 856 parent_->indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread());
857 parent_->DestroyObject(&map_, ipc_object_id); 857 parent_->DestroyObject(&map_, ipc_object_id);
858 } 858 }
859 859
860 } // namespace content 860 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/indexed_db/indexed_db_cleanup_on_io_error_unittest.cc ('k') | content/browser/indexed_db/indexed_db_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698