Commit af6046b5 authored by Julie Jeongeun Kim's avatar Julie Jeongeun Kim Committed by Commit Bot

Convert general_audience_browsing.mojom of chromecast to new Mojo types

This CL converts GeneralAudienceBrowsingAPIKeyObserver and
GeneralAudienceBrowsingAPIKeyObserver to new Mojo types.

It uses PendingRemote, Remote, Receiver and PendingReceiver
and also updates GeneralAudienceBrowsingAPIKeySubject from
general_audience_browsing.mojom.

Bug: 955171
Change-Id: I277c3e5722012bf72d005dd6d6797d35aed4ad5d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1803944Reviewed-by: default avatarSam McNally <sammc@chromium.org>
Reviewed-by: default avatarOksana Zhuravlova <oksamyt@chromium.org>
Reviewed-by: default avatarSean Topping <seantopping@chromium.org>
Commit-Queue: Julie Kim <jkim@igalia.com>
Cr-Commit-Position: refs/heads/master@{#697430}
parent 2b1c1971
......@@ -10,5 +10,5 @@ interface GeneralAudienceBrowsingAPIKeyObserver {
interface GeneralAudienceBrowsingAPIKeySubject {
AddGeneralAudienceBrowsingAPIKeyObserver(
GeneralAudienceBrowsingAPIKeyObserver observer);
pending_remote<GeneralAudienceBrowsingAPIKeyObserver> observer);
};
......@@ -57,16 +57,15 @@ net::NetworkTrafficAnnotationTag CreateNetworkTrafficAnnotationTag() {
GeneralAudienceBrowsingService::GeneralAudienceBrowsingService(
scoped_refptr<network::SharedURLLoaderFactory> shared_url_loader_factory)
: shared_url_loader_factory_(shared_url_loader_factory),
general_audience_browsing_api_key_observer_binding_(this) {
mojom::GeneralAudienceBrowsingAPIKeyObserverPtr observer_ptr;
general_audience_browsing_api_key_observer_binding_.Bind(
mojo::MakeRequest(&observer_ptr));
content::GetSystemConnector()->BindInterface(
: shared_url_loader_factory_(shared_url_loader_factory) {
content::GetSystemConnector()->Connect(
mojom::kChromecastServiceName,
&general_audience_browsing_api_key_subject_ptr_);
general_audience_browsing_api_key_subject_ptr_
->AddGeneralAudienceBrowsingAPIKeyObserver(std::move(observer_ptr));
general_audience_browsing_api_key_subject_remote_
.BindNewPipeAndPassReceiver());
general_audience_browsing_api_key_subject_remote_
->AddGeneralAudienceBrowsingAPIKeyObserver(
general_audience_browsing_api_key_observer_receiver_
.BindNewPipeAndPassRemote());
}
GeneralAudienceBrowsingService::~GeneralAudienceBrowsingService() = default;
......
......@@ -10,7 +10,8 @@
#include "base/macros.h"
#include "base/memory/scoped_refptr.h"
#include "chromecast/browser/general_audience_browsing/mojom/general_audience_browsing.mojom.h"
#include "mojo/public/cpp/bindings/binding.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "url/gurl.h"
namespace network {
......@@ -54,10 +55,10 @@ class GeneralAudienceBrowsingService
scoped_refptr<network::SharedURLLoaderFactory> shared_url_loader_factory_;
mojo::Binding<mojom::GeneralAudienceBrowsingAPIKeyObserver>
general_audience_browsing_api_key_observer_binding_;
mojom::GeneralAudienceBrowsingAPIKeySubjectPtr
general_audience_browsing_api_key_subject_ptr_;
mojo::Receiver<mojom::GeneralAudienceBrowsingAPIKeyObserver>
general_audience_browsing_api_key_observer_receiver_{this};
mojo::Remote<mojom::GeneralAudienceBrowsingAPIKeySubject>
general_audience_browsing_api_key_subject_remote_;
DISALLOW_COPY_AND_ASSIGN(GeneralAudienceBrowsingService);
};
......
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