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

Unified Diff: chrome/browser/devtools/tethering_adb_filter.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/devtools/tethering_adb_filter.cc
diff --git a/chrome/browser/devtools/tethering_adb_filter.cc b/chrome/browser/devtools/tethering_adb_filter.cc
index d3d14a88a763508011a3d2aa653402eabf9886ce..7505f8fdedb1282fb6b6ea2c2d29caacae55d008 100644
--- a/chrome/browser/devtools/tethering_adb_filter.cc
+++ b/chrome/browser/devtools/tethering_adb_filter.cc
@@ -100,9 +100,11 @@ class SocketTunnel {
void Pump(net::StreamSocket* from, net::StreamSocket* to) {
scoped_refptr<net::IOBuffer> buffer = new net::IOBuffer(kBufferSize);
- int result = from->Read(buffer, kBufferSize,
- base::Bind(&SocketTunnel::OnRead, base::Unretained(this), from, to,
- buffer));
+ int result = from->Read(
+ buffer.get(),
+ kBufferSize,
+ base::Bind(
+ &SocketTunnel::OnRead, base::Unretained(this), from, to, buffer));
if (result != net::ERR_IO_PENDING)
OnRead(from, to, buffer, result);
}
@@ -118,12 +120,16 @@ class SocketTunnel {
int total = result;
scoped_refptr<net::DrainableIOBuffer> drainable =
- new net::DrainableIOBuffer(buffer, total);
+ new net::DrainableIOBuffer(buffer.get(), total);
++pending_writes_;
- result = to->Write(drainable, total,
+ result = to->Write(drainable.get(),
+ total,
base::Bind(&SocketTunnel::OnWritten,
- base::Unretained(this), drainable, from, to));
+ base::Unretained(this),
+ drainable,
+ from,
+ to));
if (result != net::ERR_IO_PENDING)
OnWritten(drainable, from, to, result);
}
@@ -141,9 +147,12 @@ class SocketTunnel {
drainable->DidConsume(result);
if (drainable->BytesRemaining() > 0) {
++pending_writes_;
- result = to->Write(drainable, drainable->BytesRemaining(),
+ result = to->Write(drainable.get(),
+ drainable->BytesRemaining(),
base::Bind(&SocketTunnel::OnWritten,
- base::Unretained(this), drainable, from,
+ base::Unretained(this),
+ drainable,
+ from,
to));
if (result != net::ERR_IO_PENDING)
OnWritten(drainable, from, to, result);
« no previous file with comments | « chrome/browser/devtools/devtools_window.cc ('k') | chrome/browser/download/chrome_download_manager_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698