src/developer/forensics/feedback_data/integrity_reporter.cc
// Create a complete list set of attachments from the collected attachments and the allowlist.
Create a complete list set of attachments from the collected attachments and the allowlist.
Create a complete list set of attachments from the collected attachments and the allowlist .
Attachments AllAttachments(const AttachmentKeys& allowlist,
                           const ::fit::result<Attachments>& attachments_result) {
  Attachments all_attachments;
  if (attachments_result.is_ok()) {
    for (const auto& [k, v] : attachments_result.value()) {
      switch (v.State()) {
        case AttachmentValue::State::kComplete:
          all_attachments.insert({k, AttachmentValue("")});
          break;
        case AttachmentValue::State::kPartial:
          all_attachments.insert({k, AttachmentValue("", v.Error())});
          break;
        case AttachmentValue::State::kMissing:
          all_attachments.insert({k, v});
          break;
      }
    }
  }
  for (const auto& key : allowlist) {
    if (all_attachments.find(key) == all_attachments.end()) {
      all_attachments.insert({key, AttachmentValue(Error::kLogicError)});
    }
  }
  return all_attachments;
}
Attachments AllAttachments ( const AttachmentKeys & allowlist , const :: fit :: result < Attachments > & attachments_result ) { Attachments all_attachments ; if ( attachments_result . is_ok ( ) ) { for ( const auto & [ k , v ] : attachments_result . value ( ) ) { switch ( v . State ( ) ) { case AttachmentValue :: State :: kComplete : all_attachments . insert ( { k , AttachmentValue ( " " ) } ) ; break ; case AttachmentValue :: State :: kPartial : all_attachments . insert ( { k , AttachmentValue ( " " , v . Error ( ) ) } ) ; break ; case AttachmentValue :: State :: kMissing : all_attachments . insert ( { k , v } ) ; break ; } } } for ( const auto & key : allowlist ) { if ( all_attachments . find ( key ) == all_attachments . end ( ) ) { all_attachments . insert ( { key , AttachmentValue ( Error :: kLogicError ) } ) ; } } return all_attachments ; }
Create a complete list set of attachments from the collected attachments and the allowlist.
Create a complete list set of attachments from the collected attachments and the allowlist .
// Because attachments can contain large blobs of text and we only care about the state of the // attachment and its associated error, we don't copy the value of the attachment.