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

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

Issue 9309090: Fix ref leak in WebSocketServerSocketImpl introduced in r115422. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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 | « no previous file | tools/heapcheck/suppressions.txt » ('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 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 memcpy(io_buf_->data() + bytes_written_, p, len); 719 memcpy(io_buf_->data() + bytes_written_, p, len);
720 bytes_written_ += len; 720 bytes_written_ += len;
721 return true; 721 return true;
722 } 722 }
723 723
724 bool WriteLine(const char* p) { 724 bool WriteLine(const char* p) {
725 return Write(p, strlen(p)) && Write(kCRLF, strlen(kCRLF)); 725 return Write(p, strlen(p)) && Write(kCRLF, strlen(kCRLF));
726 } 726 }
727 727
728 operator net::DrainableIOBuffer*() { 728 operator net::DrainableIOBuffer*() {
729 return new net::DrainableIOBuffer(io_buf_.release(), bytes_written_); 729 return new net::DrainableIOBuffer(io_buf_.get(), bytes_written_);
730 } 730 }
731 731
732 bool is_ok() { return is_ok_; } 732 bool is_ok() { return is_ok_; }
733 733
734 private: 734 private:
735 scoped_refptr<net::IOBuffer> io_buf_; 735 scoped_refptr<net::IOBuffer> io_buf_;
736 size_t bytes_written_; 736 size_t bytes_written_;
737 bool is_ok_; 737 bool is_ok_;
738 } buffer; 738 } buffer;
739 739
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 887
888 WebSocketServerSocket* CreateWebSocketServerSocket( 888 WebSocketServerSocket* CreateWebSocketServerSocket(
889 Socket* transport_socket, WebSocketServerSocket::Delegate* delegate) { 889 Socket* transport_socket, WebSocketServerSocket::Delegate* delegate) {
890 return new WebSocketServerSocketImpl(transport_socket, delegate); 890 return new WebSocketServerSocketImpl(transport_socket, delegate);
891 } 891 }
892 892
893 WebSocketServerSocket::~WebSocketServerSocket() { 893 WebSocketServerSocket::~WebSocketServerSocket() {
894 } 894 }
895 895
896 } // namespace net; 896 } // namespace net;
OLDNEW
« no previous file with comments | « no previous file | tools/heapcheck/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698