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

Side by Side Diff: mojo/system/data_pipe_producer_dispatcher.h

Issue 136343004: Mojo: Add a "GetType()" to Dispatchers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MOJO_SYSTEM_DATA_PIPE_PRODUCER_DISPATCHER_H_ 5 #ifndef MOJO_SYSTEM_DATA_PIPE_PRODUCER_DISPATCHER_H_
6 #define MOJO_SYSTEM_DATA_PIPE_PRODUCER_DISPATCHER_H_ 6 #define MOJO_SYSTEM_DATA_PIPE_PRODUCER_DISPATCHER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "mojo/system/dispatcher.h" 11 #include "mojo/system/dispatcher.h"
12 #include "mojo/system/system_impl_export.h" 12 #include "mojo/system/system_impl_export.h"
13 13
14 namespace mojo { 14 namespace mojo {
15 namespace system { 15 namespace system {
16 16
17 class DataPipe; 17 class DataPipe;
18 18
19 // This is the |Dispatcher| implementation for the producer handle for data 19 // This is the |Dispatcher| implementation for the producer handle for data
20 // pipes (created by the Mojo primitive |MojoCreateDataPipe()|). This class is 20 // pipes (created by the Mojo primitive |MojoCreateDataPipe()|). This class is
21 // thread-safe. 21 // thread-safe.
22 class MOJO_SYSTEM_IMPL_EXPORT DataPipeProducerDispatcher : public Dispatcher { 22 class MOJO_SYSTEM_IMPL_EXPORT DataPipeProducerDispatcher : public Dispatcher {
23 public: 23 public:
24 DataPipeProducerDispatcher(); 24 DataPipeProducerDispatcher();
25 25
26 // Must be called before any other methods. 26 // Must be called before any other methods.
27 void Init(scoped_refptr<DataPipe> data_pipe); 27 void Init(scoped_refptr<DataPipe> data_pipe);
28 28
29 virtual Type GetType() OVERRIDE;
30
29 private: 31 private:
30 friend class base::RefCountedThreadSafe<DataPipeProducerDispatcher>; 32 friend class base::RefCountedThreadSafe<DataPipeProducerDispatcher>;
31 virtual ~DataPipeProducerDispatcher(); 33 virtual ~DataPipeProducerDispatcher();
32 34
33 // |Dispatcher| implementation/overrides: 35 // |Dispatcher| implementation/overrides:
34 virtual void CancelAllWaitersNoLock() OVERRIDE; 36 virtual void CancelAllWaitersNoLock() OVERRIDE;
35 virtual MojoResult CloseImplNoLock() OVERRIDE; 37 virtual MojoResult CloseImplNoLock() OVERRIDE;
36 virtual MojoResult WriteDataImplNoLock(const void* elements, 38 virtual MojoResult WriteDataImplNoLock(const void* elements,
37 uint32_t* num_bytes, 39 uint32_t* num_bytes,
38 MojoWriteDataFlags flags) OVERRIDE; 40 MojoWriteDataFlags flags) OVERRIDE;
(...skipping 14 matching lines...) Expand all
53 // Protected by |lock()|: 55 // Protected by |lock()|:
54 scoped_refptr<DataPipe> data_pipe_; // This will be null if closed. 56 scoped_refptr<DataPipe> data_pipe_; // This will be null if closed.
55 57
56 DISALLOW_COPY_AND_ASSIGN(DataPipeProducerDispatcher); 58 DISALLOW_COPY_AND_ASSIGN(DataPipeProducerDispatcher);
57 }; 59 };
58 60
59 } // namespace system 61 } // namespace system
60 } // namespace mojo 62 } // namespace mojo
61 63
62 #endif // MOJO_SYSTEM_DATA_PIPE_PRODUCER_DISPATCHER_H_ 64 #endif // MOJO_SYSTEM_DATA_PIPE_PRODUCER_DISPATCHER_H_
OLDNEW
« no previous file with comments | « mojo/system/data_pipe_consumer_dispatcher.cc ('k') | mojo/system/data_pipe_producer_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698