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

Unified Diff: mojo/edk/embedder/system_impl_private_entrypoints.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/embedder/embedder.cc ('k') | mojo/edk/system/channel_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/embedder/system_impl_private_entrypoints.cc
diff --git a/mojo/edk/embedder/system_impl_private_entrypoints.cc b/mojo/edk/embedder/system_impl_private_entrypoints.cc
index 475ffa76b06b5bb21763e23298ce294670b06980..e2a369b465773b408140d674220335ec8dfe9cb6 100644
--- a/mojo/edk/embedder/system_impl_private_entrypoints.cc
+++ b/mojo/edk/embedder/system_impl_private_entrypoints.cc
@@ -5,6 +5,7 @@
#include "mojo/edk/embedder/embedder_internal.h"
#include "mojo/edk/system/core.h"
#include "mojo/edk/system/dispatcher.h"
+#include "mojo/edk/system/ref_ptr.h"
#include "mojo/public/c/system/buffer.h"
#include "mojo/public/c/system/data_pipe.h"
#include "mojo/public/c/system/functions.h"
@@ -15,6 +16,7 @@ using mojo::embedder::internal::g_core;
using mojo::system::Core;
using mojo::system::Dispatcher;
using mojo::system::MakeUserPointer;
+using mojo::system::RefPtr;
// Definitions of the system functions, but with an explicit parameter for the
// core object rather than using the default singleton. Also includes functions
@@ -48,12 +50,12 @@ MojoResult MojoSystemImplTransferHandle(MojoSystemImpl from_system,
if (result_handle == nullptr)
return MOJO_RESULT_INVALID_ARGUMENT;
- scoped_refptr<Dispatcher> d;
+ RefPtr<Dispatcher> d;
MojoResult result = from_core->GetAndRemoveDispatcher(handle, &d);
if (result != MOJO_RESULT_OK)
return result;
- MojoHandle created_handle = to_core->AddDispatcher(d);
+ MojoHandle created_handle = to_core->AddDispatcher(d.get());
if (created_handle == MOJO_HANDLE_INVALID) {
// The handle has been lost, unfortunately. There's no guarentee we can put
// it back where it came from, or get the original ID back. Holding locks
« no previous file with comments | « mojo/edk/embedder/embedder.cc ('k') | mojo/edk/system/channel_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698