| OLD | NEW |
| 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_MESSAGE_PIPE_DISPATCHER_H_ | 5 #ifndef MOJO_SYSTEM_MESSAGE_PIPE_DISPATCHER_H_ |
| 6 #define MOJO_SYSTEM_MESSAGE_PIPE_DISPATCHER_H_ | 6 #define MOJO_SYSTEM_MESSAGE_PIPE_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/public/system/system_export.h" |
| 11 #include "mojo/system/dispatcher.h" | 12 #include "mojo/system/dispatcher.h" |
| 12 | 13 |
| 13 namespace mojo { | 14 namespace mojo { |
| 14 namespace system { | 15 namespace system { |
| 15 | 16 |
| 16 class MessagePipe; | 17 class MessagePipe; |
| 17 | 18 |
| 18 // This is the |Dispatcher| implementation for message pipes (created by the | 19 // This is the |Dispatcher| implementation for message pipes (created by the |
| 19 // Mojo primitive |MojoCreateMessagePipe()|). This class is thread-safe. | 20 // Mojo primitive |MojoCreateMessagePipe()|). This class is thread-safe. |
| 20 class MessagePipeDispatcher : public Dispatcher { | 21 class MOJO_SYSTEM_EXPORT MessagePipeDispatcher : public Dispatcher { |
| 21 public: | 22 public: |
| 22 MessagePipeDispatcher(); | 23 MessagePipeDispatcher(); |
| 23 | 24 |
| 24 // Must be called before any other methods. (This method is not thread-safe.) | 25 // Must be called before any other methods. (This method is not thread-safe.) |
| 25 void Init(scoped_refptr<MessagePipe> message_pipe, unsigned port); | 26 void Init(scoped_refptr<MessagePipe> message_pipe, unsigned port); |
| 26 | 27 |
| 27 private: | 28 private: |
| 28 friend class base::RefCountedThreadSafe<MessagePipeDispatcher>; | 29 friend class base::RefCountedThreadSafe<MessagePipeDispatcher>; |
| 29 virtual ~MessagePipeDispatcher(); | 30 virtual ~MessagePipeDispatcher(); |
| 30 | 31 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 52 scoped_refptr<MessagePipe> message_pipe_; // This will be null if closed. | 53 scoped_refptr<MessagePipe> message_pipe_; // This will be null if closed. |
| 53 unsigned port_; | 54 unsigned port_; |
| 54 | 55 |
| 55 DISALLOW_COPY_AND_ASSIGN(MessagePipeDispatcher); | 56 DISALLOW_COPY_AND_ASSIGN(MessagePipeDispatcher); |
| 56 }; | 57 }; |
| 57 | 58 |
| 58 } // namespace system | 59 } // namespace system |
| 59 } // namespace mojo | 60 } // namespace mojo |
| 60 | 61 |
| 61 #endif // MOJO_SYSTEM_MESSAGE_PIPE_DISPATCHER_H_ | 62 #endif // MOJO_SYSTEM_MESSAGE_PIPE_DISPATCHER_H_ |
| OLD | NEW |