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

Unified Diff: net/server/web_socket.cc

Issue 1357693003: Returning scoped_ptr<> instead of raw pointer in WebSocket::CreateWebSocket (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « net/server/web_socket.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/server/web_socket.cc
diff --git a/net/server/web_socket.cc b/net/server/web_socket.cc
index 41c079db568635d664c364c9f53bdfdd2f27fbb8..c9637450d4a1ab9aa8b584dde85fff60293eb26b 100644
--- a/net/server/web_socket.cc
+++ b/net/server/web_socket.cc
@@ -34,9 +34,10 @@ WebSocket::WebSocket(HttpServer* server,
WebSocket::~WebSocket() {}
-WebSocket* WebSocket::CreateWebSocket(HttpServer* server,
- HttpConnection* connection,
- const HttpServerRequestInfo& request) {
+scoped_ptr<WebSocket> WebSocket::CreateWebSocket(
+ HttpServer* server,
+ HttpConnection* connection,
+ const HttpServerRequestInfo& request) {
std::string version = request.GetHeaderValue("sec-websocket-version");
if (version != "8" && version != "13") {
server->SendResponse(
@@ -55,7 +56,7 @@ WebSocket* WebSocket::CreateWebSocket(HttpServer* server,
"specified."));
return nullptr;
}
- return new WebSocket(server, connection, request);
+ return make_scoped_ptr(new WebSocket(server, connection, request));
}
void WebSocket::Accept(const HttpServerRequestInfo& request) {
« no previous file with comments | « net/server/web_socket.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698