| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_BROWSER_RENDERER_HOST_SOCKET_STREAM_HOST_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_SOCKET_STREAM_HOST_H_ |
| 6 #define CHROME_BROWSER_RENDERER_HOST_SOCKET_STREAM_HOST_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_SOCKET_STREAM_HOST_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
| 11 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" | 11 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" |
| 12 #include "net/socket_stream/socket_stream.h" | 12 #include "net/socket_stream/socket_stream_job.h" |
| 13 | 13 |
| 14 class GURL; | 14 class GURL; |
| 15 | 15 |
| 16 // Host of SocketStreamHandle. | 16 // Host of SocketStreamHandle. |
| 17 // Each SocketStreamHandle will have an unique socket_id assigned by | 17 // Each SocketStreamHandle will have an unique socket_id assigned by |
| 18 // SocketStreamHost constructor. If socket id is chrome_common_net::kNoSocketId, | 18 // SocketStreamHost constructor. If socket id is chrome_common_net::kNoSocketId, |
| 19 // there is no SocketStreamHost. | 19 // there is no SocketStreamHost. |
| 20 // Each SocketStreamHost has SocketStream to manage bi-directional | 20 // Each SocketStreamHost has SocketStream to manage bi-directional |
| 21 // communication over socket stream. | 21 // communication over socket stream. |
| 22 // The lifetime of an instance of this class is completely controlled by the | 22 // The lifetime of an instance of this class is completely controlled by the |
| (...skipping 28 matching lines...) Expand all Loading... |
| 51 | 51 |
| 52 bool SentData(int amount_sent); | 52 bool SentData(int amount_sent); |
| 53 | 53 |
| 54 bool ReceivedData(const char* data, int len); | 54 bool ReceivedData(const char* data, int len); |
| 55 | 55 |
| 56 private: | 56 private: |
| 57 net::SocketStream::Delegate* delegate_; | 57 net::SocketStream::Delegate* delegate_; |
| 58 ResourceDispatcherHost::Receiver* receiver_; | 58 ResourceDispatcherHost::Receiver* receiver_; |
| 59 int socket_id_; | 59 int socket_id_; |
| 60 | 60 |
| 61 scoped_refptr<net::SocketStream> socket_; | 61 scoped_refptr<net::SocketStreamJob> socket_; |
| 62 | 62 |
| 63 DISALLOW_COPY_AND_ASSIGN(SocketStreamHost); | 63 DISALLOW_COPY_AND_ASSIGN(SocketStreamHost); |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 #endif // CHROME_BROWSER_RENDERER_HOST_SOCKET_STREAM_HOST_H_ | 66 #endif // CHROME_BROWSER_RENDERER_HOST_SOCKET_STREAM_HOST_H_ |
| OLD | NEW |