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

Unified Diff: mojo/edk/system/core_test_base.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/core.cc ('k') | mojo/edk/system/data_pipe_consumer_dispatcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/core_test_base.cc
diff --git a/mojo/edk/system/core_test_base.cc b/mojo/edk/system/core_test_base.cc
index 2552fd28100674279a4af28c87a11b32504f3811..29b569e8b520da6efb79f5d8afdb666d765ff81a 100644
--- a/mojo/edk/system/core_test_base.cc
+++ b/mojo/edk/system/core_test_base.cc
@@ -7,11 +7,11 @@
#include <vector>
#include "base/logging.h"
-#include "base/memory/ref_counted.h"
#include "mojo/edk/system/configuration.h"
#include "mojo/edk/system/core.h"
#include "mojo/edk/system/dispatcher.h"
#include "mojo/edk/system/memory.h"
+#include "mojo/edk/system/ref_ptr.h"
#include "mojo/public/cpp/system/macros.h"
namespace mojo {
@@ -24,9 +24,8 @@ namespace {
class MockDispatcher : public Dispatcher {
public:
- static scoped_refptr<MockDispatcher> Create(
- CoreTestBase::MockHandleInfo* info) {
- return make_scoped_refptr(new MockDispatcher(info));
+ static RefPtr<MockDispatcher> Create(CoreTestBase::MockHandleInfo* info) {
+ return AdoptRef(new MockDispatcher(info));
}
// |Dispatcher| private methods:
@@ -156,8 +155,7 @@ class MockDispatcher : public Dispatcher {
mutex().AssertHeld();
}
- scoped_refptr<Dispatcher> CreateEquivalentDispatcherAndCloseImplNoLock()
- override {
+ RefPtr<Dispatcher> CreateEquivalentDispatcherAndCloseImplNoLock() override {
return Create(info_);
}
@@ -187,8 +185,10 @@ void CoreTestBase::TearDown() {
MojoHandle CoreTestBase::CreateMockHandle(CoreTestBase::MockHandleInfo* info) {
CHECK(core_);
- scoped_refptr<MockDispatcher> dispatcher = MockDispatcher::Create(info);
- return core_->AddDispatcher(dispatcher);
+ auto dispatcher = MockDispatcher::Create(info);
+ MojoHandle rv = core_->AddDispatcher(dispatcher.get());
+ CHECK_NE(rv, MOJO_HANDLE_INVALID);
+ return rv;
}
// CoreTestBase_MockHandleInfo -------------------------------------------------
« no previous file with comments | « mojo/edk/system/core.cc ('k') | mojo/edk/system/data_pipe_consumer_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698