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" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
16 #include "content/browser/indexed_db/indexed_db_connection.h" | 16 #include "content/browser/indexed_db/indexed_db_connection.h" |
17 #include "content/browser/indexed_db/indexed_db_context_impl.h" | |
18 #include "content/browser/indexed_db/indexed_db_cursor.h" | 17 #include "content/browser/indexed_db/indexed_db_cursor.h" |
19 #include "content/browser/indexed_db/indexed_db_factory.h" | 18 #include "content/browser/indexed_db/indexed_db_factory.h" |
20 #include "content/browser/indexed_db/indexed_db_index_writer.h" | 19 #include "content/browser/indexed_db/indexed_db_index_writer.h" |
21 #include "content/browser/indexed_db/indexed_db_pending_connection.h" | 20 #include "content/browser/indexed_db/indexed_db_pending_connection.h" |
22 #include "content/browser/indexed_db/indexed_db_tracing.h" | 21 #include "content/browser/indexed_db/indexed_db_tracing.h" |
23 #include "content/browser/indexed_db/indexed_db_transaction.h" | 22 #include "content/browser/indexed_db/indexed_db_transaction.h" |
24 #include "content/browser/indexed_db/indexed_db_value.h" | 23 #include "content/browser/indexed_db/indexed_db_value.h" |
25 #include "content/common/indexed_db/indexed_db_key_path.h" | 24 #include "content/common/indexed_db/indexed_db_key_path.h" |
26 #include "content/common/indexed_db/indexed_db_key_range.h" | 25 #include "content/common/indexed_db/indexed_db_key_range.h" |
27 #include "third_party/WebKit/public/platform/WebIDBDatabaseException.h" | 26 #include "third_party/WebKit/public/platform/WebIDBDatabaseException.h" |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 this, | 287 this, |
289 object_store_id)); | 288 object_store_id)); |
290 | 289 |
291 AddObjectStore(object_store_metadata, object_store_id); | 290 AddObjectStore(object_store_metadata, object_store_id); |
292 } | 291 } |
293 | 292 |
294 void IndexedDBDatabase::CreateObjectStoreOperation( | 293 void IndexedDBDatabase::CreateObjectStoreOperation( |
295 const IndexedDBObjectStoreMetadata& object_store_metadata, | 294 const IndexedDBObjectStoreMetadata& object_store_metadata, |
296 IndexedDBTransaction* transaction) { | 295 IndexedDBTransaction* transaction) { |
297 IDB_TRACE("IndexedDBDatabase::CreateObjectStoreOperation"); | 296 IDB_TRACE("IndexedDBDatabase::CreateObjectStoreOperation"); |
298 leveldb::Status s = | 297 if (!backing_store_->CreateObjectStore( |
299 backing_store_->CreateObjectStore(transaction->BackingStoreTransaction(), | 298 transaction->BackingStoreTransaction(), |
300 transaction->database()->id(), | 299 transaction->database()->id(), |
301 object_store_metadata.id, | 300 object_store_metadata.id, |
302 object_store_metadata.name, | 301 object_store_metadata.name, |
303 object_store_metadata.key_path, | 302 object_store_metadata.key_path, |
304 object_store_metadata.auto_increment); | 303 object_store_metadata.auto_increment).ok()) { |
305 if (!s.ok()) { | 304 transaction->Abort(IndexedDBDatabaseError( |
306 IndexedDBDatabaseError error( | |
307 blink::WebIDBDatabaseExceptionUnknownError, | 305 blink::WebIDBDatabaseExceptionUnknownError, |
308 ASCIIToUTF16("Internal error creating object store '") + | 306 ASCIIToUTF16("Internal error creating object store '") + |
309 object_store_metadata.name + ASCIIToUTF16("'.")); | 307 object_store_metadata.name + ASCIIToUTF16("'."))); |
310 transaction->Abort(error); | |
311 if (s.IsCorruption()) | |
312 factory_->HandleBackingStoreCorruption(backing_store_->origin_url(), | |
313 error); | |
314 return; | 308 return; |
315 } | 309 } |
316 } | 310 } |
317 | 311 |
318 void IndexedDBDatabase::DeleteObjectStore(int64 transaction_id, | 312 void IndexedDBDatabase::DeleteObjectStore(int64 transaction_id, |
319 int64 object_store_id) { | 313 int64 object_store_id) { |
320 IDB_TRACE("IndexedDBDatabase::DeleteObjectStore"); | 314 IDB_TRACE("IndexedDBDatabase::DeleteObjectStore"); |
321 IndexedDBTransaction* transaction = GetTransaction(transaction_id); | 315 IndexedDBTransaction* transaction = GetTransaction(transaction_id); |
322 if (!transaction) | 316 if (!transaction) |
323 return; | 317 return; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 IDB_TRACE("IndexedDBDatabase::DeleteIndexOperation"); | 429 IDB_TRACE("IndexedDBDatabase::DeleteIndexOperation"); |
436 leveldb::Status s = | 430 leveldb::Status s = |
437 backing_store_->DeleteIndex(transaction->BackingStoreTransaction(), | 431 backing_store_->DeleteIndex(transaction->BackingStoreTransaction(), |
438 transaction->database()->id(), | 432 transaction->database()->id(), |
439 object_store_id, | 433 object_store_id, |
440 index_metadata.id); | 434 index_metadata.id); |
441 if (!s.ok()) { | 435 if (!s.ok()) { |
442 base::string16 error_string = | 436 base::string16 error_string = |
443 ASCIIToUTF16("Internal error deleting index '") + | 437 ASCIIToUTF16("Internal error deleting index '") + |
444 index_metadata.name + ASCIIToUTF16("'."); | 438 index_metadata.name + ASCIIToUTF16("'."); |
445 IndexedDBDatabaseError error(blink::WebIDBDatabaseExceptionUnknownError, | 439 transaction->Abort(IndexedDBDatabaseError( |
446 error_string); | 440 blink::WebIDBDatabaseExceptionUnknownError, error_string)); |
447 transaction->Abort(error); | |
448 if (s.IsCorruption()) | |
449 factory_->HandleBackingStoreCorruption(backing_store_->origin_url(), | |
450 error); | |
451 } | 441 } |
452 } | 442 } |
453 | 443 |
454 void IndexedDBDatabase::DeleteIndexAbortOperation( | 444 void IndexedDBDatabase::DeleteIndexAbortOperation( |
455 int64 object_store_id, | 445 int64 object_store_id, |
456 const IndexedDBIndexMetadata& index_metadata, | 446 const IndexedDBIndexMetadata& index_metadata, |
457 IndexedDBTransaction* transaction) { | 447 IndexedDBTransaction* transaction) { |
458 IDB_TRACE("IndexedDBDatabase::DeleteIndexAbortOperation"); | 448 IDB_TRACE("IndexedDBDatabase::DeleteIndexAbortOperation"); |
459 DCHECK(!transaction); | 449 DCHECK(!transaction); |
460 AddIndex(object_store_id, index_metadata, IndexedDBIndexMetadata::kInvalidId); | 450 AddIndex(object_store_id, index_metadata, IndexedDBIndexMetadata::kInvalidId); |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 leveldb::Status s; | 562 leveldb::Status s; |
573 if (index_id == IndexedDBIndexMetadata::kInvalidId) { | 563 if (index_id == IndexedDBIndexMetadata::kInvalidId) { |
574 // Object Store Retrieval Operation | 564 // Object Store Retrieval Operation |
575 IndexedDBValue value; | 565 IndexedDBValue value; |
576 s = backing_store_->GetRecord(transaction->BackingStoreTransaction(), | 566 s = backing_store_->GetRecord(transaction->BackingStoreTransaction(), |
577 id(), | 567 id(), |
578 object_store_id, | 568 object_store_id, |
579 *key, | 569 *key, |
580 &value); | 570 &value); |
581 if (!s.ok()) { | 571 if (!s.ok()) { |
582 IndexedDBDatabaseError error(blink::WebIDBDatabaseExceptionUnknownError, | 572 callbacks->OnError( |
583 "Internal error in GetRecord."); | 573 IndexedDBDatabaseError(blink::WebIDBDatabaseExceptionUnknownError, |
584 callbacks->OnError(error); | 574 "Internal error in GetRecord.")); |
585 | |
586 if (s.IsCorruption()) | |
587 factory_->HandleBackingStoreCorruption(backing_store_->origin_url(), | |
588 error); | |
589 return; | 575 return; |
590 } | 576 } |
591 | 577 |
592 if (value.empty()) { | 578 if (value.empty()) { |
593 callbacks->OnSuccess(); | 579 callbacks->OnSuccess(); |
594 return; | 580 return; |
595 } | 581 } |
596 | 582 |
597 if (object_store_metadata.auto_increment && | 583 if (object_store_metadata.auto_increment && |
598 !object_store_metadata.key_path.IsNull()) { | 584 !object_store_metadata.key_path.IsNull()) { |
599 callbacks->OnSuccess(&value, *key, object_store_metadata.key_path); | 585 callbacks->OnSuccess(&value, *key, object_store_metadata.key_path); |
600 return; | 586 return; |
601 } | 587 } |
602 | 588 |
603 callbacks->OnSuccess(&value); | 589 callbacks->OnSuccess(&value); |
604 return; | 590 return; |
605 } | 591 } |
606 | 592 |
607 // From here we are dealing only with indexes. | 593 // From here we are dealing only with indexes. |
608 s = backing_store_->GetPrimaryKeyViaIndex( | 594 s = backing_store_->GetPrimaryKeyViaIndex( |
609 transaction->BackingStoreTransaction(), | 595 transaction->BackingStoreTransaction(), |
610 id(), | 596 id(), |
611 object_store_id, | 597 object_store_id, |
612 index_id, | 598 index_id, |
613 *key, | 599 *key, |
614 &primary_key); | 600 &primary_key); |
615 if (!s.ok()) { | 601 if (!s.ok()) { |
616 IndexedDBDatabaseError error(blink::WebIDBDatabaseExceptionUnknownError, | 602 callbacks->OnError( |
617 "Internal error in GetPrimaryKeyViaIndex."); | 603 IndexedDBDatabaseError(blink::WebIDBDatabaseExceptionUnknownError, |
618 callbacks->OnError(error); | 604 "Internal error in GetPrimaryKeyViaIndex.")); |
619 if (s.IsCorruption()) | |
620 factory_->HandleBackingStoreCorruption(backing_store_->origin_url(), | |
621 error); | |
622 return; | 605 return; |
623 } | 606 } |
624 if (!primary_key) { | 607 if (!primary_key) { |
625 callbacks->OnSuccess(); | 608 callbacks->OnSuccess(); |
626 return; | 609 return; |
627 } | 610 } |
628 if (cursor_type == indexed_db::CURSOR_KEY_ONLY) { | 611 if (cursor_type == indexed_db::CURSOR_KEY_ONLY) { |
629 // Index Value Retrieval Operation | 612 // Index Value Retrieval Operation |
630 callbacks->OnSuccess(*primary_key); | 613 callbacks->OnSuccess(*primary_key); |
631 return; | 614 return; |
632 } | 615 } |
633 | 616 |
634 // Index Referenced Value Retrieval Operation | 617 // Index Referenced Value Retrieval Operation |
635 IndexedDBValue value; | 618 IndexedDBValue value; |
636 s = backing_store_->GetRecord(transaction->BackingStoreTransaction(), | 619 s = backing_store_->GetRecord(transaction->BackingStoreTransaction(), |
637 id(), | 620 id(), |
638 object_store_id, | 621 object_store_id, |
639 *primary_key, | 622 *primary_key, |
640 &value); | 623 &value); |
641 if (!s.ok()) { | 624 if (!s.ok()) { |
642 IndexedDBDatabaseError error(blink::WebIDBDatabaseExceptionUnknownError, | 625 callbacks->OnError( |
643 "Internal error in GetRecord."); | 626 IndexedDBDatabaseError(blink::WebIDBDatabaseExceptionUnknownError, |
644 callbacks->OnError(error); | 627 "Internal error in GetRecord.")); |
645 if (s.IsCorruption()) | |
646 factory_->HandleBackingStoreCorruption(backing_store_->origin_url(), | |
647 error); | |
648 return; | 628 return; |
649 } | 629 } |
650 | 630 |
651 if (value.empty()) { | 631 if (value.empty()) { |
652 callbacks->OnSuccess(); | 632 callbacks->OnSuccess(); |
653 return; | 633 return; |
654 } | 634 } |
655 if (object_store_metadata.auto_increment && | 635 if (object_store_metadata.auto_increment && |
656 !object_store_metadata.key_path.IsNull()) { | 636 !object_store_metadata.key_path.IsNull()) { |
657 callbacks->OnSuccess(&value, *primary_key, object_store_metadata.key_path); | 637 callbacks->OnSuccess(&value, *primary_key, object_store_metadata.key_path); |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 if (params->put_mode == IndexedDBDatabase::ADD_ONLY) { | 754 if (params->put_mode == IndexedDBDatabase::ADD_ONLY) { |
775 bool found = false; | 755 bool found = false; |
776 leveldb::Status s = backing_store_->KeyExistsInObjectStore( | 756 leveldb::Status s = backing_store_->KeyExistsInObjectStore( |
777 transaction->BackingStoreTransaction(), | 757 transaction->BackingStoreTransaction(), |
778 id(), | 758 id(), |
779 params->object_store_id, | 759 params->object_store_id, |
780 *key, | 760 *key, |
781 &record_identifier, | 761 &record_identifier, |
782 &found); | 762 &found); |
783 if (!s.ok()) { | 763 if (!s.ok()) { |
784 IndexedDBDatabaseError error(blink::WebIDBDatabaseExceptionUnknownError, | 764 params->callbacks->OnError( |
785 "Internal error checking key existence."); | 765 IndexedDBDatabaseError(blink::WebIDBDatabaseExceptionUnknownError, |
786 params->callbacks->OnError(error); | 766 "Internal error checking key existence.")); |
787 if (s.IsCorruption()) | |
788 factory_->HandleBackingStoreCorruption(backing_store_->origin_url(), | |
789 error); | |
790 return; | 767 return; |
791 } | 768 } |
792 if (found) { | 769 if (found) { |
793 params->callbacks->OnError( | 770 params->callbacks->OnError( |
794 IndexedDBDatabaseError(blink::WebIDBDatabaseExceptionConstraintError, | 771 IndexedDBDatabaseError(blink::WebIDBDatabaseExceptionConstraintError, |
795 "Key already exists in the object store.")); | 772 "Key already exists in the object store.")); |
796 return; | 773 return; |
797 } | 774 } |
798 } | 775 } |
799 | 776 |
(...skipping 25 matching lines...) Expand all Loading... |
825 // Before this point, don't do any mutation. After this point, rollback the | 802 // Before this point, don't do any mutation. After this point, rollback the |
826 // transaction in case of error. | 803 // transaction in case of error. |
827 leveldb::Status s = | 804 leveldb::Status s = |
828 backing_store_->PutRecord(transaction->BackingStoreTransaction(), | 805 backing_store_->PutRecord(transaction->BackingStoreTransaction(), |
829 id(), | 806 id(), |
830 params->object_store_id, | 807 params->object_store_id, |
831 *key, | 808 *key, |
832 params->value, | 809 params->value, |
833 &record_identifier); | 810 &record_identifier); |
834 if (!s.ok()) { | 811 if (!s.ok()) { |
835 IndexedDBDatabaseError error( | 812 params->callbacks->OnError(IndexedDBDatabaseError( |
836 blink::WebIDBDatabaseExceptionUnknownError, | 813 blink::WebIDBDatabaseExceptionUnknownError, |
837 "Internal error: backing store error performing put/add."); | 814 "Internal error: backing store error performing put/add.")); |
838 params->callbacks->OnError(error); | |
839 if (s.IsCorruption()) | |
840 factory_->HandleBackingStoreCorruption(backing_store_->origin_url(), | |
841 error); | |
842 return; | 815 return; |
843 } | 816 } |
844 | 817 |
845 for (size_t i = 0; i < index_writers.size(); ++i) { | 818 for (size_t i = 0; i < index_writers.size(); ++i) { |
846 IndexWriter* index_writer = index_writers[i]; | 819 IndexWriter* index_writer = index_writers[i]; |
847 index_writer->WriteIndexKeys(record_identifier, | 820 index_writer->WriteIndexKeys(record_identifier, |
848 backing_store_.get(), | 821 backing_store_.get(), |
849 transaction->BackingStoreTransaction(), | 822 transaction->BackingStoreTransaction(), |
850 id(), | 823 id(), |
851 params->object_store_id); | 824 params->object_store_id); |
852 } | 825 } |
853 | 826 |
854 if (object_store.auto_increment && | 827 if (object_store.auto_increment && |
855 params->put_mode != IndexedDBDatabase::CURSOR_UPDATE && | 828 params->put_mode != IndexedDBDatabase::CURSOR_UPDATE && |
856 key->type() == WebIDBKeyTypeNumber) { | 829 key->type() == WebIDBKeyTypeNumber) { |
857 leveldb::Status s = UpdateKeyGenerator(backing_store_.get(), | 830 leveldb::Status s = UpdateKeyGenerator(backing_store_.get(), |
858 transaction, | 831 transaction, |
859 id(), | 832 id(), |
860 params->object_store_id, | 833 params->object_store_id, |
861 *key, | 834 *key, |
862 !key_was_generated); | 835 !key_was_generated); |
863 if (!s.ok()) { | 836 if (!s.ok()) { |
864 IndexedDBDatabaseError error(blink::WebIDBDatabaseExceptionUnknownError, | 837 params->callbacks->OnError( |
865 "Internal error updating key generator."); | 838 IndexedDBDatabaseError(blink::WebIDBDatabaseExceptionUnknownError, |
866 params->callbacks->OnError(error); | 839 "Internal error updating key generator.")); |
867 if (s.IsCorruption()) | |
868 factory_->HandleBackingStoreCorruption(backing_store_->origin_url(), | |
869 error); | |
870 return; | 840 return; |
871 } | 841 } |
872 } | 842 } |
873 | 843 |
874 params->callbacks->OnSuccess(*key); | 844 params->callbacks->OnSuccess(*key); |
875 } | 845 } |
876 | 846 |
877 void IndexedDBDatabase::SetIndexKeys(int64 transaction_id, | 847 void IndexedDBDatabase::SetIndexKeys(int64 transaction_id, |
878 int64 object_store_id, | 848 int64 object_store_id, |
879 scoped_ptr<IndexedDBKey> primary_key, | 849 scoped_ptr<IndexedDBKey> primary_key, |
880 const std::vector<IndexKeys>& index_keys) { | 850 const std::vector<IndexKeys>& index_keys) { |
881 IDB_TRACE("IndexedDBDatabase::SetIndexKeys"); | 851 IDB_TRACE("IndexedDBDatabase::SetIndexKeys"); |
882 IndexedDBTransaction* transaction = GetTransaction(transaction_id); | 852 IndexedDBTransaction* transaction = GetTransaction(transaction_id); |
883 if (!transaction) | 853 if (!transaction) |
884 return; | 854 return; |
885 DCHECK_EQ(transaction->mode(), indexed_db::TRANSACTION_VERSION_CHANGE); | 855 DCHECK_EQ(transaction->mode(), indexed_db::TRANSACTION_VERSION_CHANGE); |
886 | 856 |
887 // TODO(alecflett): This method could be asynchronous, but we need to | 857 // TODO(alecflett): This method could be asynchronous, but we need to |
888 // evaluate if it's worth the extra complexity. | 858 // evaluate if it's worth the extra complexity. |
889 IndexedDBBackingStore::RecordIdentifier record_identifier; | 859 IndexedDBBackingStore::RecordIdentifier record_identifier; |
890 bool found = false; | 860 bool found = false; |
891 leveldb::Status s = backing_store_->KeyExistsInObjectStore( | 861 leveldb::Status s = backing_store_->KeyExistsInObjectStore( |
892 transaction->BackingStoreTransaction(), | 862 transaction->BackingStoreTransaction(), |
893 metadata_.id, | 863 metadata_.id, |
894 object_store_id, | 864 object_store_id, |
895 *primary_key, | 865 *primary_key, |
896 &record_identifier, | 866 &record_identifier, |
897 &found); | 867 &found); |
898 if (!s.ok()) { | 868 if (!s.ok()) { |
899 IndexedDBDatabaseError error(blink::WebIDBDatabaseExceptionUnknownError, | 869 transaction->Abort( |
900 "Internal error setting index keys."); | 870 IndexedDBDatabaseError(blink::WebIDBDatabaseExceptionUnknownError, |
901 transaction->Abort(error); | 871 "Internal error setting index keys.")); |
902 if (s.IsCorruption()) | |
903 factory_->HandleBackingStoreCorruption(backing_store_->origin_url(), | |
904 error); | |
905 return; | 872 return; |
906 } | 873 } |
907 if (!found) { | 874 if (!found) { |
908 transaction->Abort(IndexedDBDatabaseError( | 875 transaction->Abort(IndexedDBDatabaseError( |
909 blink::WebIDBDatabaseExceptionUnknownError, | 876 blink::WebIDBDatabaseExceptionUnknownError, |
910 "Internal error setting index keys for object store.")); | 877 "Internal error setting index keys for object store.")); |
911 return; | 878 return; |
912 } | 879 } |
913 | 880 |
914 ScopedVector<IndexWriter> index_writers; | 881 ScopedVector<IndexWriter> index_writers; |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1232 IndexedDBTransaction* transaction) { | 1199 IndexedDBTransaction* transaction) { |
1233 IDB_TRACE("IndexedDBDatabase::DeleteObjectStoreOperation"); | 1200 IDB_TRACE("IndexedDBDatabase::DeleteObjectStoreOperation"); |
1234 leveldb::Status s = | 1201 leveldb::Status s = |
1235 backing_store_->DeleteObjectStore(transaction->BackingStoreTransaction(), | 1202 backing_store_->DeleteObjectStore(transaction->BackingStoreTransaction(), |
1236 transaction->database()->id(), | 1203 transaction->database()->id(), |
1237 object_store_metadata.id); | 1204 object_store_metadata.id); |
1238 if (!s.ok()) { | 1205 if (!s.ok()) { |
1239 base::string16 error_string = | 1206 base::string16 error_string = |
1240 ASCIIToUTF16("Internal error deleting object store '") + | 1207 ASCIIToUTF16("Internal error deleting object store '") + |
1241 object_store_metadata.name + ASCIIToUTF16("'."); | 1208 object_store_metadata.name + ASCIIToUTF16("'."); |
1242 IndexedDBDatabaseError error(blink::WebIDBDatabaseExceptionUnknownError, | 1209 transaction->Abort(IndexedDBDatabaseError( |
1243 error_string); | 1210 blink::WebIDBDatabaseExceptionUnknownError, error_string)); |
1244 transaction->Abort(error); | |
1245 if (s.IsCorruption()) | |
1246 factory_->HandleBackingStoreCorruption(backing_store_->origin_url(), | |
1247 error); | |
1248 } | 1211 } |
1249 } | 1212 } |
1250 | 1213 |
1251 void IndexedDBDatabase::VersionChangeOperation( | 1214 void IndexedDBDatabase::VersionChangeOperation( |
1252 int64 version, | 1215 int64 version, |
1253 scoped_refptr<IndexedDBCallbacks> callbacks, | 1216 scoped_refptr<IndexedDBCallbacks> callbacks, |
1254 scoped_ptr<IndexedDBConnection> connection, | 1217 scoped_ptr<IndexedDBConnection> connection, |
1255 IndexedDBTransaction* transaction) { | 1218 IndexedDBTransaction* transaction) { |
1256 IDB_TRACE("IndexedDBDatabase::VersionChangeOperation"); | 1219 IDB_TRACE("IndexedDBDatabase::VersionChangeOperation"); |
1257 int64 old_version = metadata_.int_version; | 1220 int64 old_version = metadata_.int_version; |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1692 const base::string16& previous_version, | 1655 const base::string16& previous_version, |
1693 int64 previous_int_version, | 1656 int64 previous_int_version, |
1694 IndexedDBTransaction* transaction) { | 1657 IndexedDBTransaction* transaction) { |
1695 IDB_TRACE("IndexedDBDatabase::VersionChangeAbortOperation"); | 1658 IDB_TRACE("IndexedDBDatabase::VersionChangeAbortOperation"); |
1696 DCHECK(!transaction); | 1659 DCHECK(!transaction); |
1697 metadata_.version = previous_version; | 1660 metadata_.version = previous_version; |
1698 metadata_.int_version = previous_int_version; | 1661 metadata_.int_version = previous_int_version; |
1699 } | 1662 } |
1700 | 1663 |
1701 } // namespace content | 1664 } // namespace content |
OLD | NEW |