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

Side by Side Diff: net/socket/web_socket_server_socket.cc

Issue 8915024: Retry 114494 - Remove BindStateHolder and have Bind() return a Callback<> object directly." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years 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/socket/socket_test_util.cc ('k') | net/spdy/spdy_proxy_client_socket_unittest.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/socket/web_socket_server_socket.h" 5 #include "net/socket/web_socket_server_socket.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <deque> 8 #include <deque>
9 #include <limits> 9 #include <limits>
10 #include <map> 10 #include <map>
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 return transport_socket_->SetSendBufferSize(size); 314 return transport_socket_->SetSendBufferSize(size);
315 } 315 }
316 316
317 // WebSocketServerSocket implementation. 317 // WebSocketServerSocket implementation.
318 virtual int Accept(net::OldCompletionCallback* callback) { 318 virtual int Accept(net::OldCompletionCallback* callback) {
319 if (phase_ != PHASE_NYMPH) 319 if (phase_ != PHASE_NYMPH)
320 return net::ERR_UNEXPECTED; 320 return net::ERR_UNEXPECTED;
321 phase_ = PHASE_HANDSHAKE; 321 phase_ = PHASE_HANDSHAKE;
322 net::CompletionCallback cb; 322 net::CompletionCallback cb;
323 if (callback) { 323 if (callback) {
324 cb = base::Bind(&net::OldCompletionCallback::Run<int>, 324 cb = base::Bind(&net::OldCompletionCallbackAdapter, callback);
325 base::Unretained(callback));
326 } 325 }
327 pending_reqs_.push_front(PendingReq( 326 pending_reqs_.push_front(PendingReq(
328 PendingReq::TYPE_READ_METADATA, fill_handshake_buf_.get(), 327 PendingReq::TYPE_READ_METADATA, fill_handshake_buf_.get(),
329 cb)); 328 cb));
330 ConsiderTransportRead(); 329 ConsiderTransportRead();
331 return net::ERR_IO_PENDING; 330 return net::ERR_IO_PENDING;
332 } 331 }
333 332
334 std::deque<PendingReq>::iterator GetPendingReq(PendingReq::Type type) { 333 std::deque<PendingReq>::iterator GetPendingReq(PendingReq::Type type) {
335 for (std::deque<PendingReq>::iterator it = pending_reqs_.begin(); 334 for (std::deque<PendingReq>::iterator it = pending_reqs_.begin();
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 895
897 WebSocketServerSocket* CreateWebSocketServerSocket( 896 WebSocketServerSocket* CreateWebSocketServerSocket(
898 Socket* transport_socket, WebSocketServerSocket::Delegate* delegate) { 897 Socket* transport_socket, WebSocketServerSocket::Delegate* delegate) {
899 return new WebSocketServerSocketImpl(transport_socket, delegate); 898 return new WebSocketServerSocketImpl(transport_socket, delegate);
900 } 899 }
901 900
902 WebSocketServerSocket::~WebSocketServerSocket() { 901 WebSocketServerSocket::~WebSocketServerSocket() {
903 } 902 }
904 903
905 } // namespace net; 904 } // namespace net;
OLDNEW
« no previous file with comments | « net/socket/socket_test_util.cc ('k') | net/spdy/spdy_proxy_client_socket_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698