Commit 14aa5077 authored by Abhijeet Kandalkar's avatar Abhijeet Kandalkar Committed by Commit Bot

Use new mojo types for DeferredDestroyPingImpl class

This CL converts PingServicePtr and port depending files to adapt to
new mojo types.

Bug: 955171, 978694
Change-Id: I204668e92136e9b8cf87150e016baa00b15e9fcc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1897404Reviewed-by: default avatarJohn Rummell <jrummell@chromium.org>
Commit-Queue: Abhijeet Kandalkar <abhijeet@igalia.com>
Cr-Commit-Position: refs/heads/master@{#712939}
parent 496cf30b
...@@ -15,7 +15,6 @@ namespace media { ...@@ -15,7 +15,6 @@ namespace media {
namespace { namespace {
using PingService = mojo::test::PingService; using PingService = mojo::test::PingService;
using PingServicePtr = mojo::test::PingServicePtr;
class DeferredDestroyPingImpl : public DeferredDestroy<PingService> { class DeferredDestroyPingImpl : public DeferredDestroy<PingService> {
public: public:
...@@ -46,10 +45,10 @@ int DeferredDestroyPingImpl::instance_count = 0; ...@@ -46,10 +45,10 @@ int DeferredDestroyPingImpl::instance_count = 0;
DeferredDestroyPingImpl* AddDeferredDestroyBinding( DeferredDestroyPingImpl* AddDeferredDestroyBinding(
DeferredDestroyStrongBindingSet<PingService>* bindings, DeferredDestroyStrongBindingSet<PingService>* bindings,
PingServicePtr* ptr) { mojo::PendingRemote<PingService>* ptr) {
auto impl = std::make_unique<DeferredDestroyPingImpl>(); auto impl = std::make_unique<DeferredDestroyPingImpl>();
DeferredDestroyPingImpl* impl_ptr = impl.get(); DeferredDestroyPingImpl* impl_ptr = impl.get();
bindings->AddBinding(std::move(impl), mojo::MakeRequest(ptr)); bindings->AddBinding(std::move(impl), ptr->InitWithNewPipeAndPassReceiver());
return impl_ptr; return impl_ptr;
} }
...@@ -63,7 +62,7 @@ class DeferredDestroyStrongBindingSetTest : public testing::Test { ...@@ -63,7 +62,7 @@ class DeferredDestroyStrongBindingSetTest : public testing::Test {
}; };
TEST_F(DeferredDestroyStrongBindingSetTest, Destructor) { TEST_F(DeferredDestroyStrongBindingSetTest, Destructor) {
PingServicePtr ping[2]; mojo::PendingRemote<PingService> ping[2];
auto bindings = auto bindings =
std::make_unique<DeferredDestroyStrongBindingSet<PingService>>(); std::make_unique<DeferredDestroyStrongBindingSet<PingService>>();
...@@ -76,7 +75,7 @@ TEST_F(DeferredDestroyStrongBindingSetTest, Destructor) { ...@@ -76,7 +75,7 @@ TEST_F(DeferredDestroyStrongBindingSetTest, Destructor) {
} }
TEST_F(DeferredDestroyStrongBindingSetTest, ConnectionError) { TEST_F(DeferredDestroyStrongBindingSetTest, ConnectionError) {
PingServicePtr ping[4]; mojo::PendingRemote<PingService> ping[4];
DeferredDestroyPingImpl* impl[4]; DeferredDestroyPingImpl* impl[4];
auto bindings = auto bindings =
std::make_unique<DeferredDestroyStrongBindingSet<PingService>>(); std::make_unique<DeferredDestroyStrongBindingSet<PingService>>();
...@@ -112,7 +111,7 @@ TEST_F(DeferredDestroyStrongBindingSetTest, ConnectionError) { ...@@ -112,7 +111,7 @@ TEST_F(DeferredDestroyStrongBindingSetTest, ConnectionError) {
} }
TEST_F(DeferredDestroyStrongBindingSetTest, CloseAllBindings) { TEST_F(DeferredDestroyStrongBindingSetTest, CloseAllBindings) {
PingServicePtr ping[3]; mojo::PendingRemote<PingService> ping[3];
DeferredDestroyPingImpl* impl[3]; DeferredDestroyPingImpl* impl[3];
DeferredDestroyStrongBindingSet<PingService> bindings; DeferredDestroyStrongBindingSet<PingService> bindings;
......
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