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) { |