media: Migrate MojoSharedBufferDoneCB to once callback.
The MojoSharedBufferDoneCB callback is a once callback because it's executed only once during the class's constructor: * https://cs.chromium.org/chromium/src/media/mojo/common/mojo_shared_buffer_video_frame.cc?rcl=8184a68c47988fb128372c9c688f77455dfcb5db&l=250 This is also documented in its definition: * https://cs.chromium.org/chromium/src/media/mojo/common/mojo_shared_buffer_video_frame.cc?rcl=8184a68c47988fb128372c9c688f77455dfcb5db&l=250 The callback is passed in the TransformToVideoFrame method, in: * https://cs.chromium.org/chromium/src/media/mojo/common/mojo_shared_buffer_video_frame.cc?rcl=8184a68c47988fb128372c9c688f77455dfcb5db&l=250 and this method can only be called once. The evidence of the following statements: * DCHECK(FrameBuffer()): https://cs.chromium.org/chromium/src/media/mojo/services/mojo_cdm_allocator.cc?rcl=8184a68c47988fb128372c9c688f77455dfcb5db&l=116 * SetFrameBuffer(nullptr): https://cs.chromium.org/chromium/src/media/mojo/services/mojo_cdm_allocator.cc?rcl=8184a68c47988fb128372c9c688f77455dfcb5db&l=116 Together these guarantee that the method can only be called once. This is part of the base::Callback migration. Context: https://cs.chromium.org/chromium/src/docs/callback.md?rcl=9fcc3764aea8f97e9f6de4a9ee61d554e67edcda&l=40 Bug: 714018 Change-Id: Ib4dff4d9c491682b8abd134723ef88bcf5252bc0 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2069540 Commit-Queue: Jose Lopes <jabolopes@google.com> Reviewed-by:Xiaohan Wang <xhwang@chromium.org> Reviewed-by:
danakj <danakj@chromium.org> Cr-Commit-Position: refs/heads/master@{#744610}
Showing
Please register or sign in to comment