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: content/browser/renderer_host/p2p/socket_host_tcp.h

Issue 691253003: Avoid calling P2PSocketHostTcpBase::DoRead in case of error. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « no previous file | content/browser/renderer_host/p2p/socket_host_tcp.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 #ifndef CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TCP_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TCP_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TCP_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TCP_H_
7 7
8 #include <queue> 8 #include <queue>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 void DoWrite(); 74 void DoWrite();
75 void HandleWriteResult(int result); 75 void HandleWriteResult(int result);
76 76
77 // Callbacks for Connect(), Read() and Write(). 77 // Callbacks for Connect(), Read() and Write().
78 void OnConnected(int result); 78 void OnConnected(int result);
79 void OnRead(int result); 79 void OnRead(int result);
80 void OnWritten(int result); 80 void OnWritten(int result);
81 81
82 // Helper method to send socket create message and start read. 82 // Helper method to send socket create message and start read.
83 void OnOpen(); 83 void OnOpen();
84 void DoSendSocketCreateMsg(); 84 bool DoSendSocketCreateMsg();
85 85
86 P2PHostAndIPEndPoint remote_address_; 86 P2PHostAndIPEndPoint remote_address_;
87 87
88 scoped_ptr<net::StreamSocket> socket_; 88 scoped_ptr<net::StreamSocket> socket_;
89 scoped_refptr<net::GrowableIOBuffer> read_buffer_; 89 scoped_refptr<net::GrowableIOBuffer> read_buffer_;
90 std::queue<scoped_refptr<net::DrainableIOBuffer> > write_queue_; 90 std::queue<scoped_refptr<net::DrainableIOBuffer> > write_queue_;
91 scoped_refptr<net::DrainableIOBuffer> write_buffer_; 91 scoped_refptr<net::DrainableIOBuffer> write_buffer_;
92 92
93 bool write_pending_; 93 bool write_pending_;
94 94
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 private: 139 private:
140 int GetExpectedPacketSize(const char* data, int len, int* pad_bytes); 140 int GetExpectedPacketSize(const char* data, int len, int* pad_bytes);
141 141
142 DISALLOW_COPY_AND_ASSIGN(P2PSocketHostStunTcp); 142 DISALLOW_COPY_AND_ASSIGN(P2PSocketHostStunTcp);
143 }; 143 };
144 144
145 145
146 } // namespace content 146 } // namespace content
147 147
148 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TCP_H_ 148 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TCP_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/p2p/socket_host_tcp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698