Chromium Code Reviews
DescriptionIndexedDB: Convert decoding functions to pass StringPieces vs. pointers
The ugly decoding functions that do pointer arithmetic were nasty in
the Blink codebase. Conversion to Chromium and replacing WTF::Vector
with std::vector made things worse due to iterator differences across
platforms in C++03. Start replacing all that goo with StringPiece
which encapsulates the pointers and is a better match for the "slice"
model of leveldb.
Also avoids a std::string to std::vector<char> data copy when getting
values - hooray! Standardizes the various DecodeXXX function signatures
to take a mutable slice and always return a success code.
Key path encode/decode tests were updated to have the "expected" encoded
data in the test rather than manually computing it.
Left to do: the various Key-type classes still pass around raw pointers,
and LevelDBSlice should be removed entirely in favor of StringPiece.
BUG=234278
R=alecflett@chromium.org
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=204391
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=204512
Patch Set 1 #Patch Set 2 : Removed incorrect validity check found by tests #Patch Set 3 : Address win/mac/android compile errors #Patch Set 4 : Rebased #
Total comments: 4
Patch Set 5 : Make LevelDBSlice => StringPiece conversion explicit #Patch Set 6 : Fix unaligned memory access for android #Patch Set 7 : Correct bogus iterator dereference in unit test #Messages
Total messages: 14 (0 generated)
|