diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-22 04:58:19 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-22 04:58:19 +0000 |
commit | b273df104e58880d9b3218ef03d038d3ba29e3f9 (patch) | |
tree | b579531215e12892ef12752bbd55463d699effd0 /mojo | |
parent | b3e0f85cc30cb81965f4db728e2800e9e1394d9f (diff) | |
download | chromium_src-b273df104e58880d9b3218ef03d038d3ba29e3f9.zip chromium_src-b273df104e58880d9b3218ef03d038d3ba29e3f9.tar.gz chromium_src-b273df104e58880d9b3218ef03d038d3ba29e3f9.tar.bz2 |
Mojo: Cleanup of various Dispatcher subclasses.
(As suggested in https://codereview.chromium.org/196103009/.)
R=darin@chromium.org
TBR=darin@chromium.org
Review URL: https://codereview.chromium.org/208643009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@258783 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'mojo')
-rw-r--r-- | mojo/system/core_test_base.cc | 4 | ||||
-rw-r--r-- | mojo/system/data_pipe_consumer_dispatcher.h | 4 | ||||
-rw-r--r-- | mojo/system/data_pipe_producer_dispatcher.h | 4 | ||||
-rw-r--r-- | mojo/system/dispatcher.h | 4 | ||||
-rw-r--r-- | mojo/system/message_pipe_dispatcher.h | 4 | ||||
-rw-r--r-- | mojo/system/simple_dispatcher.h | 4 |
6 files changed, 11 insertions, 13 deletions
diff --git a/mojo/system/core_test_base.cc b/mojo/system/core_test_base.cc index 40af0e0..89b8fb3 100644 --- a/mojo/system/core_test_base.cc +++ b/mojo/system/core_test_base.cc @@ -30,17 +30,17 @@ class MockDispatcher : public Dispatcher { info_->IncrementCtorCallCount(); } + // |Dispatcher| private methods: virtual Type GetType() const OVERRIDE { return kTypeUnknown; } private: - friend class base::RefCountedThreadSafe<MockDispatcher>; virtual ~MockDispatcher() { info_->IncrementDtorCallCount(); } - // |Dispatcher| implementation/overrides: + // |Dispatcher| protected methods: virtual void CloseImplNoLock() OVERRIDE { info_->IncrementCloseCallCount(); lock().AssertAcquired(); diff --git a/mojo/system/data_pipe_consumer_dispatcher.h b/mojo/system/data_pipe_consumer_dispatcher.h index 1a62afd..ef60b91 100644 --- a/mojo/system/data_pipe_consumer_dispatcher.h +++ b/mojo/system/data_pipe_consumer_dispatcher.h @@ -26,13 +26,13 @@ class MOJO_SYSTEM_IMPL_EXPORT DataPipeConsumerDispatcher : public Dispatcher { // Must be called before any other methods. void Init(scoped_refptr<DataPipe> data_pipe); + // |Dispatcher| public methods: virtual Type GetType() const OVERRIDE; private: - friend class base::RefCountedThreadSafe<DataPipeConsumerDispatcher>; virtual ~DataPipeConsumerDispatcher(); - // |Dispatcher| implementation/overrides: + // |Dispatcher| protected methods: virtual void CancelAllWaitersNoLock() OVERRIDE; virtual void CloseImplNoLock() OVERRIDE; virtual scoped_refptr<Dispatcher> diff --git a/mojo/system/data_pipe_producer_dispatcher.h b/mojo/system/data_pipe_producer_dispatcher.h index 4f362a7..5f7b864 100644 --- a/mojo/system/data_pipe_producer_dispatcher.h +++ b/mojo/system/data_pipe_producer_dispatcher.h @@ -26,13 +26,13 @@ class MOJO_SYSTEM_IMPL_EXPORT DataPipeProducerDispatcher : public Dispatcher { // Must be called before any other methods. void Init(scoped_refptr<DataPipe> data_pipe); + // |Dispatcher| public methods: virtual Type GetType() const OVERRIDE; private: - friend class base::RefCountedThreadSafe<DataPipeProducerDispatcher>; virtual ~DataPipeProducerDispatcher(); - // |Dispatcher| implementation/overrides: + // |Dispatcher| protected methods: virtual void CancelAllWaitersNoLock() OVERRIDE; virtual void CloseImplNoLock() OVERRIDE; virtual scoped_refptr<Dispatcher> diff --git a/mojo/system/dispatcher.h b/mojo/system/dispatcher.h index 309e2cd..fc11ac7 100644 --- a/mojo/system/dispatcher.h +++ b/mojo/system/dispatcher.h @@ -173,9 +173,9 @@ class MOJO_SYSTEM_IMPL_EXPORT Dispatcher : }; protected: - Dispatcher(); - friend class base::RefCountedThreadSafe<Dispatcher>; + + Dispatcher(); virtual ~Dispatcher(); // These are to be overridden by subclasses (if necessary). They are called diff --git a/mojo/system/message_pipe_dispatcher.h b/mojo/system/message_pipe_dispatcher.h index 34e4b96..ab3067c 100644 --- a/mojo/system/message_pipe_dispatcher.h +++ b/mojo/system/message_pipe_dispatcher.h @@ -28,6 +28,7 @@ class MOJO_SYSTEM_IMPL_EXPORT MessagePipeDispatcher : public Dispatcher { // Must be called before any other methods. (This method is not thread-safe.) void Init(scoped_refptr<MessagePipe> message_pipe, unsigned port); + // |Dispatcher| public methods: virtual Type GetType() const OVERRIDE; // Creates a |MessagePipe| with a local endpoint (at port 0) and a proxy @@ -45,7 +46,6 @@ class MOJO_SYSTEM_IMPL_EXPORT MessagePipeDispatcher : public Dispatcher { private: friend class MessagePipeDispatcherTransport; - friend class base::RefCountedThreadSafe<MessagePipeDispatcher>; virtual ~MessagePipeDispatcher(); // Gets a dumb pointer to |message_pipe_|. This must be called under the @@ -56,7 +56,7 @@ class MOJO_SYSTEM_IMPL_EXPORT MessagePipeDispatcher : public Dispatcher { // Similarly for the port. unsigned GetPortNoLock() const; - // |Dispatcher| implementation/overrides: + // |Dispatcher| protected methods: virtual void CancelAllWaitersNoLock() OVERRIDE; virtual void CloseImplNoLock() OVERRIDE; virtual scoped_refptr<Dispatcher> diff --git a/mojo/system/simple_dispatcher.h b/mojo/system/simple_dispatcher.h index 0ad49ac..d2934fa 100644 --- a/mojo/system/simple_dispatcher.h +++ b/mojo/system/simple_dispatcher.h @@ -22,8 +22,6 @@ namespace system { class MOJO_SYSTEM_IMPL_EXPORT SimpleDispatcher : public Dispatcher { protected: SimpleDispatcher(); - - friend class base::RefCountedThreadSafe<SimpleDispatcher>; virtual ~SimpleDispatcher(); // To be called by subclasses when the state changes (so @@ -39,7 +37,7 @@ class MOJO_SYSTEM_IMPL_EXPORT SimpleDispatcher : public Dispatcher { virtual MojoWaitFlags SatisfiedFlagsNoLock() const = 0; virtual MojoWaitFlags SatisfiableFlagsNoLock() const = 0; - // |Dispatcher| implementation/overrides: + // |Dispatcher| protected methods: virtual void CancelAllWaitersNoLock() OVERRIDE; virtual MojoResult AddWaiterImplNoLock(Waiter* waiter, MojoWaitFlags flags, |