Commit ff530f77 authored by David Bokan's avatar David Bokan Committed by Chromium LUCI CQ

Convert CastChannelAPI to RepeatingCallback

The same EventDisptachCallback in this class is invoked each time a
message or error occurs. The CastMessageHandler that owns the callback
is only removed when a listener is so the callback may be executed
several times..

CastMessageHandler copies the callback and binds it using BindOnce
(since the posted task will be invoked only once). Due to the copy, this
is semantically a RepeatingCallback.

Since Callback is a typedef of RepeatingCallback this is purely a rename
and no-op.

Bug: 1152268
Change-Id: Ie88c7c1d9b01356ded2469f41caa40865bf41895
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2593559
Commit-Queue: mark a. foltz <mfoltz@chromium.org>
Reviewed-by: default avatarmark a. foltz <mfoltz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#837321}
parent c0e676f6
......@@ -75,7 +75,8 @@ class CastChannelAPI : public BrowserContextKeyedAPI,
// Defines a callback used to send events to the extension's
// EventRouter.
// Parameter #0 is a unique pointer to the event payload.
using EventDispatchCallback = base::Callback<void(std::unique_ptr<Event>)>;
using EventDispatchCallback =
base::RepeatingCallback<void(std::unique_ptr<Event>)>;
// Receives incoming messages and errors and provides additional API context.
// Created on the UI thread. All methods, including the destructor, must be
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment