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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 // The lifetime of an instance of this class is completely controlled by the | 28 // The lifetime of an instance of this class is completely controlled by the |
29 // SocketStreamDispatcherHost. | 29 // SocketStreamDispatcherHost. |
30 class SocketStreamHost { | 30 class SocketStreamHost { |
31 public: | 31 public: |
32 SocketStreamHost(net::SocketStream::Delegate* delegate, | 32 SocketStreamHost(net::SocketStream::Delegate* delegate, |
33 int render_view_id, | 33 int render_view_id, |
34 int socket_id); | 34 int socket_id); |
35 ~SocketStreamHost(); | 35 ~SocketStreamHost(); |
36 | 36 |
37 // Gets socket_id associated with |socket|. | 37 // Gets socket_id associated with |socket|. |
38 static int SocketIdFromSocketStream(net::SocketStream* socket); | 38 static int SocketIdFromSocketStream(const net::SocketStream* socket); |
39 | 39 |
40 int render_view_id() const { return render_view_id_; } | 40 int render_view_id() const { return render_view_id_; } |
41 int socket_id() const { return socket_id_; } | 41 int socket_id() const { return socket_id_; } |
42 | 42 |
43 // Starts to open connection to |url|. | 43 // Starts to open connection to |url|. |
44 void Connect(const GURL& url, net::URLRequestContext* request_context); | 44 void Connect(const GURL& url, net::URLRequestContext* request_context); |
45 | 45 |
46 // Sends |data| over the socket stream. | 46 // Sends |data| over the socket stream. |
47 // socket stream must be open to send data. | 47 // socket stream must be open to send data. |
48 // Returns true if the data is put in transmit buffer in socket stream. | 48 // Returns true if the data is put in transmit buffer in socket stream. |
(...skipping 20 matching lines...) Expand all Loading... |
69 net::SocketStream::Delegate* delegate_; | 69 net::SocketStream::Delegate* delegate_; |
70 int render_view_id_; | 70 int render_view_id_; |
71 int socket_id_; | 71 int socket_id_; |
72 | 72 |
73 scoped_refptr<net::SocketStreamJob> socket_; | 73 scoped_refptr<net::SocketStreamJob> socket_; |
74 | 74 |
75 DISALLOW_COPY_AND_ASSIGN(SocketStreamHost); | 75 DISALLOW_COPY_AND_ASSIGN(SocketStreamHost); |
76 }; | 76 }; |
77 | 77 |
78 #endif // CONTENT_BROWSER_RENDERER_HOST_SOCKET_STREAM_HOST_H_ | 78 #endif // CONTENT_BROWSER_RENDERER_HOST_SOCKET_STREAM_HOST_H_ |
OLD | NEW |