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

Unified Diff: mojo/edk/system/multiprocess_message_pipe_unittest.cc

Issue 1412283002: Convert mojo::system::Dispatcher to use our new refcounting stuff (instead of base's). (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: no change Created 5 years, 2 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
« no previous file with comments | « mojo/edk/system/message_pipe_dispatcher_unittest.cc ('k') | mojo/edk/system/platform_handle_dispatcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/multiprocess_message_pipe_unittest.cc
diff --git a/mojo/edk/system/multiprocess_message_pipe_unittest.cc b/mojo/edk/system/multiprocess_message_pipe_unittest.cc
index 7f33e96d07c1277ac7aaa292f10b63b6d3d328e6..4db05f6428f4b8e22c6b558da078066f54680859 100644
--- a/mojo/edk/system/multiprocess_message_pipe_unittest.cc
+++ b/mojo/edk/system/multiprocess_message_pipe_unittest.cc
@@ -242,7 +242,7 @@ MOJO_MULTIPROCESS_TEST_CHILD_MAIN(CheckSharedBuffer) {
CHECK_EQ(dispatchers[0]->GetType(), Dispatcher::Type::SHARED_BUFFER);
- scoped_refptr<SharedBufferDispatcher> dispatcher(
+ RefPtr<SharedBufferDispatcher> dispatcher(
static_cast<SharedBufferDispatcher*>(dispatchers[0].get()));
// Make a mapping.
@@ -310,11 +310,11 @@ TEST_F(MultiprocessMessagePipeTest, MAYBE_SharedBufferPassing) {
Init(std::move(ep));
// Make a shared buffer.
- scoped_refptr<SharedBufferDispatcher> dispatcher;
- EXPECT_EQ(MOJO_RESULT_OK, SharedBufferDispatcher::Create(
- platform_support(),
- SharedBufferDispatcher::kDefaultCreateOptions,
- 100, &dispatcher));
+ MojoResult result = MOJO_RESULT_INTERNAL;
+ auto dispatcher = SharedBufferDispatcher::Create(
+ platform_support(), SharedBufferDispatcher::kDefaultCreateOptions, 100,
+ &result);
+ EXPECT_EQ(MOJO_RESULT_OK, result);
ASSERT_TRUE(dispatcher);
// Make a mapping.
@@ -339,7 +339,7 @@ TEST_F(MultiprocessMessagePipeTest, MAYBE_SharedBufferPassing) {
MOJO_WRITE_MESSAGE_FLAG_NONE));
transport.End();
- EXPECT_TRUE(dispatcher->HasOneRef());
+ dispatcher->AssertHasOneRef();
dispatcher = nullptr;
// Wait for a message from the child.
@@ -425,7 +425,7 @@ MOJO_MULTIPROCESS_TEST_CHILD_MAIN(CheckPlatformHandleFile) {
for (int i = 0; i < num_handles; ++i) {
CHECK_EQ(dispatchers[i]->GetType(), Dispatcher::Type::PLATFORM_HANDLE);
- scoped_refptr<PlatformHandleDispatcher> dispatcher(
+ RefPtr<PlatformHandleDispatcher> dispatcher(
static_cast<PlatformHandleDispatcher*>(dispatchers[i].get()));
embedder::ScopedPlatformHandle h = dispatcher->PassPlatformHandle().Pass();
CHECK(h.is_valid());
@@ -456,7 +456,7 @@ TEST_P(MultiprocessMessagePipeTestWithPipeCount, PlatformHandlePassing) {
auto mp = MessagePipe::CreateLocalProxy(&ep);
Init(std::move(ep));
- std::vector<scoped_refptr<PlatformHandleDispatcher>> dispatchers;
+ std::vector<RefPtr<PlatformHandleDispatcher>> dispatchers;
std::vector<DispatcherTransport> transports;
size_t pipe_count = GetParam();
@@ -467,7 +467,7 @@ TEST_P(MultiprocessMessagePipeTestWithPipeCount, PlatformHandlePassing) {
fflush(fp.get());
rewind(fp.get());
- scoped_refptr<PlatformHandleDispatcher> dispatcher =
+ auto dispatcher =
PlatformHandleDispatcher::Create(embedder::ScopedPlatformHandle(
mojo::test::PlatformHandleFromFILE(fp.Pass())));
dispatchers.push_back(dispatcher);
@@ -486,7 +486,7 @@ TEST_P(MultiprocessMessagePipeTestWithPipeCount, PlatformHandlePassing) {
for (size_t i = 0; i < pipe_count; ++i) {
transports[i].End();
- EXPECT_TRUE(dispatchers[i]->HasOneRef());
+ dispatchers[i]->AssertHasOneRef();
}
dispatchers.clear();
« no previous file with comments | « mojo/edk/system/message_pipe_dispatcher_unittest.cc ('k') | mojo/edk/system/platform_handle_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698