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

Issue 1524613002: [mojo] Use base::Pickle for Message storage. (Closed)

Created:
5 years ago by Ken Rockot(use gerrit already)
Modified:
5 years ago
Reviewers:
Lei Zhang, yzshen1
CC:
Aaron Boodman, abarth-chromium, ben+mojo_chromium.org, chromium-reviews, darin (slow to review), qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, vmpstr+watch_chromium.org, yzshen+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[mojo] Use base::Pickle for Message storage. This CL modifies the mojo::Message implementation so that its storage is always backed by a base::Pickle. Part of a series of changes to support custom mojom serialization: 1. https://codereview.chromium.org/1515423002 2. https://codereview.chromium.org/1517043004 3. https://codereview.chromium.org/1524693002 4. https://codereview.chromium.org/1520153002 5. This CL 6. https://codereview.chromium.org/1526533002 7. https://codereview.chromium.org/1524703002 BUG=569669 Committed: https://crrev.com/0776a5005caf1c15e92ccf93546236737f935d0c Cr-Commit-Position: refs/heads/master@{#365766}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : Add DCHECK to ensure nobody grows a PickleBuffer via Buffer::Allocate #

Patch Set 5 : #

Patch Set 6 : #

Total comments: 6

Patch Set 7 : gyp #

Patch Set 8 : #

Total comments: 3

Patch Set 9 : address comments #

Patch Set 10 : some cleanup #

Total comments: 6

Patch Set 11 : static_cast, initialization-is-allocation, and split out Pickle impl from PickleBuffer #

Total comments: 2

Patch Set 12 : Remove unused ClaimUninitializedBytes interface #

Patch Set 13 : kill Message::Reset(), cleanup PickleBuffer declaration #

Total comments: 6

Patch Set 14 : merge #

Patch Set 15 : address pickle comments #

Patch Set 16 : merge #

Patch Set 17 : merge #

Patch Set 18 : happy compiler happy robots #

Unified diffs Side-by-side diffs Delta from patch set Stats (+302 lines, -86 lines) Patch
M base/pickle.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +9 lines, -0 lines 0 comments Download
M base/pickle.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +18 lines, -4 lines 0 comments Download
M base/pickle_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +46 lines, -0 lines 0 comments Download
M mojo/public/cpp/bindings/BUILD.gn View 1 2 chunks +3 lines, -0 lines 0 comments Download
M mojo/public/cpp/bindings/lib/buffer.h View 1 1 chunk +6 lines, -0 lines 0 comments Download
M mojo/public/cpp/bindings/lib/fixed_buffer.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M mojo/public/cpp/bindings/lib/fixed_buffer.cc View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M mojo/public/cpp/bindings/lib/message.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +13 lines, -35 lines 0 comments Download
M mojo/public/cpp/bindings/lib/message_builder.h View 2 chunks +2 lines, -4 lines 0 comments Download
M mojo/public/cpp/bindings/lib/message_builder.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +8 lines, -7 lines 0 comments Download
M mojo/public/cpp/bindings/lib/message_internal.h View 1 chunk +0 lines, -7 lines 0 comments Download
A mojo/public/cpp/bindings/lib/pickle_buffer.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +53 lines, -0 lines 0 comments Download
A mojo/public/cpp/bindings/lib/pickle_buffer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +96 lines, -0 lines 0 comments Download
M mojo/public/cpp/bindings/message.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +38 lines, -27 lines 0 comments Download
M mojo/public/cpp/bindings/tests/validation_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -2 lines 0 comments Download
M third_party/mojo/mojo_public.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +3 lines, -0 lines 0 comments Download

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 26 (11 generated)
Ken Rockot(use gerrit already)
Here's the patch which moves mojo::Message onto base::Pickle. I looked at a few different strategies ...
5 years ago (2015-12-14 20:38:58 UTC) #5
yzshen1
https://codereview.chromium.org/1524613002/diff/100001/base/pickle.h File base/pickle.h (right): https://codereview.chromium.org/1524613002/diff/100001/base/pickle.h#newcode261 base/pickle.h:261: // Claims |num_bytes| bytes of payload. This is similar ...
5 years ago (2015-12-15 19:07:02 UTC) #7
Ken Rockot(use gerrit already)
Thanks! I also added some unit tests for base::Pickle::ClaimBytes. On 2015/12/15 at 19:07:02, yzshen wrote: ...
5 years ago (2015-12-15 19:37:35 UTC) #8
Ken Rockot(use gerrit already)
So I made a few more changes here: On 2015/12/15 at 19:37:35, Ken Rockot wrote: ...
5 years ago (2015-12-15 21:16:08 UTC) #9
yzshen1
> > > > https://codereview.chromium.org/1524613002/diff/100001/mojo/public/cpp/bindings/lib/pickle_buffer.h > > > File mojo/public/cpp/bindings/lib/pickle_buffer.h (right): > > > > ...
5 years ago (2015-12-15 22:27:08 UTC) #10
Ken Rockot(use gerrit already)
I split the pickle storage out from PickleBuffer, that should work https://codereview.chromium.org/1524613002/diff/180001/base/pickle_unittest.cc File base/pickle_unittest.cc (right): ...
5 years ago (2015-12-16 00:09:33 UTC) #11
yzshen1
Only two nits. LGTM. Thanks! https://codereview.chromium.org/1524613002/diff/200001/mojo/public/cpp/bindings/lib/message.cc File mojo/public/cpp/bindings/lib/message.cc (right): https://codereview.chromium.org/1524613002/diff/200001/mojo/public/cpp/bindings/lib/message.cc#newcode26 mojo/public/cpp/bindings/lib/message.cc:26: buffer_.reset(); Is there anyone ...
5 years ago (2015-12-16 00:29:28 UTC) #12
Ken Rockot(use gerrit already)
Lei: Would you please review the protected addition to base::Pickle? Thanks!
5 years ago (2015-12-16 01:08:49 UTC) #14
Lei Zhang
lgtm https://codereview.chromium.org/1524613002/diff/240001/base/pickle.h File base/pickle.h (right): https://codereview.chromium.org/1524613002/diff/240001/base/pickle.h#newcode264 base/pickle.h:264: void* ClaimBytes(size_t num_bytes); Can you document the return ...
5 years ago (2015-12-16 01:46:15 UTC) #15
Ken Rockot(use gerrit already)
Thanks! https://codereview.chromium.org/1524613002/diff/240001/base/pickle.h File base/pickle.h (right): https://codereview.chromium.org/1524613002/diff/240001/base/pickle.h#newcode264 base/pickle.h:264: void* ClaimBytes(size_t num_bytes); On 2015/12/16 at 01:46:15, Lei ...
5 years ago (2015-12-16 01:53:41 UTC) #16
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1524613002/340001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1524613002/340001
5 years ago (2015-12-17 02:35:57 UTC) #18
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years ago (2015-12-17 04:04:55 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1524613002/340001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1524613002/340001
5 years ago (2015-12-17 06:15:22 UTC) #23
commit-bot: I haz the power
Committed patchset #18 (id:340001)
5 years ago (2015-12-17 06:19:56 UTC) #24
commit-bot: I haz the power
5 years ago (2015-12-17 06:20:53 UTC) #26
Message was sent while issue was closed.
Patchset 18 (id:??) landed as
https://crrev.com/0776a5005caf1c15e92ccf93546236737f935d0c
Cr-Commit-Position: refs/heads/master@{#365766}

Powered by Google App Engine
This is Rietveld 408576698