| OLD | NEW |
| 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 #ifndef CONTENT_BROWSER_RENDERER_HOST_SOCKET_STREAM_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_SOCKET_STREAM_HOST_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_SOCKET_STREAM_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_SOCKET_STREAM_HOST_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 // Host of SocketStreamHandle. Each SocketStreamHandle will have an unique | 23 // Host of SocketStreamHandle. Each SocketStreamHandle will have an unique |
| 24 // socket_id assigned by SocketStreamHost constructor. If socket id is | 24 // socket_id assigned by SocketStreamHost constructor. If socket id is |
| 25 // kNoSocketId, there is no SocketStreamHost. Each SocketStreamHost has | 25 // kNoSocketId, there is no SocketStreamHost. Each SocketStreamHost has |
| 26 // SocketStream to manage bi-directional communication over socket stream. The | 26 // SocketStream to manage bi-directional communication over socket stream. The |
| 27 // lifetime of an instance of this class is completely controlled by the | 27 // lifetime of an instance of this class is completely controlled by the |
| 28 // SocketStreamDispatcherHost. | 28 // SocketStreamDispatcherHost. |
| 29 class SocketStreamHost { | 29 class SocketStreamHost { |
| 30 public: | 30 public: |
| 31 SocketStreamHost(net::SocketStream::Delegate* delegate, | 31 SocketStreamHost(net::SocketStream::Delegate* delegate, |
| 32 int child_id, | |
| 33 int render_frame_id, | 32 int render_frame_id, |
| 34 int socket_id); | 33 int socket_id); |
| 35 ~SocketStreamHost(); | 34 ~SocketStreamHost(); |
| 36 | 35 |
| 37 // Gets socket_id associated with |socket|. | 36 // Gets socket_id associated with |socket|. |
| 38 static int SocketIdFromSocketStream(const net::SocketStream* socket); | 37 static int SocketIdFromSocketStream(const net::SocketStream* socket); |
| 39 | 38 |
| 40 int render_frame_id() const { return render_frame_id_; } | 39 int render_frame_id() const { return render_frame_id_; } |
| 41 int socket_id() const { return socket_id_; } | 40 int socket_id() const { return socket_id_; } |
| 42 | 41 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 60 void CancelWithError(int error); | 59 void CancelWithError(int error); |
| 61 | 60 |
| 62 // Cancels the connection because of receiving a certificate with an error. | 61 // Cancels the connection because of receiving a certificate with an error. |
| 63 void CancelWithSSLError(const net::SSLInfo& ssl_info); | 62 void CancelWithSSLError(const net::SSLInfo& ssl_info); |
| 64 | 63 |
| 65 // Continue to establish the connection in spite of an error. | 64 // Continue to establish the connection in spite of an error. |
| 66 void ContinueDespiteError(); | 65 void ContinueDespiteError(); |
| 67 | 66 |
| 68 private: | 67 private: |
| 69 net::SocketStream::Delegate* delegate_; | 68 net::SocketStream::Delegate* delegate_; |
| 70 int child_id_; | |
| 71 int render_frame_id_; | 69 int render_frame_id_; |
| 72 int socket_id_; | 70 int socket_id_; |
| 73 | 71 |
| 74 scoped_refptr<net::SocketStreamJob> job_; | 72 scoped_refptr<net::SocketStreamJob> job_; |
| 75 | 73 |
| 76 DISALLOW_COPY_AND_ASSIGN(SocketStreamHost); | 74 DISALLOW_COPY_AND_ASSIGN(SocketStreamHost); |
| 77 }; | 75 }; |
| 78 | 76 |
| 79 } // namespace content | 77 } // namespace content |
| 80 | 78 |
| 81 #endif // CONTENT_BROWSER_RENDERER_HOST_SOCKET_STREAM_HOST_H_ | 79 #endif // CONTENT_BROWSER_RENDERER_HOST_SOCKET_STREAM_HOST_H_ |
| OLD | NEW |