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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 } | 173 } |
174 | 174 |
175 Vector<char> minIDBKey() | 175 Vector<char> minIDBKey() |
176 { | 176 { |
177 return encodeByte(kIDBKeyMinKeyTypeByte); | 177 return encodeByte(kIDBKeyMinKeyTypeByte); |
178 } | 178 } |
179 | 179 |
180 Vector<char> encodeBool(bool b) | 180 Vector<char> encodeBool(bool b) |
181 { | 181 { |
182 Vector<char> ret(1); | 182 Vector<char> ret(1); |
183 ret.append(b ? 1 : 0); | 183 ret[0] = b ? 1 : 0; |
184 return ret; | 184 return ret; |
185 } | 185 } |
186 | 186 |
187 bool decodeBool(const char* begin, const char* end) | 187 bool decodeBool(const char* begin, const char* end) |
188 { | 188 { |
189 ASSERT(begin < end); | 189 ASSERT(begin < end); |
190 return *begin; | 190 return *begin; |
191 } | 191 } |
192 | 192 |
193 Vector<char> encodeInt(int64_t n) | 193 Vector<char> encodeInt(int64_t n) |
(...skipping 1313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1507 RefPtr<IDBKey> key; | 1507 RefPtr<IDBKey> key; |
1508 decodeIDBKey(m_encodedPrimaryKey.begin(), m_encodedPrimaryKey.end(), key); | 1508 decodeIDBKey(m_encodedPrimaryKey.begin(), m_encodedPrimaryKey.end(), key); |
1509 return key; | 1509 return key; |
1510 } | 1510 } |
1511 | 1511 |
1512 } // namespace IDBLevelDBCoding | 1512 } // namespace IDBLevelDBCoding |
1513 } // namespace WebCore | 1513 } // namespace WebCore |
1514 | 1514 |
1515 #endif // USE(LEVELDB) | 1515 #endif // USE(LEVELDB) |
1516 #endif // ENABLE(INDEXED_DATABASE) | 1516 #endif // ENABLE(INDEXED_DATABASE) |
OLD | NEW |