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

Side by Side Diff: components/tracing/core/proto_zero_message.cc

Issue 2240043004: Tracing V2: Fully-functional plugin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix use after free in tests Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/tracing/core/proto_zero_message.h" 5 #include "components/tracing/core/proto_zero_message.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "components/tracing/core/proto_zero_message_handle.h" 9 #include "components/tracing/core/proto_zero_message_handle.h"
10 10
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 stream_writer_->ReserveBytes(proto::kMessageLengthFieldSize)); 118 stream_writer_->ReserveBytes(proto::kMessageLengthFieldSize));
119 size_ += proto::kMessageLengthFieldSize; 119 size_ += proto::kMessageLengthFieldSize;
120 nested_message_ = message; 120 nested_message_ = message;
121 } 121 }
122 122
123 void ProtoZeroMessage::EndNestedMessage() { 123 void ProtoZeroMessage::EndNestedMessage() {
124 size_ += nested_message_->Finalize(); 124 size_ += nested_message_->Finalize();
125 nested_message_ = nullptr; 125 nested_message_ = nullptr;
126 } 126 }
127 127
128 #if DCHECK_IS_ON()
129 void ProtoZeroMessage::SealField(uint32_t field_id) {
130 if (handle_ != nullptr)
131 handle_->SealField(field_id);
132 }
133 #endif
134
128 } // namespace v2 135 } // namespace v2
129 } // namespace tracing 136 } // namespace tracing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698