Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(602)

Side by Side Diff: Source/WebCore/Modules/indexeddb/IDBLevelDBCoding.cpp

Issue 10377101: Merge 116333 - IndexedDB: LevelDB coding for bools is broken (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1132/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | Source/WebKit/chromium/tests/IDBLevelDBCodingTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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)
OLDNEW
« no previous file with comments | « no previous file | Source/WebKit/chromium/tests/IDBLevelDBCodingTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698