| OLD | NEW | 
|     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/indexed_db_database.h" |     5 #include "content/browser/indexed_db/indexed_db_database.h" | 
|     6  |     6  | 
|     7 #include <math.h> |     7 #include <math.h> | 
|     8 #include <limits> |     8 #include <limits> | 
|     9 #include <set> |     9 #include <set> | 
|    10  |    10  | 
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   545   IDB_TRACE1("IndexedDBDatabase::GetAll", "txn.id", transaction_id); |   545   IDB_TRACE1("IndexedDBDatabase::GetAll", "txn.id", transaction_id); | 
|   546   IndexedDBTransaction* transaction = GetTransaction(transaction_id); |   546   IndexedDBTransaction* transaction = GetTransaction(transaction_id); | 
|   547   if (!transaction) |   547   if (!transaction) | 
|   548     return; |   548     return; | 
|   549  |   549  | 
|   550   if (!ValidateObjectStoreId(object_store_id)) |   550   if (!ValidateObjectStoreId(object_store_id)) | 
|   551     return; |   551     return; | 
|   552  |   552  | 
|   553   transaction->ScheduleTask(base::Bind( |   553   transaction->ScheduleTask(base::Bind( | 
|   554       &IndexedDBDatabase::GetAllOperation, this, object_store_id, index_id, |   554       &IndexedDBDatabase::GetAllOperation, this, object_store_id, index_id, | 
|   555       Passed(&key_range), |   555       base::Passed(&key_range), | 
|   556       key_only ? indexed_db::CURSOR_KEY_ONLY : indexed_db::CURSOR_KEY_AND_VALUE, |   556       key_only ? indexed_db::CURSOR_KEY_ONLY : indexed_db::CURSOR_KEY_AND_VALUE, | 
|   557       max_count, callbacks)); |   557       max_count, callbacks)); | 
|   558 } |   558 } | 
|   559  |   559  | 
|   560 void IndexedDBDatabase::Get(int64 transaction_id, |   560 void IndexedDBDatabase::Get(int64 transaction_id, | 
|   561                             int64 object_store_id, |   561                             int64 object_store_id, | 
|   562                             int64 index_id, |   562                             int64 index_id, | 
|   563                             scoped_ptr<IndexedDBKeyRange> key_range, |   563                             scoped_ptr<IndexedDBKeyRange> key_range, | 
|   564                             bool key_only, |   564                             bool key_only, | 
|   565                             scoped_refptr<IndexedDBCallbacks> callbacks) { |   565                             scoped_refptr<IndexedDBCallbacks> callbacks) { | 
|   566   IDB_TRACE1("IndexedDBDatabase::Get", "txn.id", transaction_id); |   566   IDB_TRACE1("IndexedDBDatabase::Get", "txn.id", transaction_id); | 
|   567   IndexedDBTransaction* transaction = GetTransaction(transaction_id); |   567   IndexedDBTransaction* transaction = GetTransaction(transaction_id); | 
|   568   if (!transaction) |   568   if (!transaction) | 
|   569     return; |   569     return; | 
|   570  |   570  | 
|   571   if (!ValidateObjectStoreIdAndOptionalIndexId(object_store_id, index_id)) |   571   if (!ValidateObjectStoreIdAndOptionalIndexId(object_store_id, index_id)) | 
|   572     return; |   572     return; | 
|   573  |   573  | 
|   574   transaction->ScheduleTask(base::Bind( |   574   transaction->ScheduleTask(base::Bind( | 
|   575       &IndexedDBDatabase::GetOperation, |   575       &IndexedDBDatabase::GetOperation, this, object_store_id, index_id, | 
|   576       this, |   576       base::Passed(&key_range), | 
|   577       object_store_id, |  | 
|   578       index_id, |  | 
|   579       Passed(&key_range), |  | 
|   580       key_only ? indexed_db::CURSOR_KEY_ONLY : indexed_db::CURSOR_KEY_AND_VALUE, |   577       key_only ? indexed_db::CURSOR_KEY_ONLY : indexed_db::CURSOR_KEY_AND_VALUE, | 
|   581       callbacks)); |   578       callbacks)); | 
|   582 } |   579 } | 
|   583  |   580  | 
|   584 void IndexedDBDatabase::GetOperation( |   581 void IndexedDBDatabase::GetOperation( | 
|   585     int64 object_store_id, |   582     int64 object_store_id, | 
|   586     int64 index_id, |   583     int64 index_id, | 
|   587     scoped_ptr<IndexedDBKeyRange> key_range, |   584     scoped_ptr<IndexedDBKeyRange> key_range, | 
|   588     indexed_db::CursorType cursor_type, |   585     indexed_db::CursorType cursor_type, | 
|   589     scoped_refptr<IndexedDBCallbacks> callbacks, |   586     scoped_refptr<IndexedDBCallbacks> callbacks, | 
| (...skipping 1380 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1970     const base::string16& previous_version, |  1967     const base::string16& previous_version, | 
|  1971     int64 previous_int_version, |  1968     int64 previous_int_version, | 
|  1972     IndexedDBTransaction* transaction) { |  1969     IndexedDBTransaction* transaction) { | 
|  1973   DCHECK(!transaction); |  1970   DCHECK(!transaction); | 
|  1974   IDB_TRACE("IndexedDBDatabase::VersionChangeAbortOperation"); |  1971   IDB_TRACE("IndexedDBDatabase::VersionChangeAbortOperation"); | 
|  1975   metadata_.version = previous_version; |  1972   metadata_.version = previous_version; | 
|  1976   metadata_.int_version = previous_int_version; |  1973   metadata_.int_version = previous_int_version; | 
|  1977 } |  1974 } | 
|  1978  |  1975  | 
|  1979 }  // namespace content |  1976 }  // namespace content | 
| OLD | NEW |