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

Unified Diff: net/websockets/websocket.cc

Issue 4291001: Convert implicit scoped_refptr constructor calls to explicit ones, part 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/build
Patch Set: comments Created 10 years, 1 month 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
« no previous file with comments | « net/url_request/url_request.cc ('k') | net/websockets/websocket_job.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/websockets/websocket.cc
diff --git a/net/websockets/websocket.cc b/net/websockets/websocket.cc
index 3bf1da8178c5d1441e057de8fc0bf005f679ae22..f8d9eb91b5b5bb51ffe35f0b21580ecfcc7d8cbc 100644
--- a/net/websockets/websocket.cc
+++ b/net/websockets/websocket.cc
@@ -80,7 +80,7 @@ void WebSocket::Send(const std::string& msg) {
*p = '\0';
memcpy(p + 1, msg.data(), msg.size());
*(p + 1 + msg.size()) = '\xff';
- pending_write_bufs_.push_back(buf);
+ pending_write_bufs_.push_back(make_scoped_refptr(buf));
SendPending();
}
@@ -172,7 +172,7 @@ void WebSocket::OnConnected(SocketStream* socket_stream,
const std::string msg = handshake_->CreateClientHandshakeMessage();
IOBufferWithSize* buf = new IOBufferWithSize(msg.size());
memcpy(buf->data(), msg.data(), msg.size());
- pending_write_bufs_.push_back(buf);
+ pending_write_bufs_.push_back(make_scoped_refptr(buf));
origin_loop_->PostTask(FROM_HERE,
NewRunnableMethod(this, &WebSocket::SendPending));
}
@@ -430,7 +430,7 @@ void WebSocket::StartClosingHandshake() {
client_closing_handshake_ = true;
IOBufferWithSize* buf = new IOBufferWithSize(2);
memcpy(buf->data(), kClosingFrame, 2);
- pending_write_bufs_.push_back(buf);
+ pending_write_bufs_.push_back(make_scoped_refptr(buf));
SendPending();
}
« no previous file with comments | « net/url_request/url_request.cc ('k') | net/websockets/websocket_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698