| 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 <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "content/browser/indexed_db/indexed_db_factory.h" | 21 #include "content/browser/indexed_db/indexed_db_factory.h" |
| 22 #include "content/browser/indexed_db/indexed_db_index_writer.h" | 22 #include "content/browser/indexed_db/indexed_db_index_writer.h" |
| 23 #include "content/browser/indexed_db/indexed_db_pending_connection.h" | 23 #include "content/browser/indexed_db/indexed_db_pending_connection.h" |
| 24 #include "content/browser/indexed_db/indexed_db_tracing.h" | 24 #include "content/browser/indexed_db/indexed_db_tracing.h" |
| 25 #include "content/browser/indexed_db/indexed_db_transaction.h" | 25 #include "content/browser/indexed_db/indexed_db_transaction.h" |
| 26 #include "content/browser/indexed_db/indexed_db_value.h" | 26 #include "content/browser/indexed_db/indexed_db_value.h" |
| 27 #include "content/common/indexed_db/indexed_db_key_path.h" | 27 #include "content/common/indexed_db/indexed_db_key_path.h" |
| 28 #include "content/common/indexed_db/indexed_db_key_range.h" | 28 #include "content/common/indexed_db/indexed_db_key_range.h" |
| 29 #include "third_party/WebKit/public/platform/WebIDBDatabaseException.h" | 29 #include "third_party/WebKit/public/platform/WebIDBDatabaseException.h" |
| 30 #include "third_party/leveldatabase/env_chromium.h" | 30 #include "third_party/leveldatabase/env_chromium.h" |
| 31 #include "webkit/browser/blob/blob_data_handle.h" | 31 #include "storage/browser/blob/blob_data_handle.h" |
| 32 | 32 |
| 33 using base::ASCIIToUTF16; | 33 using base::ASCIIToUTF16; |
| 34 using base::Int64ToString16; | 34 using base::Int64ToString16; |
| 35 using blink::WebIDBKeyTypeNumber; | 35 using blink::WebIDBKeyTypeNumber; |
| 36 | 36 |
| 37 namespace content { | 37 namespace content { |
| 38 | 38 |
| 39 // PendingUpgradeCall has a scoped_ptr<IndexedDBConnection> because it owns the | 39 // PendingUpgradeCall has a scoped_ptr<IndexedDBConnection> because it owns the |
| 40 // in-progress connection. | 40 // in-progress connection. |
| 41 class IndexedDBDatabase::PendingUpgradeCall { | 41 class IndexedDBDatabase::PendingUpgradeCall { |
| (...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 database_id, | 711 database_id, |
| 712 object_store_id, | 712 object_store_id, |
| 713 static_cast<int64>(floor(key.number())) + 1, | 713 static_cast<int64>(floor(key.number())) + 1, |
| 714 check_current); | 714 check_current); |
| 715 } | 715 } |
| 716 | 716 |
| 717 struct IndexedDBDatabase::PutOperationParams { | 717 struct IndexedDBDatabase::PutOperationParams { |
| 718 PutOperationParams() {} | 718 PutOperationParams() {} |
| 719 int64 object_store_id; | 719 int64 object_store_id; |
| 720 IndexedDBValue value; | 720 IndexedDBValue value; |
| 721 ScopedVector<webkit_blob::BlobDataHandle> handles; | 721 ScopedVector<storage::BlobDataHandle> handles; |
| 722 scoped_ptr<IndexedDBKey> key; | 722 scoped_ptr<IndexedDBKey> key; |
| 723 blink::WebIDBPutMode put_mode; | 723 blink::WebIDBPutMode put_mode; |
| 724 scoped_refptr<IndexedDBCallbacks> callbacks; | 724 scoped_refptr<IndexedDBCallbacks> callbacks; |
| 725 std::vector<IndexKeys> index_keys; | 725 std::vector<IndexKeys> index_keys; |
| 726 | 726 |
| 727 private: | 727 private: |
| 728 DISALLOW_COPY_AND_ASSIGN(PutOperationParams); | 728 DISALLOW_COPY_AND_ASSIGN(PutOperationParams); |
| 729 }; | 729 }; |
| 730 | 730 |
| 731 void IndexedDBDatabase::Put(int64 transaction_id, | 731 void IndexedDBDatabase::Put(int64 transaction_id, |
| 732 int64 object_store_id, | 732 int64 object_store_id, |
| 733 IndexedDBValue* value, | 733 IndexedDBValue* value, |
| 734 ScopedVector<webkit_blob::BlobDataHandle>* handles, | 734 ScopedVector<storage::BlobDataHandle>* handles, |
| 735 scoped_ptr<IndexedDBKey> key, | 735 scoped_ptr<IndexedDBKey> key, |
| 736 blink::WebIDBPutMode put_mode, | 736 blink::WebIDBPutMode put_mode, |
| 737 scoped_refptr<IndexedDBCallbacks> callbacks, | 737 scoped_refptr<IndexedDBCallbacks> callbacks, |
| 738 const std::vector<IndexKeys>& index_keys) { | 738 const std::vector<IndexKeys>& index_keys) { |
| 739 IDB_TRACE1("IndexedDBDatabase::Put", "txn.id", transaction_id); | 739 IDB_TRACE1("IndexedDBDatabase::Put", "txn.id", transaction_id); |
| 740 IndexedDBTransaction* transaction = GetTransaction(transaction_id); | 740 IndexedDBTransaction* transaction = GetTransaction(transaction_id); |
| 741 if (!transaction) | 741 if (!transaction) |
| 742 return; | 742 return; |
| 743 DCHECK_NE(transaction->mode(), blink::WebIDBTransactionModeReadOnly); | 743 DCHECK_NE(transaction->mode(), blink::WebIDBTransactionModeReadOnly); |
| 744 | 744 |
| (...skipping 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1781 IndexedDBTransaction* transaction) { | 1781 IndexedDBTransaction* transaction) { |
| 1782 DCHECK(!transaction); | 1782 DCHECK(!transaction); |
| 1783 IDB_TRACE1("IndexedDBDatabase::VersionChangeAbortOperation", | 1783 IDB_TRACE1("IndexedDBDatabase::VersionChangeAbortOperation", |
| 1784 "txn.id", | 1784 "txn.id", |
| 1785 transaction->id()); | 1785 transaction->id()); |
| 1786 metadata_.version = previous_version; | 1786 metadata_.version = previous_version; |
| 1787 metadata_.int_version = previous_int_version; | 1787 metadata_.int_version = previous_int_version; |
| 1788 } | 1788 } |
| 1789 | 1789 |
| 1790 } // namespace content | 1790 } // namespace content |
| OLD | NEW |