| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 // Object store meta-data: | 63 // Object store meta-data: |
| 64 // | 64 // |
| 65 // The prefix is followed by a type byte, then a variable-length integer, an
d then another variable-length integer (FIXME: this should be a byte). | 65 // The prefix is followed by a type byte, then a variable-length integer, an
d then another variable-length integer (FIXME: this should be a byte). |
| 66 // | 66 // |
| 67 // <database id, 0, 0, 50, object store id, 0> => utf16 object store name [O
bjectStoreMetaDataKey] | 67 // <database id, 0, 0, 50, object store id, 0> => utf16 object store name [O
bjectStoreMetaDataKey] |
| 68 // <database id, 0, 0, 50, object store id, 1> => utf16 key path [ObjectStor
eMetaDataKey] | 68 // <database id, 0, 0, 50, object store id, 1> => utf16 key path [ObjectStor
eMetaDataKey] |
| 69 // <database id, 0, 0, 50, object store id, 2> => has auto increment [Object
StoreMetaDataKey] | 69 // <database id, 0, 0, 50, object store id, 2> => has auto increment [Object
StoreMetaDataKey] |
| 70 // <database id, 0, 0, 50, object store id, 3> => is evictable [ObjectStoreM
etaDataKey] | 70 // <database id, 0, 0, 50, object store id, 3> => is evictable [ObjectStoreM
etaDataKey] |
| 71 // <database id, 0, 0, 50, object store id, 4> => last "version" number [Obj
ectStoreMetaDataKey] | 71 // <database id, 0, 0, 50, object store id, 4> => last "version" number [Obj
ectStoreMetaDataKey] |
| 72 // <database id, 0, 0, 50, object store id, 5> => maximum index id ever allo
cated [ObjectStoreMetaDataKey] | 72 // <database id, 0, 0, 50, object store id, 5> => maximum index id ever allo
cated [ObjectStoreMetaDataKey] |
| 73 // <database id, 0, 0, 50, object store id, 6> => has key path (vs. null) [O
bjectStoreMetaDataKey] |
| 73 // | 74 // |
| 74 // | 75 // |
| 75 // Index meta-data: | 76 // Index meta-data: |
| 76 // | 77 // |
| 77 // The prefix is followed by a type byte, then two variable-length integers,
and then another type byte. | 78 // The prefix is followed by a type byte, then two variable-length integers,
and then another type byte. |
| 78 // | 79 // |
| 79 // <database id, 0, 0, 100, object store id, index id, 0> => utf16 index nam
e [IndexMetaDataKey] | 80 // <database id, 0, 0, 100, object store id, index id, 0> => utf16 index nam
e [IndexMetaDataKey] |
| 80 // <database id, 0, 0, 100, object store id, index id, 1> => are index keys
unique [IndexMetaDataKey] | 81 // <database id, 0, 0, 100, object store id, index id, 1> => are index keys
unique [IndexMetaDataKey] |
| 81 // <database id, 0, 0, 100, object store id, index id, 2> => utf16 key path
[IndexMetaDataKey] | 82 // <database id, 0, 0, 100, object store id, index id, 2> => utf16 key path
[IndexMetaDataKey] |
| 82 // | 83 // |
| (...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 850 ret.append(encodeVarInt(objectStoreId)); | 851 ret.append(encodeVarInt(objectStoreId)); |
| 851 ret.append(encodeVarInt(metaDataType)); | 852 ret.append(encodeVarInt(metaDataType)); |
| 852 return ret; | 853 return ret; |
| 853 } | 854 } |
| 854 | 855 |
| 855 Vector<char> ObjectStoreMetaDataKey::encodeMaxKey(int64_t databaseId) | 856 Vector<char> ObjectStoreMetaDataKey::encodeMaxKey(int64_t databaseId) |
| 856 { | 857 { |
| 857 return encode(databaseId, INT64_MAX, INT64_MAX); | 858 return encode(databaseId, INT64_MAX, INT64_MAX); |
| 858 } | 859 } |
| 859 | 860 |
| 861 Vector<char> ObjectStoreMetaDataKey::encodeMaxKey(int64_t databaseId, int64_t ob
jectStoreId) |
| 862 { |
| 863 return encode(databaseId, objectStoreId, INT64_MAX); |
| 864 } |
| 865 |
| 860 int64_t ObjectStoreMetaDataKey::objectStoreId() const | 866 int64_t ObjectStoreMetaDataKey::objectStoreId() const |
| 861 { | 867 { |
| 862 ASSERT(m_objectStoreId >= 0); | 868 ASSERT(m_objectStoreId >= 0); |
| 863 return m_objectStoreId; | 869 return m_objectStoreId; |
| 864 } | 870 } |
| 865 int64_t ObjectStoreMetaDataKey::metaDataType() const | 871 int64_t ObjectStoreMetaDataKey::metaDataType() const |
| 866 { | 872 { |
| 867 ASSERT(m_metaDataType >= 0); | 873 ASSERT(m_metaDataType >= 0); |
| 868 return m_metaDataType; | 874 return m_metaDataType; |
| 869 } | 875 } |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1306 RefPtr<IDBKey> key; | 1312 RefPtr<IDBKey> key; |
| 1307 decodeIDBKey(m_encodedUserKey.begin(), m_encodedUserKey.end(), key); | 1313 decodeIDBKey(m_encodedUserKey.begin(), m_encodedUserKey.end(), key); |
| 1308 return key; | 1314 return key; |
| 1309 } | 1315 } |
| 1310 | 1316 |
| 1311 } // namespace IDBLevelDBCoding | 1317 } // namespace IDBLevelDBCoding |
| 1312 } // namespace WebCore | 1318 } // namespace WebCore |
| 1313 | 1319 |
| 1314 #endif // ENABLE(LEVELDB) | 1320 #endif // ENABLE(LEVELDB) |
| 1315 #endif // ENABLE(INDEXED_DATABASE) | 1321 #endif // ENABLE(INDEXED_DATABASE) |
| OLD | NEW |