| 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_EDK_SYSTEM_DATA_PIPE_CONSUMER_DISPATCHER_H_ | 5 #ifndef MOJO_EDK_SYSTEM_DATA_PIPE_CONSUMER_DISPATCHER_H_ |
| 6 #define MOJO_EDK_SYSTEM_DATA_PIPE_CONSUMER_DISPATCHER_H_ | 6 #define MOJO_EDK_SYSTEM_DATA_PIPE_CONSUMER_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include "mojo/edk/system/dispatcher.h" | 8 #include "mojo/edk/system/dispatcher.h" |
| 9 #include "mojo/edk/util/ref_ptr.h" | 9 #include "mojo/edk/util/ref_ptr.h" |
| 10 #include "mojo/edk/util/thread_annotations.h" | 10 #include "mojo/edk/util/thread_annotations.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 public: | 22 public: |
| 23 static util::RefPtr<DataPipeConsumerDispatcher> Create() { | 23 static util::RefPtr<DataPipeConsumerDispatcher> Create() { |
| 24 return AdoptRef(new DataPipeConsumerDispatcher()); | 24 return AdoptRef(new DataPipeConsumerDispatcher()); |
| 25 } | 25 } |
| 26 | 26 |
| 27 // Must be called before any other methods. | 27 // Must be called before any other methods. |
| 28 void Init(util::RefPtr<DataPipe>&& data_pipe) MOJO_NOT_THREAD_SAFE; | 28 void Init(util::RefPtr<DataPipe>&& data_pipe) MOJO_NOT_THREAD_SAFE; |
| 29 | 29 |
| 30 // |Dispatcher| public methods: | 30 // |Dispatcher| public methods: |
| 31 Type GetType() const override; | 31 Type GetType() const override; |
| 32 bool SupportsEntrypointClass(EntrypointClass entrypoint_class) const override; |
| 32 | 33 |
| 33 // The "opposite" of |SerializeAndClose()|. (Typically this is called by | 34 // The "opposite" of |SerializeAndClose()|. (Typically this is called by |
| 34 // |Dispatcher::Deserialize()|.) | 35 // |Dispatcher::Deserialize()|.) |
| 35 static util::RefPtr<DataPipeConsumerDispatcher> | 36 static util::RefPtr<DataPipeConsumerDispatcher> |
| 36 Deserialize(Channel* channel, const void* source, size_t size); | 37 Deserialize(Channel* channel, const void* source, size_t size); |
| 37 | 38 |
| 38 // Get access to the |DataPipe| for testing. | 39 // Get access to the |DataPipe| for testing. |
| 39 DataPipe* GetDataPipeForTest(); | 40 DataPipe* GetDataPipeForTest(); |
| 40 | 41 |
| 41 private: | 42 private: |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 // This will be null if closed. | 82 // This will be null if closed. |
| 82 util::RefPtr<DataPipe> data_pipe_ MOJO_GUARDED_BY(mutex()); | 83 util::RefPtr<DataPipe> data_pipe_ MOJO_GUARDED_BY(mutex()); |
| 83 | 84 |
| 84 MOJO_DISALLOW_COPY_AND_ASSIGN(DataPipeConsumerDispatcher); | 85 MOJO_DISALLOW_COPY_AND_ASSIGN(DataPipeConsumerDispatcher); |
| 85 }; | 86 }; |
| 86 | 87 |
| 87 } // namespace system | 88 } // namespace system |
| 88 } // namespace mojo | 89 } // namespace mojo |
| 89 | 90 |
| 90 #endif // MOJO_EDK_SYSTEM_DATA_PIPE_CONSUMER_DISPATCHER_H_ | 91 #endif // MOJO_EDK_SYSTEM_DATA_PIPE_CONSUMER_DISPATCHER_H_ |
| OLD | NEW |