OLD | NEW |
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 CHROME_BROWSER_RENDERER_HOST_SOCKET_STREAM_DISPATCHER_HOST_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_SOCKET_STREAM_DISPATCHER_HOST_H_ |
6 #define CHROME_BROWSER_RENDERER_HOST_SOCKET_STREAM_DISPATCHER_HOST_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_SOCKET_STREAM_DISPATCHER_HOST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 // The object died, so cancel and detach all requests associated with it. | 32 // The object died, so cancel and detach all requests associated with it. |
33 void CancelRequestsForProcess(int host_id); | 33 void CancelRequestsForProcess(int host_id); |
34 | 34 |
35 // SocketStream::Delegate methods. | 35 // SocketStream::Delegate methods. |
36 virtual void OnConnected(net::SocketStream* socket, | 36 virtual void OnConnected(net::SocketStream* socket, |
37 int max_pending_send_allowed); | 37 int max_pending_send_allowed); |
38 virtual void OnSentData(net::SocketStream* socket, int amount_sent); | 38 virtual void OnSentData(net::SocketStream* socket, int amount_sent); |
39 virtual void OnReceivedData(net::SocketStream* socket, | 39 virtual void OnReceivedData(net::SocketStream* socket, |
40 const char* data, int len); | 40 const char* data, int len); |
41 virtual void OnClose(net::SocketStream* socket); | 41 virtual void OnClose(net::SocketStream* socket); |
| 42 virtual void OnError(const net::SocketStream* socket, int error); |
42 | 43 |
43 void set_url_request_context_override( | 44 void set_url_request_context_override( |
44 ResourceMessageFilter::URLRequestContextOverride* u) { | 45 ResourceMessageFilter::URLRequestContextOverride* u) { |
45 url_request_context_override_ = u; | 46 url_request_context_override_ = u; |
46 } | 47 } |
47 | 48 |
48 private: | 49 private: |
49 // Message handlers called by OnMessageReceived. | 50 // Message handlers called by OnMessageReceived. |
50 void OnConnect(const GURL& url, int socket_id); | 51 void OnConnect(const GURL& url, int socket_id); |
51 void OnSendData(int socket_id, const std::vector<char>& data); | 52 void OnSendData(int socket_id, const std::vector<char>& data); |
52 void OnCloseReq(int socket_id); | 53 void OnCloseReq(int socket_id); |
53 | 54 |
54 void DeleteSocketStreamHost(int socket_id); | 55 void DeleteSocketStreamHost(int socket_id); |
55 | 56 |
56 net::URLRequestContext* GetURLRequestContext(); | 57 net::URLRequestContext* GetURLRequestContext(); |
57 | 58 |
58 IDMap<SocketStreamHost> hosts_; | 59 IDMap<SocketStreamHost> hosts_; |
59 scoped_refptr<ResourceMessageFilter::URLRequestContextOverride> | 60 scoped_refptr<ResourceMessageFilter::URLRequestContextOverride> |
60 url_request_context_override_; | 61 url_request_context_override_; |
61 | 62 |
62 DISALLOW_COPY_AND_ASSIGN(SocketStreamDispatcherHost); | 63 DISALLOW_COPY_AND_ASSIGN(SocketStreamDispatcherHost); |
63 }; | 64 }; |
64 | 65 |
65 #endif // CHROME_BROWSER_RENDERER_HOST_SOCKET_STREAM_DISPATCHER_HOST_H_ | 66 #endif // CHROME_BROWSER_RENDERER_HOST_SOCKET_STREAM_DISPATCHER_HOST_H_ |
OLD | NEW |