| Index: content/renderer/render_frame_impl.cc
|
| diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
| index fbf545b8694f14fe1d2685c176186ad42e87ae5d..d6b4ea0be9bee4d419515ab1e22c13d290a0b72d 100644
|
| --- a/content/renderer/render_frame_impl.cc
|
| +++ b/content/renderer/render_frame_impl.cc
|
| @@ -1621,6 +1621,8 @@ bool RenderFrameImpl::OnMessageReceived(const IPC::Message& msg) {
|
| IPC_MESSAGE_HANDLER(FrameMsg_GetNearestFindResult,
|
| OnGetNearestFindResult)
|
| IPC_MESSAGE_HANDLER(FrameMsg_FindMatchRects, OnFindMatchRects)
|
| + IPC_MESSAGE_HANDLER(FrameMsg_SetOverlayRoutingToken,
|
| + OnSetOverlayRoutingToken)
|
| #endif
|
|
|
| #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU)
|
| @@ -5873,6 +5875,28 @@ void RenderFrameImpl::OnFindMatchRects(int current_version) {
|
| Send(new FrameHostMsg_FindMatchRects_Reply(routing_id_, rects_version,
|
| match_rects, active_rect));
|
| }
|
| +
|
| +void RenderFrameImpl::OnSetOverlayRoutingToken(
|
| + const base::UnguessableToken& token) {
|
| + overlay_routing_token_ = token;
|
| + for (const auto& cb : pending_routing_token_callbacks_)
|
| + cb.Run(overlay_routing_token_.value());
|
| + pending_routing_token_callbacks_.clear();
|
| +}
|
| +
|
| +void RenderFrameImpl::GetOverlayRoutingToken(
|
| + const media::RoutingTokenCallback& callback) {
|
| + if (overlay_routing_token_.has_value()) {
|
| + callback.Run(overlay_routing_token_.value());
|
| + return;
|
| + }
|
| +
|
| + // Send a request to the host for the token. We'll notify |callback| when it
|
| + // arrives later.
|
| + Send(new FrameHostMsg_RequestOverlayRoutingToken(routing_id_));
|
| +
|
| + pending_routing_token_callbacks_.push_back(callback);
|
| +}
|
| #endif
|
|
|
| #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU)
|
|
|