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_backing_store.h" | 5 #include "content/browser/indexed_db/indexed_db_backing_store.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 1488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1499 return false; | 1499 return false; |
1500 if (meta_data_key.MetaDataType() != meta_data_type) | 1500 if (meta_data_key.MetaDataType() != meta_data_type) |
1501 return false; | 1501 return false; |
1502 return ok; | 1502 return ok; |
1503 } | 1503 } |
1504 | 1504 |
1505 // TODO(jsbell): This should do some error handling rather than | 1505 // TODO(jsbell): This should do some error handling rather than |
1506 // plowing ahead when bad data is encountered. | 1506 // plowing ahead when bad data is encountered. |
1507 leveldb::Status IndexedDBBackingStore::GetObjectStores( | 1507 leveldb::Status IndexedDBBackingStore::GetObjectStores( |
1508 int64_t database_id, | 1508 int64_t database_id, |
1509 IndexedDBDatabaseMetadata::ObjectStoreMap* object_stores) { | 1509 std::map<int64_t, IndexedDBObjectStoreMetadata>* object_stores) { |
1510 IDB_TRACE("IndexedDBBackingStore::GetObjectStores"); | 1510 IDB_TRACE("IndexedDBBackingStore::GetObjectStores"); |
1511 if (!KeyPrefix::IsValidDatabaseId(database_id)) | 1511 if (!KeyPrefix::IsValidDatabaseId(database_id)) |
1512 return InvalidDBKeyStatus(); | 1512 return InvalidDBKeyStatus(); |
1513 const std::string start_key = | 1513 const std::string start_key = |
1514 ObjectStoreMetaDataKey::Encode(database_id, 1, 0); | 1514 ObjectStoreMetaDataKey::Encode(database_id, 1, 0); |
1515 const std::string stop_key = | 1515 const std::string stop_key = |
1516 ObjectStoreMetaDataKey::EncodeMaxKey(database_id); | 1516 ObjectStoreMetaDataKey::EncodeMaxKey(database_id); |
1517 | 1517 |
1518 DCHECK(object_stores->empty()); | 1518 DCHECK(object_stores->empty()); |
1519 | 1519 |
(...skipping 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2551 if (meta_data_key.meta_data_type() != meta_data_type) | 2551 if (meta_data_key.meta_data_type() != meta_data_type) |
2552 return false; | 2552 return false; |
2553 return true; | 2553 return true; |
2554 } | 2554 } |
2555 | 2555 |
2556 // TODO(jsbell): This should do some error handling rather than plowing ahead | 2556 // TODO(jsbell): This should do some error handling rather than plowing ahead |
2557 // when bad data is encountered. | 2557 // when bad data is encountered. |
2558 leveldb::Status IndexedDBBackingStore::GetIndexes( | 2558 leveldb::Status IndexedDBBackingStore::GetIndexes( |
2559 int64_t database_id, | 2559 int64_t database_id, |
2560 int64_t object_store_id, | 2560 int64_t object_store_id, |
2561 IndexedDBObjectStoreMetadata::IndexMap* indexes) { | 2561 std::map<int64_t, IndexedDBIndexMetadata>* indexes) { |
2562 IDB_TRACE("IndexedDBBackingStore::GetIndexes"); | 2562 IDB_TRACE("IndexedDBBackingStore::GetIndexes"); |
2563 if (!KeyPrefix::ValidIds(database_id, object_store_id)) | 2563 if (!KeyPrefix::ValidIds(database_id, object_store_id)) |
2564 return InvalidDBKeyStatus(); | 2564 return InvalidDBKeyStatus(); |
2565 const std::string start_key = | 2565 const std::string start_key = |
2566 IndexMetaDataKey::Encode(database_id, object_store_id, 0, 0); | 2566 IndexMetaDataKey::Encode(database_id, object_store_id, 0, 0); |
2567 const std::string stop_key = | 2567 const std::string stop_key = |
2568 IndexMetaDataKey::Encode(database_id, object_store_id + 1, 0, 0); | 2568 IndexMetaDataKey::Encode(database_id, object_store_id + 1, 0, 0); |
2569 | 2569 |
2570 DCHECK(indexes->empty()); | 2570 DCHECK(indexes->empty()); |
2571 | 2571 |
(...skipping 1901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4473 | 4473 |
4474 IndexedDBBackingStore::Transaction::WriteDescriptor::WriteDescriptor( | 4474 IndexedDBBackingStore::Transaction::WriteDescriptor::WriteDescriptor( |
4475 const WriteDescriptor& other) = default; | 4475 const WriteDescriptor& other) = default; |
4476 IndexedDBBackingStore::Transaction::WriteDescriptor::~WriteDescriptor() = | 4476 IndexedDBBackingStore::Transaction::WriteDescriptor::~WriteDescriptor() = |
4477 default; | 4477 default; |
4478 IndexedDBBackingStore::Transaction::WriteDescriptor& | 4478 IndexedDBBackingStore::Transaction::WriteDescriptor& |
4479 IndexedDBBackingStore::Transaction::WriteDescriptor:: | 4479 IndexedDBBackingStore::Transaction::WriteDescriptor:: |
4480 operator=(const WriteDescriptor& other) = default; | 4480 operator=(const WriteDescriptor& other) = default; |
4481 | 4481 |
4482 } // namespace content | 4482 } // namespace content |
OLD | NEW |