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_leveldb_coding.h" | 5 #include "content/browser/indexed_db/indexed_db_leveldb_coding.h" |
6 | 6 |
7 #include <iterator> | 7 #include <iterator> |
8 #include <limits> | 8 #include <limits> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 1536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1547 DCHECK_GE(object_store_id_, 0); | 1547 DCHECK_GE(object_store_id_, 0); |
1548 return object_store_id_; | 1548 return object_store_id_; |
1549 } | 1549 } |
1550 | 1550 |
1551 int64 IndexFreeListKey::IndexId() const { | 1551 int64 IndexFreeListKey::IndexId() const { |
1552 DCHECK_GE(index_id_, 0); | 1552 DCHECK_GE(index_id_, 0); |
1553 return index_id_; | 1553 return index_id_; |
1554 } | 1554 } |
1555 | 1555 |
1556 // TODO(jsbell): We never use this to look up object store ids, | 1556 // TODO(jsbell): We never use this to look up object store ids, |
1557 // because a mapping is kept in the IndexedDBDatabaseImpl. Can the | 1557 // because a mapping is kept in the IndexedDBDatabase. Can the |
1558 // mapping become unreliable? Can we remove this? | 1558 // mapping become unreliable? Can we remove this? |
1559 const char* ObjectStoreNamesKey::Decode(const char* start, | 1559 const char* ObjectStoreNamesKey::Decode(const char* start, |
1560 const char* limit, | 1560 const char* limit, |
1561 ObjectStoreNamesKey* result) { | 1561 ObjectStoreNamesKey* result) { |
1562 KeyPrefix prefix; | 1562 KeyPrefix prefix; |
1563 const char* p = KeyPrefix::Decode(start, limit, &prefix); | 1563 const char* p = KeyPrefix::Decode(start, limit, &prefix); |
1564 if (!p) | 1564 if (!p) |
1565 return 0; | 1565 return 0; |
1566 DCHECK(prefix.database_id_); | 1566 DCHECK(prefix.database_id_); |
1567 DCHECK(!prefix.object_store_id_); | 1567 DCHECK(!prefix.object_store_id_); |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1880 scoped_ptr<IndexedDBKey> IndexDataKey::primary_key() const { | 1880 scoped_ptr<IndexedDBKey> IndexDataKey::primary_key() const { |
1881 scoped_ptr<IndexedDBKey> key; | 1881 scoped_ptr<IndexedDBKey> key; |
1882 StringPiece slice(&encoded_primary_key_[0], encoded_primary_key_.size()); | 1882 StringPiece slice(&encoded_primary_key_[0], encoded_primary_key_.size()); |
1883 if (!DecodeIDBKey(&slice, &key)) { | 1883 if (!DecodeIDBKey(&slice, &key)) { |
1884 // TODO(jsbell): Return error. | 1884 // TODO(jsbell): Return error. |
1885 } | 1885 } |
1886 return key.Pass(); | 1886 return key.Pass(); |
1887 } | 1887 } |
1888 | 1888 |
1889 } // namespace content | 1889 } // namespace content |
OLD | NEW |