| Index: mojo/system/raw_channel.h
|
| diff --git a/mojo/system/raw_channel.h b/mojo/system/raw_channel.h
|
| index 9ebd679af22f48354f898b83d05980a6c2cd75fa..8021e2fbd3071799fca075944e63262c7df3f24b 100644
|
| --- a/mojo/system/raw_channel.h
|
| +++ b/mojo/system/raw_channel.h
|
| @@ -185,14 +185,29 @@ class MOJO_SYSTEM_IMPL_EXPORT RawChannel {
|
|
|
| RawChannel();
|
|
|
| + // Must be called on the I/O thread WITHOUT |write_lock_| held.
|
| + void OnReadCompleted(bool result, size_t bytes_read);
|
| + // Must be called on the I/O thread WITHOUT |write_lock_| held.
|
| + void OnWriteCompleted(bool result,
|
| + size_t platform_handles_written,
|
| + size_t bytes_written);
|
| +
|
| base::MessageLoopForIO* message_loop_for_io() { return message_loop_for_io_; }
|
| base::Lock& write_lock() { return write_lock_; }
|
|
|
| - // Only accessed on the I/O thread.
|
| - ReadBuffer* read_buffer();
|
| + // Should only be called on the I/O thread.
|
| + ReadBuffer* read_buffer() { return read_buffer_.get(); }
|
| +
|
| + // Only called under |write_lock_|.
|
| + WriteBuffer* write_buffer_no_lock() {
|
| + write_lock_.AssertAcquired();
|
| + return write_buffer_.get();
|
| + }
|
|
|
| - // Only accessed under |write_lock_|.
|
| - WriteBuffer* write_buffer_no_lock();
|
| + // Adds |message| to the write message queue. Implementation subclasses may
|
| + // override this to add any additional "control" messages needed. This is
|
| + // called (on any thread) with |write_lock_| held.
|
| + virtual void EnqueueMessageNoLock(scoped_ptr<MessageInTransit> message);
|
|
|
| // Reads into |read_buffer()|.
|
| // This class guarantees that:
|
| @@ -249,13 +264,6 @@ class MOJO_SYSTEM_IMPL_EXPORT RawChannel {
|
| scoped_ptr<ReadBuffer> read_buffer,
|
| scoped_ptr<WriteBuffer> write_buffer) = 0;
|
|
|
| - // Must be called on the I/O thread WITHOUT |write_lock_| held.
|
| - void OnReadCompleted(bool result, size_t bytes_read);
|
| - // Must be called on the I/O thread WITHOUT |write_lock_| held.
|
| - void OnWriteCompleted(bool result,
|
| - size_t platform_handles_written,
|
| - size_t bytes_written);
|
| -
|
| private:
|
| // Calls |delegate_->OnFatalError(fatal_error)|. Must be called on the I/O
|
| // thread WITHOUT |write_lock_| held.
|
|
|