| Index: chrome/browser/extensions/api/messaging/native_message_process_host.cc
|
| diff --git a/chrome/browser/extensions/api/messaging/native_message_process_host.cc b/chrome/browser/extensions/api/messaging/native_message_process_host.cc
|
| index 1f713d39ffd17ce6b0a5734d69ccb1788a29a340..9f8c50b5c6ab7019df464277e03eb3a2d3baef37 100644
|
| --- a/chrome/browser/extensions/api/messaging/native_message_process_host.cc
|
| +++ b/chrome/browser/extensions/api/messaging/native_message_process_host.cc
|
| @@ -215,9 +215,9 @@ void NativeMessageProcessHost::DoRead() {
|
| while (!closed_ && !read_eof_ && !read_pending_) {
|
| read_buffer_ = new net::IOBuffer(kReadBufferSize);
|
| int result = read_stream_->Read(
|
| - read_buffer_, kReadBufferSize,
|
| - base::Bind(&NativeMessageProcessHost::OnRead,
|
| - base::Unretained(this)));
|
| + read_buffer_.get(),
|
| + kReadBufferSize,
|
| + base::Bind(&NativeMessageProcessHost::OnRead, base::Unretained(this)));
|
| HandleReadResult(result);
|
| }
|
| }
|
| @@ -310,18 +310,20 @@ void NativeMessageProcessHost::DoWrite() {
|
| DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
|
|
|
| while (!write_pending_ && !closed_) {
|
| - if (!current_write_buffer_ || !current_write_buffer_->BytesRemaining()) {
|
| + if (!current_write_buffer_.get() ||
|
| + !current_write_buffer_->BytesRemaining()) {
|
| if (write_queue_.empty())
|
| return;
|
| current_write_buffer_ = new net::DrainableIOBuffer(
|
| - write_queue_.front(), write_queue_.front()->size());
|
| + write_queue_.front().get(), write_queue_.front()->size());
|
| write_queue_.pop();
|
| }
|
|
|
| - int result = write_stream_->Write(
|
| - current_write_buffer_, current_write_buffer_->BytesRemaining(),
|
| - base::Bind(&NativeMessageProcessHost::OnWritten,
|
| - base::Unretained(this)));
|
| + int result =
|
| + write_stream_->Write(current_write_buffer_.get(),
|
| + current_write_buffer_->BytesRemaining(),
|
| + base::Bind(&NativeMessageProcessHost::OnWritten,
|
| + base::Unretained(this)));
|
| HandleWriteResult(result);
|
| }
|
| }
|
|
|