| Index: mojo/edk/system/data_pipe_consumer_dispatcher.h
|
| diff --git a/mojo/edk/system/data_pipe_consumer_dispatcher.h b/mojo/edk/system/data_pipe_consumer_dispatcher.h
|
| index 5566d90e428cfb1b3532ed9c2d4f24875901eeac..eaba22acd24771f0de34586f33f91b513d72eae2 100644
|
| --- a/mojo/edk/system/data_pipe_consumer_dispatcher.h
|
| +++ b/mojo/edk/system/data_pipe_consumer_dispatcher.h
|
| @@ -9,7 +9,9 @@
|
| #include <stdint.h>
|
|
|
| #include "base/memory/ref_counted.h"
|
| +#include "mojo/edk/embedder/platform_shared_buffer.h"
|
| #include "mojo/edk/system/awakable_list.h"
|
| +#include "mojo/edk/system/data_pipe.h"
|
| #include "mojo/edk/system/dispatcher.h"
|
| #include "mojo/edk/system/raw_channel.h"
|
| #include "mojo/edk/system/system_impl_export.h"
|
| @@ -31,7 +33,13 @@ class MOJO_SYSTEM_IMPL_EXPORT DataPipeConsumerDispatcher final
|
|
|
| // Must be called before any other methods.
|
| void Init(ScopedPlatformHandle message_pipe,
|
| - char* serialized_read_buffer, size_t serialized_read_buffer_size);
|
| + char* serialized_write_buffer,
|
| + size_t serialized_write_buffer_size,
|
| + char* serialized_read_buffer,
|
| + size_t serialized_read_buffer_size,
|
| + ScopedPlatformHandle shared_buffer_handle,
|
| + size_t ring_buffer_start,
|
| + size_t ring_buffer_size);
|
|
|
| // |Dispatcher| public methods:
|
| Type GetType() const override;
|
| @@ -44,7 +52,7 @@ class MOJO_SYSTEM_IMPL_EXPORT DataPipeConsumerDispatcher final
|
| PlatformHandleVector* platform_handles);
|
|
|
| private:
|
| - DataPipeConsumerDispatcher(const MojoCreateDataPipeOptions& options);
|
| + explicit DataPipeConsumerDispatcher(const MojoCreateDataPipeOptions& options);
|
| ~DataPipeConsumerDispatcher() override;
|
|
|
| void InitOnIO();
|
| @@ -85,16 +93,11 @@ class MOJO_SYSTEM_IMPL_EXPORT DataPipeConsumerDispatcher final
|
| ScopedPlatformHandleVectorPtr platform_handles) override;
|
| void OnError(Error error) override;
|
|
|
| - // See comment in MessagePipeDispatcher for this method.
|
| - void SerializeInternal();
|
| + bool ProcessCommand(const DataPipeCommandHeader& command,
|
| + ScopedPlatformHandleVectorPtr platform_handles);
|
|
|
| - MojoCreateDataPipeOptions options_;
|
| + scoped_refptr<DataPipe> data_pipe_;
|
|
|
| - // Protected by |lock()|:
|
| - RawChannel* channel_; // This will be null if closed.
|
| -
|
| - // Queue of incoming messages.
|
| - std::vector<char> data_;
|
| AwakableList awakable_list_;
|
|
|
| // If DispatcherTransport is created. Must be set before lock() is called to
|
| @@ -102,18 +105,10 @@ class MOJO_SYSTEM_IMPL_EXPORT DataPipeConsumerDispatcher final
|
| base::Lock started_transport_;
|
|
|
| bool calling_init_;
|
| + bool peer_closed_;
|
|
|
| bool in_two_phase_read_;
|
| - uint32_t two_phase_max_bytes_read_;
|
| - // If we get data from the channel while we're in two-phase read, we can't
|
| - // resize data_ since it's being used. So instead we store it temporarly.
|
| - std::vector<char> data_received_during_two_phase_read_;
|
| -
|
| - bool error_;
|
| -
|
| - bool serialized_;
|
| - std::vector<char> serialized_read_buffer_;
|
| - ScopedPlatformHandle serialized_platform_handle_;
|
| + size_t two_phase_max_bytes_read_;
|
|
|
| MOJO_DISALLOW_COPY_AND_ASSIGN(DataPipeConsumerDispatcher);
|
| };
|
|
|