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

Issue 601563003: Add Read/WriteSizeT() functions to the pickle layer, plus one consumer. (Closed)

Created:
6 years, 3 months ago by Peter Kasting
Modified:
6 years, 2 months ago
Reviewers:
Tom Sepez, brettw
CC:
chromium-reviews, erikwright+watch_chromium.org, Ilya Sherman, asvitkine+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Add Read/WriteSizeT() functions to the pickle layer, plus one consumer. This eliminates the need for callers to do explicit conversions, and also ensures callers don't try to implement pickling of a size_t using a 32-bit type, leading to truncation on 64-bit targets. The pickle layer will ensure 64-bit types are always used. I'll be changing other callsites to use this in future patches. BUG=none TEST=none Committed: https://crrev.com/89a19f1430afa495acfccbc3ed7da9f51a7911d1 Cr-Commit-Position: refs/heads/master@{#297774}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Review comment #

Patch Set 3 : Return false instead #

Patch Set 4 : Add tests #

Patch Set 5 : Fix test failure #

Unified diffs Side-by-side diffs Delta from patch set Stats (+106 lines, -27 lines) Patch
M base/metrics/histogram.cc View 6 chunks +7 lines, -7 lines 0 comments Download
M base/pickle.h View 3 chunks +10 lines, -0 lines 0 comments Download
M base/pickle.cc View 1 2 1 chunk +10 lines, -0 lines 0 comments Download
M base/pickle_unittest.cc View 1 2 3 4 5 chunks +79 lines, -20 lines 0 comments Download

Messages

Total messages: 22 (6 generated)
Peter Kasting
6 years, 3 months ago (2014-09-23 23:54:47 UTC) #2
Peter Kasting
Changing to brettw at Darin's request (flooded).
6 years, 2 months ago (2014-09-30 23:17:03 UTC) #4
brettw
I'm adding Tom to this to think about security (Justin is out, I would normally ...
6 years, 2 months ago (2014-10-01 18:08:24 UTC) #6
Tom Sepez
https://codereview.chromium.org/601563003/diff/1/base/pickle.cc File base/pickle.cc (right): https://codereview.chromium.org/601563003/diff/1/base/pickle.cc#newcode114 base/pickle.cc:114: *result = static_cast<size_t>(result_uint64); I'd be OK with this so ...
6 years, 2 months ago (2014-10-01 19:12:45 UTC) #7
Tom Sepez
Also, where are you planning on calling the new method? From IPC? If so, then ...
6 years, 2 months ago (2014-10-01 19:15:37 UTC) #8
Peter Kasting
PTAL. On 2014/10/01 19:15:37, Tom Sepez wrote: > Also, where are you planning on calling ...
6 years, 2 months ago (2014-10-01 19:42:08 UTC) #9
Tom Sepez
> Sure. Changed static_cast to checked_cast to achieve this. Not sure you want to CHECK() ...
6 years, 2 months ago (2014-10-01 19:45:47 UTC) #10
Peter Kasting
On 2014/10/01 19:45:47, Tom Sepez wrote: > > Sure. Changed static_cast to checked_cast to achieve ...
6 years, 2 months ago (2014-10-01 20:22:31 UTC) #11
brettw
base owners lgtm when tom is happy.
6 years, 2 months ago (2014-10-01 20:26:50 UTC) #12
Tom Sepez
LGTM. Just noticed there's a pickle_unittest.cc, we may want to see that write/read of size_t's ...
6 years, 2 months ago (2014-10-01 20:28:29 UTC) #13
Peter Kasting
On 2014/10/01 20:28:29, Tom Sepez wrote: > Just noticed there's a pickle_unittest.cc, we may want ...
6 years, 2 months ago (2014-10-01 21:13:49 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/601563003/60001
6 years, 2 months ago (2014-10-01 21:14:19 UTC) #16
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_swarming on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_swarming/builds/19846)
6 years, 2 months ago (2014-10-01 23:22:39 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/601563003/80001
6 years, 2 months ago (2014-10-02 00:57:35 UTC) #20
commit-bot: I haz the power
Committed patchset #5 (id:80001) as 34bbb984965ac961bc25be1feb7d28f6e7338b44
6 years, 2 months ago (2014-10-02 03:01:11 UTC) #21
commit-bot: I haz the power
6 years, 2 months ago (2014-10-02 03:01:51 UTC) #22
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/89a19f1430afa495acfccbc3ed7da9f51a7911d1
Cr-Commit-Position: refs/heads/master@{#297774}

Powered by Google App Engine
This is Rietveld 408576698