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

Unified Diff: mojo/edk/system/handle_table.h

Issue 1423713009: EDK: Move ref counting classes to mojo/edk/util. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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/endpoint_relayer_unittest.cc ('k') | mojo/edk/system/handle_table.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/handle_table.h
diff --git a/mojo/edk/system/handle_table.h b/mojo/edk/system/handle_table.h
index 91d3669a3f7774d8a84a8383db081637831151dd..26c9c998c9904ddebffb8d1eb54beab117210e5f 100644
--- a/mojo/edk/system/handle_table.h
+++ b/mojo/edk/system/handle_table.h
@@ -9,7 +9,7 @@
#include <utility>
#include <vector>
-#include "mojo/edk/system/ref_ptr.h"
+#include "mojo/edk/util/ref_ptr.h"
#include "mojo/public/c/system/types.h"
#include "mojo/public/cpp/system/macros.h"
@@ -20,7 +20,7 @@ class Core;
class Dispatcher;
class DispatcherTransport;
-using DispatcherVector = std::vector<RefPtr<Dispatcher>>;
+using DispatcherVector = std::vector<util::RefPtr<Dispatcher>>;
// Test-only function (defined/used in embedder/test_embedder.cc). Declared here
// so it can be friended.
@@ -46,7 +46,7 @@ class HandleTable {
// handle.
// WARNING: For efficiency, this returns a dumb pointer. If you're going to
// use the result outside |Core|'s lock, you MUST take a reference (e.g., by
- // storing the result inside a |RefPtr|).
+ // storing the result inside a |util::RefPtr|).
Dispatcher* GetDispatcher(MojoHandle handle);
// On success, gets the dispatcher for a given handle (which should not be
@@ -55,7 +55,7 @@ class HandleTable {
// |MOJO_RESULT_INVALID_ARGUMENT| if there's no dispatcher for the given
// handle or |MOJO_RESULT_BUSY| if the handle is marked as busy.)
MojoResult GetAndRemoveDispatcher(MojoHandle handle,
- RefPtr<Dispatcher>* dispatcher);
+ util::RefPtr<Dispatcher>* dispatcher);
// Adds a dispatcher (which must be valid), returning the handle for it.
// Returns |MOJO_HANDLE_INVALID| on failure (if the handle table is full).
@@ -118,16 +118,16 @@ class HandleTable {
// closed (or learning about this too late).
struct Entry {
Entry();
- explicit Entry(RefPtr<Dispatcher>&& dispatcher);
+ explicit Entry(util::RefPtr<Dispatcher>&& dispatcher);
~Entry();
- RefPtr<Dispatcher> dispatcher;
+ util::RefPtr<Dispatcher> dispatcher;
bool busy;
};
using HandleToEntryMap = std::unordered_map<MojoHandle, Entry>;
// Adds the given dispatcher to the handle table, not doing any size checks.
- MojoHandle AddDispatcherNoSizeCheck(RefPtr<Dispatcher>&& dispatcher);
+ MojoHandle AddDispatcherNoSizeCheck(util::RefPtr<Dispatcher>&& dispatcher);
HandleToEntryMap handle_to_entry_map_;
MojoHandle next_handle_; // Invariant: never |MOJO_HANDLE_INVALID|.
« no previous file with comments | « mojo/edk/system/endpoint_relayer_unittest.cc ('k') | mojo/edk/system/handle_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698