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

Unified Diff: mojo/edk/system/platform_handle_dispatcher.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
Index: mojo/edk/system/platform_handle_dispatcher.cc
diff --git a/mojo/edk/system/platform_handle_dispatcher.cc b/mojo/edk/system/platform_handle_dispatcher.cc
index 681b40686344d6a6ee3433b9210317f84bfa41e6..f9a9f96244bb3aa1f602e8772b2386966c22f065 100644
--- a/mojo/edk/system/platform_handle_dispatcher.cc
+++ b/mojo/edk/system/platform_handle_dispatcher.cc
@@ -31,7 +31,7 @@ Dispatcher::Type PlatformHandleDispatcher::GetType() const {
}
// static
-scoped_refptr<PlatformHandleDispatcher> PlatformHandleDispatcher::Deserialize(
+RefPtr<PlatformHandleDispatcher> PlatformHandleDispatcher::Deserialize(
Channel* channel,
const void* source,
size_t size,
@@ -77,7 +77,7 @@ void PlatformHandleDispatcher::CloseImplNoLock() {
platform_handle_.reset();
}
-scoped_refptr<Dispatcher>
+RefPtr<Dispatcher>
PlatformHandleDispatcher::CreateEquivalentDispatcherAndCloseImplNoLock() {
mutex().AssertHeld();
return Create(platform_handle_.Pass());
@@ -87,7 +87,7 @@ void PlatformHandleDispatcher::StartSerializeImplNoLock(
Channel* /*channel*/,
size_t* max_size,
size_t* max_platform_handles) {
- DCHECK(HasOneRef()); // Only one ref => no need to take the lock.
+ AssertHasOneRef(); // Only one ref => no need to take the lock.
*max_size = sizeof(SerializedPlatformHandleDispatcher);
*max_platform_handles = 1;
}
@@ -97,7 +97,7 @@ bool PlatformHandleDispatcher::EndSerializeAndCloseImplNoLock(
void* destination,
size_t* actual_size,
embedder::PlatformHandleVector* platform_handles) {
- DCHECK(HasOneRef()); // Only one ref => no need to take the lock.
+ AssertHasOneRef(); // Only one ref => no need to take the lock.
SerializedPlatformHandleDispatcher* serialization =
static_cast<SerializedPlatformHandleDispatcher*>(destination);
« no previous file with comments | « mojo/edk/system/platform_handle_dispatcher.h ('k') | mojo/edk/system/platform_handle_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698