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

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

Issue 18224002: IndexedDB: Eliminate IndexedDBDatabaseCallbacksWrapper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Include fix for win 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
« no previous file with comments | « content/browser/indexed_db/webidbdatabase_impl.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/browser/indexed_db/webidbdatabase_impl.h" 5 #include "content/browser/indexed_db/webidbdatabase_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "content/browser/indexed_db/indexed_db_callbacks_wrapper.h" 11 #include "content/browser/indexed_db/indexed_db_callbacks_wrapper.h"
12 #include "content/browser/indexed_db/indexed_db_cursor.h" 12 #include "content/browser/indexed_db/indexed_db_cursor.h"
13 #include "content/browser/indexed_db/indexed_db_database.h" 13 #include "content/browser/indexed_db/indexed_db_database.h"
14 #include "content/browser/indexed_db/indexed_db_database_callbacks.h"
14 #include "content/browser/indexed_db/indexed_db_database_error.h" 15 #include "content/browser/indexed_db/indexed_db_database_error.h"
15 #include "content/browser/indexed_db/indexed_db_metadata.h" 16 #include "content/browser/indexed_db/indexed_db_metadata.h"
16 #include "content/common/indexed_db/indexed_db_key_range.h" 17 #include "content/common/indexed_db/indexed_db_key_range.h"
17 18
18 namespace content { 19 namespace content {
19 20
20 WebIDBDatabaseImpl::WebIDBDatabaseImpl( 21 WebIDBDatabaseImpl::WebIDBDatabaseImpl(
21 scoped_refptr<IndexedDBDatabase> database_backend, 22 scoped_refptr<IndexedDBDatabase> database_backend,
22 scoped_refptr<IndexedDBDatabaseCallbacksWrapper> database_callbacks) 23 scoped_refptr<IndexedDBDatabaseCallbacks> database_callbacks)
23 : database_backend_(database_backend), 24 : database_backend_(database_backend),
24 database_callbacks_(database_callbacks) {} 25 database_callbacks_(database_callbacks) {}
25 26
26 WebIDBDatabaseImpl::~WebIDBDatabaseImpl() {} 27 WebIDBDatabaseImpl::~WebIDBDatabaseImpl() {}
27 28
28 void WebIDBDatabaseImpl::createObjectStore(long long transaction_id, 29 void WebIDBDatabaseImpl::createObjectStore(long long transaction_id,
29 long long object_store_id, 30 long long object_store_id,
30 const string16& name, 31 const string16& name,
31 const IndexedDBKeyPath& key_path, 32 const IndexedDBKeyPath& key_path,
32 bool auto_increment) { 33 bool auto_increment) {
33 database_backend_->CreateObjectStore(transaction_id, 34 database_backend_->CreateObjectStore(transaction_id,
34 object_store_id, 35 object_store_id,
35 name, 36 name,
36 IndexedDBKeyPath(key_path), 37 IndexedDBKeyPath(key_path),
37 auto_increment); 38 auto_increment);
38 } 39 }
39 40
40 void WebIDBDatabaseImpl::deleteObjectStore(long long transaction_id, 41 void WebIDBDatabaseImpl::deleteObjectStore(long long transaction_id,
41 long long object_store_id) { 42 long long object_store_id) {
42 database_backend_->DeleteObjectStore(transaction_id, object_store_id); 43 database_backend_->DeleteObjectStore(transaction_id, object_store_id);
43 } 44 }
44 45
45 void WebIDBDatabaseImpl::createTransaction( 46 void WebIDBDatabaseImpl::createTransaction(
46 long long id, 47 long long id,
47 IndexedDBDatabaseCallbacks* /*callbacks*/,
48 const std::vector<int64>& object_store_ids, 48 const std::vector<int64>& object_store_ids,
49 unsigned short mode) { 49 unsigned short mode) {
50 if (!database_callbacks_.get()) 50 if (!database_callbacks_.get())
51 return; 51 return;
52 database_backend_->CreateTransaction( 52 database_backend_->CreateTransaction(
53 id, database_callbacks_.get(), object_store_ids, mode); 53 id, database_callbacks_.get(), object_store_ids, mode);
54 } 54 }
55 55
56 void WebIDBDatabaseImpl::close() { 56 void WebIDBDatabaseImpl::close() {
57 // Use the callbacks passed in to the constructor so that the backend in 57 // Use the callbacks passed in to the constructor so that the backend in
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 } 228 }
229 229
230 void WebIDBDatabaseImpl::deleteIndex(long long transaction_id, 230 void WebIDBDatabaseImpl::deleteIndex(long long transaction_id,
231 long long object_store_id, 231 long long object_store_id,
232 long long index_id) { 232 long long index_id) {
233 if (database_backend_.get()) 233 if (database_backend_.get())
234 database_backend_->DeleteIndex(transaction_id, object_store_id, index_id); 234 database_backend_->DeleteIndex(transaction_id, object_store_id, index_id);
235 } 235 }
236 236
237 } // namespace WebKit 237 } // namespace WebKit
OLDNEW
« no previous file with comments | « content/browser/indexed_db/webidbdatabase_impl.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698