Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(276)

Unified Diff: mojo/public/cpp/bindings/tests/associated_interface_unittest.cc

Issue 1991463002: Mojo: Expose untyped associated endpoints through public API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/public/cpp/bindings/tests/associated_interface_unittest.cc
diff --git a/mojo/public/cpp/bindings/tests/associated_interface_unittest.cc b/mojo/public/cpp/bindings/tests/associated_interface_unittest.cc
index 13dfc459243c19ece0f1ae2d58fc133dd1b9ce0d..bba0bad192d0468d96d1e8fa921a135f727b07de 100644
--- a/mojo/public/cpp/bindings/tests/associated_interface_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/associated_interface_unittest.cc
@@ -26,10 +26,7 @@ namespace mojo {
namespace test {
namespace {
-using mojo::internal::AssociatedInterfacePtrInfoHelper;
-using mojo::internal::AssociatedInterfaceRequestHelper;
using mojo::internal::MultiplexRouter;
-using mojo::internal::ScopedInterfaceEndpointHandle;
class IntegerSenderImpl : public IntegerSender {
public:
@@ -99,33 +96,21 @@ class AssociatedInterfaceTest : public testing::Test {
AssociatedInterfacePtrInfo<T> EmulatePassingAssociatedPtrInfo(
AssociatedInterfacePtrInfo<T> ptr_info,
scoped_refptr<MultiplexRouter> target) {
- ScopedInterfaceEndpointHandle handle =
- AssociatedInterfacePtrInfoHelper::PassHandle(&ptr_info);
+ ScopedInterfaceEndpointHandle handle = ptr_info.PassHandle();
CHECK(!handle.is_local());
-
- ScopedInterfaceEndpointHandle new_handle =
- target->CreateLocalEndpointHandle(handle.release());
-
- AssociatedInterfacePtrInfo<T> result;
- AssociatedInterfacePtrInfoHelper::SetHandle(&result, std::move(new_handle));
- result.set_version(ptr_info.version());
- return std::move(result);
+ return AssociatedInterfacePtrInfo<T>(
+ target->CreateLocalEndpointHandle(handle.release()),
+ ptr_info.version());
}
template <typename T>
AssociatedInterfaceRequest<T> EmulatePassingAssociatedRequest(
AssociatedInterfaceRequest<T> request,
scoped_refptr<MultiplexRouter> target) {
- ScopedInterfaceEndpointHandle handle =
- AssociatedInterfaceRequestHelper::PassHandle(&request);
+ ScopedInterfaceEndpointHandle handle = request.PassHandle();
CHECK(!handle.is_local());
-
- ScopedInterfaceEndpointHandle new_handle =
- target->CreateLocalEndpointHandle(handle.release());
-
- AssociatedInterfaceRequest<T> result;
- AssociatedInterfaceRequestHelper::SetHandle(&result, std::move(new_handle));
- return std::move(result);
+ return MakeAssociatedRequest<T>(
+ target->CreateLocalEndpointHandle(handle.release()));
}
// Okay to call from any thread.

Powered by Google App Engine
This is Rietveld 408576698