| 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 IndexedDBFactory* factory, | 132 IndexedDBFactory* factory, |
| 133 const Identifier& unique_identifier) | 133 const Identifier& unique_identifier) |
| 134 : backing_store_(backing_store), | 134 : backing_store_(backing_store), |
| 135 metadata_(name, | 135 metadata_(name, |
| 136 kInvalidId, | 136 kInvalidId, |
| 137 kNoStringVersion, | 137 kNoStringVersion, |
| 138 IndexedDBDatabaseMetadata::NO_INT_VERSION, | 138 IndexedDBDatabaseMetadata::NO_INT_VERSION, |
| 139 kInvalidId), | 139 kInvalidId), |
| 140 identifier_(unique_identifier), | 140 identifier_(unique_identifier), |
| 141 factory_(factory) { | 141 factory_(factory) { |
| 142 DCHECK(!metadata_.name.empty()); | |
| 143 } | 142 } |
| 144 | 143 |
| 145 void IndexedDBDatabase::AddObjectStore( | 144 void IndexedDBDatabase::AddObjectStore( |
| 146 const IndexedDBObjectStoreMetadata& object_store, | 145 const IndexedDBObjectStoreMetadata& object_store, |
| 147 int64 new_max_object_store_id) { | 146 int64 new_max_object_store_id) { |
| 148 DCHECK(metadata_.object_stores.find(object_store.id) == | 147 DCHECK(metadata_.object_stores.find(object_store.id) == |
| 149 metadata_.object_stores.end()); | 148 metadata_.object_stores.end()); |
| 150 if (new_max_object_store_id != IndexedDBObjectStoreMetadata::kInvalidId) { | 149 if (new_max_object_store_id != IndexedDBObjectStoreMetadata::kInvalidId) { |
| 151 DCHECK_LT(metadata_.max_object_store_id, new_max_object_store_id); | 150 DCHECK_LT(metadata_.max_object_store_id, new_max_object_store_id); |
| 152 metadata_.max_object_store_id = new_max_object_store_id; | 151 metadata_.max_object_store_id = new_max_object_store_id; |
| (...skipping 1515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1668 const base::string16& previous_version, | 1667 const base::string16& previous_version, |
| 1669 int64 previous_int_version, | 1668 int64 previous_int_version, |
| 1670 IndexedDBTransaction* transaction) { | 1669 IndexedDBTransaction* transaction) { |
| 1671 IDB_TRACE("IndexedDBDatabase::VersionChangeAbortOperation"); | 1670 IDB_TRACE("IndexedDBDatabase::VersionChangeAbortOperation"); |
| 1672 DCHECK(!transaction); | 1671 DCHECK(!transaction); |
| 1673 metadata_.version = previous_version; | 1672 metadata_.version = previous_version; |
| 1674 metadata_.int_version = previous_int_version; | 1673 metadata_.int_version = previous_int_version; |
| 1675 } | 1674 } |
| 1676 | 1675 |
| 1677 } // namespace content | 1676 } // namespace content |
| OLD | NEW |