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

Issue 16256014: IndexedDB: Convert decoding functions to pass StringPieces vs. pointers (Closed)

Created:
7 years, 6 months ago by jsbell
Modified:
7 years, 6 months ago
Reviewers:
alecflett, dgrogan
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, jam, dgrogan
Visibility:
Public.

Description

IndexedDB: 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+972 lines, -860 lines) Patch
M content/browser/indexed_db/indexed_db_backing_store.cc View 1 2 3 4 5 34 chunks +174 lines, -136 lines 0 comments Download
M content/browser/indexed_db/indexed_db_backing_store_unittest.cc View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/indexed_db/indexed_db_cleanup_on_io_error_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/indexed_db/indexed_db_leveldb_coding.h View 2 chunks +44 lines, -58 lines 0 comments Download
M content/browser/indexed_db/indexed_db_leveldb_coding.cc View 1 2 3 4 5 34 chunks +464 lines, -412 lines 0 comments Download
M content/browser/indexed_db/indexed_db_leveldb_coding_unittest.cc View 1 2 3 4 5 6 14 chunks +250 lines, -232 lines 0 comments Download
M content/browser/indexed_db/leveldb/leveldb_database.h View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/indexed_db/leveldb/leveldb_database.cc View 1 2 3 4 5 1 chunk +2 lines, -5 lines 0 comments Download
M content/browser/indexed_db/leveldb/leveldb_slice.h View 1 2 3 4 2 chunks +10 lines, -0 lines 0 comments Download
M content/browser/indexed_db/leveldb/leveldb_transaction.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M content/browser/indexed_db/leveldb/leveldb_transaction.cc View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/indexed_db/leveldb/leveldb_unittest.cc View 1 2 3 4 5 7 chunks +21 lines, -11 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
jsbell
alecflett@ - please take a look?
7 years, 6 months ago (2013-06-03 16:38:09 UTC) #1
alecflett
On 2013/06/03 16:38:09, jsbell wrote: > alecflett@ - please take a look? lgtm as is ...
7 years, 6 months ago (2013-06-03 21:22:40 UTC) #2
alecflett
https://codereview.chromium.org/16256014/diff/8016/content/browser/indexed_db/indexed_db_backing_store.cc File content/browser/indexed_db/indexed_db_backing_store.cc (right): https://codereview.chromium.org/16256014/diff/8016/content/browser/indexed_db/indexed_db_backing_store.cc#newcode1817 content/browser/indexed_db/indexed_db_backing_store.cc:1817: return DecodeIDBKey(&slice, found_primary_key) && slice.empty(); This pattern makes me ...
7 years, 6 months ago (2013-06-03 21:22:53 UTC) #3
jsbell
https://codereview.chromium.org/16256014/diff/8016/content/browser/indexed_db/indexed_db_backing_store.cc File content/browser/indexed_db/indexed_db_backing_store.cc (right): https://codereview.chromium.org/16256014/diff/8016/content/browser/indexed_db/indexed_db_backing_store.cc#newcode1817 content/browser/indexed_db/indexed_db_backing_store.cc:1817: return DecodeIDBKey(&slice, found_primary_key) && slice.empty(); On 2013/06/03 21:22:53, alecflett ...
7 years, 6 months ago (2013-06-03 21:37:09 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jsbell@chromium.org/16256014/7014
7 years, 6 months ago (2013-06-03 21:56:10 UTC) #5
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) chrome_frame_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=157156
7 years, 6 months ago (2013-06-04 01:33:39 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jsbell@chromium.org/16256014/7014
7 years, 6 months ago (2013-06-04 12:33:48 UTC) #7
jsbell
On 2013/06/04 12:33:48, I haz the power (commit-bot) wrote: > CQ is trying da patch. ...
7 years, 6 months ago (2013-06-04 16:32:44 UTC) #8
jsbell
On 2013/06/04 16:32:44, jsbell wrote: > On 2013/06/04 12:33:48, I haz the power (commit-bot) wrote: ...
7 years, 6 months ago (2013-06-04 18:36:55 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jsbell@chromium.org/16256014/28001
7 years, 6 months ago (2013-06-05 18:48:07 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jsbell@chromium.org/16256014/28001
7 years, 6 months ago (2013-06-05 22:48:57 UTC) #11
commit-bot: I haz the power
Change committed as 204391
7 years, 6 months ago (2013-06-06 02:34:15 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jsbell@chromium.org/16256014/43001
7 years, 6 months ago (2013-06-06 05:03:48 UTC) #13
commit-bot: I haz the power
7 years, 6 months ago (2013-06-06 16:02:25 UTC) #14
Message was sent while issue was closed.
Change committed as 204512

Powered by Google App Engine
This is Rietveld 408576698