• Mohamed Amir Yosef's avatar
    [Sync] Fill in the required fields before logging the protocol event · a6aca7bc
    Mohamed Amir Yosef authored
    Before posting a client to server message, the sync cycle is informed
    about an upcoming ProtocolEvent.
    ProtocolEvent's are only consumed in
    SyncInternalsMessageHandler::OnProtocolEvent()
    using the ToValue() method. It's basically used to log the data to the
    sync-internal pages.
    
    All other occurrences of ProtoclEvent in the code are just to forward
    that protocol event across different layers of sync.
    
    One issue is the request object used to create the ProtoclEvent is
    incomplete and some fields that as store_birthday are actually set
    when posting the message to the server.
    
    This CL is splitting the functionality in PostClientToServerMessage()
    by creating another method to fill in the required fields. Such that,
    those fields get filled before reporting the ProtocolEvent.
    
    Bug: 925839
    Change-Id: If6e09dd65acea99619f5ebe82a18492ef3c322ee
    Reviewed-on: https://chromium-review.googlesource.com/c/1456076
    Commit-Queue: Mohamed Amir Yosef <mamir@chromium.org>
    Reviewed-by: default avatarMarc Treib <treib@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#629976}
    a6aca7bc
syncer_proto_util.cc 25.3 KB