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

Side by Side Diff: net/tools/fetch/http_listen_socket.cc

Issue 15829004: Update net/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: license twerk Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/tools/fetch/fetch_client.cc ('k') | net/udp/udp_socket_libevent.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/tools/fetch/http_listen_socket.h" 5 #include "net/tools/fetch/http_listen_socket.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 13 matching lines...) Expand all
24 24
25 void HttpListenSocket::Accept() { 25 void HttpListenSocket::Accept() {
26 SocketDescriptor conn = net::TCPListenSocket::AcceptSocket(); 26 SocketDescriptor conn = net::TCPListenSocket::AcceptSocket();
27 DCHECK_NE(conn, net::TCPListenSocket::kInvalidSocket); 27 DCHECK_NE(conn, net::TCPListenSocket::kInvalidSocket);
28 if (conn == net::TCPListenSocket::kInvalidSocket) { 28 if (conn == net::TCPListenSocket::kInvalidSocket) {
29 // TODO 29 // TODO
30 } else { 30 } else {
31 scoped_refptr<HttpListenSocket> sock( 31 scoped_refptr<HttpListenSocket> sock(
32 new HttpListenSocket(conn, delegate_)); 32 new HttpListenSocket(conn, delegate_));
33 // It's up to the delegate to AddRef if it wants to keep it around. 33 // It's up to the delegate to AddRef if it wants to keep it around.
34 DidAccept(this, sock); 34 DidAccept(this, sock.get());
35 } 35 }
36 } 36 }
37 37
38 // static 38 // static
39 scoped_refptr<HttpListenSocket> HttpListenSocket::CreateAndListen( 39 scoped_refptr<HttpListenSocket> HttpListenSocket::CreateAndListen(
40 const std::string& ip, 40 const std::string& ip,
41 int port, 41 int port,
42 HttpListenSocket::Delegate* delegate) { 42 HttpListenSocket::Delegate* delegate) {
43 SocketDescriptor s = net::TCPListenSocket::CreateAndBind(ip, port); 43 SocketDescriptor s = net::TCPListenSocket::CreateAndBind(ip, port);
44 if (s == net::TCPListenSocket::kInvalidSocket) { 44 if (s == net::TCPListenSocket::kInvalidSocket) {
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 238
239 // End of headers. 239 // End of headers.
240 response += "\r\n"; 240 response += "\r\n";
241 241
242 // Add data. 242 // Add data.
243 response += data; 243 response += data;
244 244
245 // Write it all out. 245 // Write it all out.
246 this->Send(response, false); 246 this->Send(response, false);
247 } 247 }
OLDNEW
« no previous file with comments | « net/tools/fetch/fetch_client.cc ('k') | net/udp/udp_socket_libevent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698