| 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 16 matching lines...) Expand all  Loading... | 
| 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 render_view_id, | 32                    int render_view_id, | 
| 33                    int socket_id); | 33                    int socket_id); | 
| 34   ~SocketStreamHost(); | 34   ~SocketStreamHost(); | 
| 35 | 35 | 
| 36   // Gets socket_id associated with |socket|. | 36   // Gets socket_id associated with |socket|. | 
| 37   static int SocketIdFromSocketStream(net::SocketStream* socket); | 37   static int SocketIdFromSocketStream(const net::SocketStream* socket); | 
| 38 | 38 | 
| 39   int render_view_id() const { return render_view_id_; } | 39   int render_view_id() const { return render_view_id_; } | 
| 40   int socket_id() const { return socket_id_; } | 40   int socket_id() const { return socket_id_; } | 
| 41 | 41 | 
| 42   // Starts to open connection to |url|. | 42   // Starts to open connection to |url|. | 
| 43   void Connect(const GURL& url, net::URLRequestContext* request_context); | 43   void Connect(const GURL& url, net::URLRequestContext* request_context); | 
| 44 | 44 | 
| 45   // Sends |data| over the socket stream. | 45   // Sends |data| over the socket stream. | 
| 46   // socket stream must be open to send data. | 46   // socket stream must be open to send data. | 
| 47   // Returns true if the data is put in transmit buffer in socket stream. | 47   // Returns true if the data is put in transmit buffer in socket stream. | 
| (...skipping 22 matching lines...) Expand all  Loading... | 
| 70   int socket_id_; | 70   int socket_id_; | 
| 71 | 71 | 
| 72   scoped_refptr<net::SocketStreamJob> socket_; | 72   scoped_refptr<net::SocketStreamJob> socket_; | 
| 73 | 73 | 
| 74   DISALLOW_COPY_AND_ASSIGN(SocketStreamHost); | 74   DISALLOW_COPY_AND_ASSIGN(SocketStreamHost); | 
| 75 }; | 75 }; | 
| 76 | 76 | 
| 77 }  // namespace content | 77 }  // namespace content | 
| 78 | 78 | 
| 79 #endif  // CONTENT_BROWSER_RENDERER_HOST_SOCKET_STREAM_HOST_H_ | 79 #endif  // CONTENT_BROWSER_RENDERER_HOST_SOCKET_STREAM_HOST_H_ | 
| OLD | NEW | 
|---|