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

Unified Diff: mojo/edk/system/dispatcher.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/data_pipe_producer_dispatcher.cc ('k') | mojo/edk/system/dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/dispatcher.h
diff --git a/mojo/edk/system/dispatcher.h b/mojo/edk/system/dispatcher.h
index 9b8dafde7fb0855ef0aa449d06b3a18cfa11996e..8c78434e8d3f22adff501803ec546c627768fecc 100644
--- a/mojo/edk/system/dispatcher.h
+++ b/mojo/edk/system/dispatcher.h
@@ -16,8 +16,8 @@
#include "mojo/edk/system/handle_signals_state.h"
#include "mojo/edk/system/memory.h"
#include "mojo/edk/system/mutex.h"
-#include "mojo/edk/system/ref_counted.h"
-#include "mojo/edk/system/ref_ptr.h"
+#include "mojo/edk/util/ref_counted.h"
+#include "mojo/edk/util/ref_ptr.h"
#include "mojo/public/c/system/buffer.h"
#include "mojo/public/c/system/data_pipe.h"
#include "mojo/public/c/system/message_pipe.h"
@@ -42,7 +42,7 @@ class ProxyMessagePipeEndpoint;
class TransportData;
class Awakable;
-using DispatcherVector = std::vector<RefPtr<Dispatcher>>;
+using DispatcherVector = std::vector<util::RefPtr<Dispatcher>>;
namespace test {
@@ -56,7 +56,7 @@ DispatcherTransport DispatcherTryStartTransport(Dispatcher* dispatcher);
// object is thread-safe, with its state being protected by a single mutex
// |mutex_|, which is also made available to implementation subclasses (via the
// |mutex()| method).
-class Dispatcher : public RefCountedThreadSafe<Dispatcher> {
+class Dispatcher : public util::RefCountedThreadSafe<Dispatcher> {
public:
enum class Type {
UNKNOWN = 0,
@@ -114,7 +114,7 @@ class Dispatcher : public RefCountedThreadSafe<Dispatcher> {
// new handle on success).
MojoResult DuplicateBufferHandle(
UserPointer<const MojoDuplicateBufferHandleOptions> options,
- RefPtr<Dispatcher>* new_dispatcher);
+ util::RefPtr<Dispatcher>* new_dispatcher);
MojoResult MapBuffer(
uint64_t offset,
uint64_t num_bytes,
@@ -204,7 +204,7 @@ class Dispatcher : public RefCountedThreadSafe<Dispatcher> {
// Deserialization API.
// Note: This "clears" (i.e., reset to the invalid handle) any platform
// handles that it takes ownership of.
- static RefPtr<Dispatcher> Deserialize(
+ static util::RefPtr<Dispatcher> Deserialize(
Channel* channel,
int32_t type,
const void* source,
@@ -222,7 +222,8 @@ class Dispatcher : public RefCountedThreadSafe<Dispatcher> {
virtual void CancelAllAwakablesNoLock() MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
virtual void CloseImplNoLock() MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
- virtual RefPtr<Dispatcher> CreateEquivalentDispatcherAndCloseImplNoLock()
+ virtual util::RefPtr<Dispatcher>
+ CreateEquivalentDispatcherAndCloseImplNoLock()
MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_) = 0;
// These are to be overridden by subclasses (if necessary). They are never
@@ -261,7 +262,8 @@ class Dispatcher : public RefCountedThreadSafe<Dispatcher> {
MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
virtual MojoResult DuplicateBufferHandleImplNoLock(
UserPointer<const MojoDuplicateBufferHandleOptions> options,
- RefPtr<Dispatcher>* new_dispatcher) MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
+ util::RefPtr<Dispatcher>* new_dispatcher)
+ MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
virtual MojoResult MapBufferImplNoLock(
uint64_t offset,
uint64_t num_bytes,
@@ -325,7 +327,7 @@ class Dispatcher : public RefCountedThreadSafe<Dispatcher> {
// dispatcher will look as though it was closed, but the resource it
// represents will be assigned to the new dispatcher. This must be called
// under the dispatcher's lock.
- RefPtr<Dispatcher> CreateEquivalentDispatcherAndCloseNoLock()
+ util::RefPtr<Dispatcher> CreateEquivalentDispatcherAndCloseNoLock()
MOJO_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
// API to serialize dispatchers to a |Channel|, exposed to only
@@ -396,7 +398,8 @@ class DispatcherTransport {
return dispatcher_->IsBusyNoLock();
}
void Close() MOJO_NOT_THREAD_SAFE { dispatcher_->CloseNoLock(); }
- RefPtr<Dispatcher> CreateEquivalentDispatcherAndClose() MOJO_NOT_THREAD_SAFE {
+ util::RefPtr<Dispatcher> CreateEquivalentDispatcherAndClose()
+ MOJO_NOT_THREAD_SAFE {
return dispatcher_->CreateEquivalentDispatcherAndCloseNoLock();
}
« no previous file with comments | « mojo/edk/system/data_pipe_producer_dispatcher.cc ('k') | mojo/edk/system/dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698