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

Side by Side Diff: net/base/stream_listen_socket.h

Issue 10386048: Decouple DevTools from socket implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update Created 8 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 unified diff | Download patch | Annotate | Revision Log
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 // Stream-based listen socket implementation that handles reading and writing 5 // Stream-based listen socket implementation that handles reading and writing
6 // to the socket, but does not handle creating the socket nor connecting 6 // to the socket, but does not handle creating the socket nor connecting
7 // sockets, which are handled by subclasses on creation and in Accept, 7 // sockets, which are handled by subclasses on creation and in Accept,
8 // respectively. 8 // respectively.
9 9
10 // StreamListenSocket handles IO asynchronously in the specified MessageLoop. 10 // StreamListenSocket handles IO asynchronously in the specified MessageLoop.
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 void PauseReads(); 125 void PauseReads();
126 void ResumeReads(); 126 void ResumeReads();
127 127
128 const SOCKET socket_; 128 const SOCKET socket_;
129 bool reads_paused_; 129 bool reads_paused_;
130 bool has_pending_reads_; 130 bool has_pending_reads_;
131 131
132 DISALLOW_COPY_AND_ASSIGN(StreamListenSocket); 132 DISALLOW_COPY_AND_ASSIGN(StreamListenSocket);
133 }; 133 };
134 134
135 // Abstract factory that must be subclassed for each subclass of
136 // StreamListenSocket.
137 class StreamListenSocketFactory {
138 public:
pfeldman 2012/05/14 11:12:00 Space before public is missing.
Philippe 2012/05/14 12:36:52 I've been fighting against my VIM on that for a co
139 virtual ~StreamListenSocketFactory() {}
140
141 // Returns a new instance of StreamListenSocket or NULL if an error occurred.
142 virtual scoped_refptr<StreamListenSocket> CreateAndListen(
pfeldman 2012/05/14 11:12:00 Why scoped_refptr?
Philippe 2012/05/14 12:36:52 Only for consistency with the existing CreateAndLi
mmenke 2012/05/14 20:45:19 The advantage of explicitly returning a scoped_ref
Philippe 2012/05/15 14:39:09 I made TCPListenSocket's destructor private and ad
143 StreamListenSocket::Delegate* delegate) = 0;
144 };
145
135 } // namespace net 146 } // namespace net
136 147
137 #endif // NET_BASE_STREAM_LISTEN_SOCKET_H_ 148 #endif // NET_BASE_STREAM_LISTEN_SOCKET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698