Chromium Code Reviews| Index: content/browser/indexed_db/indexed_db_leveldb_coding.cc |
| =================================================================== |
| --- content/browser/indexed_db/indexed_db_leveldb_coding.cc (revision 257734) |
| +++ content/browser/indexed_db/indexed_db_leveldb_coding.cc (working copy) |
| @@ -310,14 +310,6 @@ |
| size_t previous_size = into->size(); |
| DCHECK(value.IsValid()); |
| switch (value.type()) { |
| - case WebIDBKeyTypeNull: |
| - case WebIDBKeyTypeInvalid: |
| - case WebIDBKeyTypeMin: |
| - default: { |
| - NOTREACHED(); |
| - EncodeByte(kIndexedDBKeyNullTypeByte, into); |
| - return; |
| - } |
| case WebIDBKeyTypeArray: { |
| EncodeByte(kIndexedDBKeyArrayTypeByte, into); |
| size_t length = value.array().size(); |
| @@ -327,33 +319,39 @@ |
| DCHECK_GT(into->size(), previous_size); |
| return; |
| } |
| - case WebIDBKeyTypeBinary: { |
| + |
|
jam
2014/03/19 16:44:36
nit: the style guide doesn't show blank lines betw
Peter Kasting
2014/03/19 21:10:57
Done.
|
| + case WebIDBKeyTypeBinary: |
| EncodeByte(kIndexedDBKeyBinaryTypeByte, into); |
| EncodeBinary(value.binary(), into); |
| DCHECK_GT(into->size(), previous_size); |
| return; |
| - } |
| - case WebIDBKeyTypeString: { |
| + |
| + case WebIDBKeyTypeString: |
| EncodeByte(kIndexedDBKeyStringTypeByte, into); |
| EncodeStringWithLength(value.string(), into); |
| DCHECK_GT(into->size(), previous_size); |
| return; |
| - } |
| - case WebIDBKeyTypeDate: { |
| + |
| + case WebIDBKeyTypeDate: |
| EncodeByte(kIndexedDBKeyDateTypeByte, into); |
| EncodeDouble(value.date(), into); |
| DCHECK_EQ(9u, static_cast<size_t>(into->size() - previous_size)); |
| return; |
| - } |
| - case WebIDBKeyTypeNumber: { |
| + |
| + case WebIDBKeyTypeNumber: |
| EncodeByte(kIndexedDBKeyNumberTypeByte, into); |
| EncodeDouble(value.number(), into); |
| DCHECK_EQ(9u, static_cast<size_t>(into->size() - previous_size)); |
| return; |
| - } |
| + |
| + case WebIDBKeyTypeNull: |
| + case WebIDBKeyTypeInvalid: |
| + case WebIDBKeyTypeMin: |
| + default: |
| + NOTREACHED(); |
| + EncodeByte(kIndexedDBKeyNullTypeByte, into); |
| + return; |
| } |
| - |
| - NOTREACHED(); |
| } |
| void EncodeIDBKeyPath(const IndexedDBKeyPath& value, std::string* into) { |