Commit 535cff6a authored by Clovis PJ's avatar Clovis PJ Committed by Commit Bot

Change PresentationService to use ReceiverSet

Bug: 1109123
Change-Id: Ifa755c1d1a0325558f499ba0fc462559c9f47c30
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2316209Reviewed-by: default avatarmark a. foltz <mfoltz@chromium.org>
Commit-Queue: Clovis PJ <clovispj@google.com>
Cr-Commit-Position: refs/heads/master@{#795457}
parent 8fa18d98
......@@ -118,8 +118,8 @@ std::unique_ptr<PresentationServiceImpl> PresentationServiceImpl::Create(
void PresentationServiceImpl::Bind(
mojo::PendingReceiver<blink::mojom::PresentationService> receiver) {
presentation_service_receiver_.Bind(std::move(receiver));
presentation_service_receiver_.set_disconnect_handler(base::BindOnce(
presentation_service_receivers_.Add(this, std::move(receiver));
presentation_service_receivers_.set_disconnect_handler(base::BindRepeating(
&PresentationServiceImpl::OnConnectionError, base::Unretained(this)));
}
......@@ -497,7 +497,7 @@ void PresentationServiceImpl::Reset() {
pending_reconnect_presentation_cbs_.clear();
presentation_service_receiver_.reset();
presentation_service_receivers_.Clear();
presentation_controller_remote_.reset();
presentation_receiver_remote_.reset();
}
......
......@@ -24,7 +24,7 @@
#include "content/public/common/frame_navigate_params.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/receiver_set.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "third_party/blink/public/mojom/presentation/presentation.mojom.h"
#include "url/gurl.h"
......@@ -283,9 +283,8 @@ class CONTENT_EXPORT PresentationServiceImpl
std::unordered_map<int, std::unique_ptr<NewPresentationCallbackWrapper>>
pending_reconnect_presentation_cbs_;
// RAII receiver of |this| to PresentationService request.
mojo::Receiver<blink::mojom::PresentationService>
presentation_service_receiver_{this};
mojo::ReceiverSet<blink::mojom::PresentationService>
presentation_service_receivers_;
// ID of the RenderFrameHost this object is associated with.
int render_process_id_;
......
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