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

Issue 2158323005: tracing v2: Introduce handles for safe usage of ProtoZeroMessage (Closed)

Created:
4 years, 5 months ago by Primiano Tucci (use gerrit)
Modified:
4 years, 5 months ago
CC:
chromium-reviews, tracing+reviews_chromium.org, wfh+watch_chromium.org, kraynov
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

tracing v2: Introduce handles for safe usage of ProtoZeroMessage This is to decouple the lifetime of a proto message from the underlying chunk storage. It gives the following two guarantees: - The underlying message is finalized (if still alive) if the handle goes out of scope. Concretely this guarantees that all events are committed to the buffer, without having to wait for the next event in the thread. - In Debug / DCHECK_IS_ON builds, the handle becomes null once the underlying message is finalized. This is to enforce the append-only API and catch mis-uses bugs early (e.g., when adding two repeated fields, the addition of the second one will force the finalization of the first and invalidation of its handle) BUG=608719 TEST=ProtoZeroMessageTest.MessageHandle Committed: https://crrev.com/4f022543fb102a9c074308cb70e85d0a4d830cd1 Cr-Commit-Position: refs/heads/master@{#406827}

Patch Set 1 #

Patch Set 2 : . #

Total comments: 14

Patch Set 3 : alph+oysteine review #

Patch Set 4 : final nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+268 lines, -19 lines) Patch
M components/tracing.gyp View 1 chunk +2 lines, -0 lines 0 comments Download
M components/tracing/BUILD.gn View 1 chunk +2 lines, -0 lines 0 comments Download
M components/tracing/core/proto_zero_message.h View 2 4 chunks +13 lines, -3 lines 0 comments Download
M components/tracing/core/proto_zero_message.cc View 1 2 3 3 chunks +4 lines, -0 lines 0 comments Download
A components/tracing/core/proto_zero_message_handle.h View 1 2 1 chunk +69 lines, -0 lines 0 comments Download
A components/tracing/core/proto_zero_message_handle.cc View 1 2 1 chunk +67 lines, -0 lines 0 comments Download
M components/tracing/core/proto_zero_message_unittest.cc View 1 2 3 7 chunks +111 lines, -16 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 21 (14 generated)
Primiano Tucci (use gerrit)
This one is pretty boring, but the next one is more exciting (https://codereview.chromium.org/2164013002)
4 years, 5 months ago (2016-07-20 16:18:48 UTC) #8
alph
lgtm https://codereview.chromium.org/2158323005/diff/20001/components/tracing/core/proto_zero_message_handle.cc File components/tracing/core/proto_zero_message_handle.cc (right): https://codereview.chromium.org/2158323005/diff/20001/components/tracing/core/proto_zero_message_handle.cc#newcode53 components/tracing/core/proto_zero_message_handle.cc:53: // useles null-check. typo: useless https://codereview.chromium.org/2158323005/diff/20001/components/tracing/core/proto_zero_message_handle.h File components/tracing/core/proto_zero_message_handle.h ...
4 years, 5 months ago (2016-07-20 18:35:00 UTC) #11
oystein (OOO til 10th of July)
lgtm! https://codereview.chromium.org/2158323005/diff/20001/components/tracing/core/proto_zero_message.h File components/tracing/core/proto_zero_message.h (right): https://codereview.chromium.org/2158323005/diff/20001/components/tracing/core/proto_zero_message.h#newcode57 components/tracing/core/proto_zero_message.h:57: void set_handle(ProtoZeroMessageHandleBase* handle) { Maybe wrap the whole ...
4 years, 5 months ago (2016-07-20 21:19:37 UTC) #12
Primiano Tucci (use gerrit)
Thanks folks! https://codereview.chromium.org/2158323005/diff/20001/components/tracing/core/proto_zero_message.h File components/tracing/core/proto_zero_message.h (right): https://codereview.chromium.org/2158323005/diff/20001/components/tracing/core/proto_zero_message.h#newcode57 components/tracing/core/proto_zero_message.h:57: void set_handle(ProtoZeroMessageHandleBase* handle) { On 2016/07/20 21:19:37, ...
4 years, 5 months ago (2016-07-21 10:50:03 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2158323005/60001
4 years, 5 months ago (2016-07-21 11:05:50 UTC) #18
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 5 months ago (2016-07-21 12:50:06 UTC) #19
commit-bot: I haz the power
4 years, 5 months ago (2016-07-21 12:51:58 UTC) #21
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/4f022543fb102a9c074308cb70e85d0a4d830cd1
Cr-Commit-Position: refs/heads/master@{#406827}

Powered by Google App Engine
This is Rietveld 408576698