OLD | NEW |
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 Loading... |
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 |
OLD | NEW |