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

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

Issue 10896030: Change some IndexedDBCallbacks<> specializations to derived classes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync to ToT 2 Created 8 years, 3 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/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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 WebSecurityOrigin origin( 231 WebSecurityOrigin origin(
232 WebSecurityOrigin::createFromDatabaseIdentifier(params.origin)); 232 WebSecurityOrigin::createFromDatabaseIdentifier(params.origin));
233 233
234 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); 234 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED));
235 235
236 // TODO(dgrogan): Don't let a non-existing database be opened (and therefore 236 // TODO(dgrogan): Don't let a non-existing database be opened (and therefore
237 // created) if this origin is already over quota. 237 // created) if this origin is already over quota.
238 Context()->GetIDBFactory()->open( 238 Context()->GetIDBFactory()->open(
239 params.name, 239 params.name,
240 params.version, 240 params.version,
241 new IndexedDBCallbacks<WebIDBDatabase>(this, params.thread_id, 241 new IndexedDBCallbacksDatabase(this, params.thread_id,
242 params.response_id, origin_url), 242 params.response_id, origin_url),
243 origin, NULL, webkit_glue::FilePathToWebString(indexed_db_path)); 243 origin, NULL, webkit_glue::FilePathToWebString(indexed_db_path));
244 } 244 }
245 245
246 void IndexedDBDispatcherHost::OnIDBFactoryDeleteDatabase( 246 void IndexedDBDispatcherHost::OnIDBFactoryDeleteDatabase(
247 const IndexedDBHostMsg_FactoryDeleteDatabase_Params& params) { 247 const IndexedDBHostMsg_FactoryDeleteDatabase_Params& params) {
248 FilePath indexed_db_path = indexed_db_context_->data_path(); 248 FilePath indexed_db_path = indexed_db_context_->data_path();
249 249
250 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); 250 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED));
251 Context()->GetIDBFactory()->deleteDatabase( 251 Context()->GetIDBFactory()->deleteDatabase(
252 params.name, 252 params.name,
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 WebKit::WebExceptionCode* ec) { 413 WebKit::WebExceptionCode* ec) {
414 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); 414 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED));
415 WebIDBDatabase* idb_database = parent_->GetOrTerminateProcess( 415 WebIDBDatabase* idb_database = parent_->GetOrTerminateProcess(
416 &map_, idb_database_id); 416 &map_, idb_database_id);
417 if (!idb_database) 417 if (!idb_database)
418 return; 418 return;
419 419
420 *ec = 0; 420 *ec = 0;
421 idb_database->setVersion( 421 idb_database->setVersion(
422 version, 422 version,
423 new IndexedDBCallbacks<WebIDBTransaction>(parent_, thread_id, response_id, 423 new IndexedDBCallbacksTransaction(parent_, thread_id, response_id,
424 database_url_map_[idb_database_id]), 424 database_url_map_[idb_database_id]),
425 *ec); 425 *ec);
426 } 426 }
427 427
428 void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnTransaction( 428 void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnTransaction(
429 int32 thread_id, 429 int32 thread_id,
430 int32 idb_database_id, 430 int32 idb_database_id,
431 const std::vector<string16>& names, 431 const std::vector<string16>& names,
432 int32 mode, 432 int32 mode,
433 int32* idb_transaction_id, 433 int32* idb_transaction_id,
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
1108 } 1108 }
1109 1109
1110 void IndexedDBDispatcherHost::TransactionDispatcherHost::OnDestroyed( 1110 void IndexedDBDispatcherHost::TransactionDispatcherHost::OnDestroyed(
1111 int32 object_id) { 1111 int32 object_id) {
1112 // TODO(dgrogan): This doesn't seem to be happening with some version change 1112 // TODO(dgrogan): This doesn't seem to be happening with some version change
1113 // transactions. Possibly introduced with integer version support. 1113 // transactions. Possibly introduced with integer version support.
1114 transaction_size_map_.erase(object_id); 1114 transaction_size_map_.erase(object_id);
1115 transaction_url_map_.erase(object_id); 1115 transaction_url_map_.erase(object_id);
1116 parent_->DestroyObject(&map_, object_id); 1116 parent_->DestroyObject(&map_, object_id);
1117 } 1117 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698