Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1402)

Unified Diff: chrome/browser/extensions/api/messaging/native_message_process_host.cc

Issue 16295003: Update chrome/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}
}

Powered by Google App Engine
This is Rietveld 408576698