| 151 | } |
| 152 | |
| 153 | BytesView ProtobufArena::encodeMessage(size_t messageIndex, ExceptionTracker& exceptionTracker) const { |
| 154 | auto* message = getMessage(messageIndex, exceptionTracker); |
| 155 | if (message == nullptr) { |
| 156 | return BytesView(); |
| 157 | } |
| 158 | |
| 159 | VALDI_TRACE_META("Protobuf.encodeMessage", message->getDescriptor()->name()); |
| 160 | |
| 161 | // Encoding walks the message's descriptor and may trigger first-time lazy resolution |
| 162 | // of message types (e.g. for messages created/decoded without postprocess) from the |
| 163 | // shared pool, so it must be serialized against concurrent pool access. |
| 164 | auto factoryLocks = lockRetainedMessageFactories(); |
| 165 | |
| 166 | return message->encode(_includeAllFieldsDuringEncoding); |
| 167 | } |
| 168 | |
| 169 | size_t ProtobufArena::fieldToMessageIndex(JSProtobufMessage& message, |
| 170 | Protobuf::Field& field, |
nothing calls this directly
no test coverage detected