| 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_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_SOCKET_STREAM_DISPATCHER_HOST_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_SOCKET_STREAM_DISPATCHER_HOST_H_ | 6 #define CONTENT_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 11 matching lines...) Expand all Loading... |
| 22 class ResourceContext; | 22 class ResourceContext; |
| 23 } | 23 } |
| 24 | 24 |
| 25 namespace net { | 25 namespace net { |
| 26 class SSLInfo; | 26 class SSLInfo; |
| 27 } | 27 } |
| 28 | 28 |
| 29 // Dispatches ViewHostMsg_SocketStream_* messages sent from renderer. | 29 // Dispatches ViewHostMsg_SocketStream_* messages sent from renderer. |
| 30 // It also acts as SocketStream::Delegate so that it sends | 30 // It also acts as SocketStream::Delegate so that it sends |
| 31 // ViewMsg_SocketStream_* messages back to renderer. | 31 // ViewMsg_SocketStream_* messages back to renderer. |
| 32 class SocketStreamDispatcherHost : public content::BrowserMessageFilter, | 32 class SocketStreamDispatcherHost |
| 33 public net::SocketStream::Delegate, | 33 : public content::BrowserMessageFilter, |
| 34 public SSLErrorHandler::Delegate { | 34 public net::SocketStream::Delegate, |
| 35 public SSLErrorHandler::Delegate, |
| 36 public base::SupportsWeakPtr<SocketStreamDispatcherHost> { |
| 35 public: | 37 public: |
| 36 SocketStreamDispatcherHost( | 38 SocketStreamDispatcherHost( |
| 37 int render_process_id, | 39 int render_process_id, |
| 38 ResourceMessageFilter::URLRequestContextSelector* selector, | 40 ResourceMessageFilter::URLRequestContextSelector* selector, |
| 39 content::ResourceContext* resource_context); | 41 content::ResourceContext* resource_context); |
| 40 | 42 |
| 41 // content::BrowserMessageFilter: | 43 // content::BrowserMessageFilter: |
| 42 virtual bool OnMessageReceived(const IPC::Message& message, | 44 virtual bool OnMessageReceived(const IPC::Message& message, |
| 43 bool* message_was_ok) OVERRIDE; | 45 bool* message_was_ok) OVERRIDE; |
| 44 | 46 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 74 private: | 76 private: |
| 75 // Message handlers called by OnMessageReceived. | 77 // Message handlers called by OnMessageReceived. |
| 76 void OnConnect(int render_view_id, const GURL& url, int socket_id); | 78 void OnConnect(int render_view_id, const GURL& url, int socket_id); |
| 77 void OnSendData(int socket_id, const std::vector<char>& data); | 79 void OnSendData(int socket_id, const std::vector<char>& data); |
| 78 void OnCloseReq(int socket_id); | 80 void OnCloseReq(int socket_id); |
| 79 | 81 |
| 80 void DeleteSocketStreamHost(int socket_id); | 82 void DeleteSocketStreamHost(int socket_id); |
| 81 | 83 |
| 82 net::URLRequestContext* GetURLRequestContext(); | 84 net::URLRequestContext* GetURLRequestContext(); |
| 83 | 85 |
| 84 // For SSLErrorHandler::Delegate calls from SSLManager. | |
| 85 base::WeakPtrFactory<SSLErrorHandler::Delegate> ssl_delegate_weak_factory_; | |
| 86 | |
| 87 IDMap<SocketStreamHost> hosts_; | 86 IDMap<SocketStreamHost> hosts_; |
| 88 int render_process_id_; | 87 int render_process_id_; |
| 89 const scoped_ptr<ResourceMessageFilter::URLRequestContextSelector> | 88 const scoped_ptr<ResourceMessageFilter::URLRequestContextSelector> |
| 90 url_request_context_selector_; | 89 url_request_context_selector_; |
| 91 content::ResourceContext* resource_context_; | 90 content::ResourceContext* resource_context_; |
| 92 | 91 |
| 93 DISALLOW_COPY_AND_ASSIGN(SocketStreamDispatcherHost); | 92 DISALLOW_COPY_AND_ASSIGN(SocketStreamDispatcherHost); |
| 94 }; | 93 }; |
| 95 | 94 |
| 96 #endif // CONTENT_BROWSER_RENDERER_HOST_SOCKET_STREAM_DISPATCHER_HOST_H_ | 95 #endif // CONTENT_BROWSER_RENDERER_HOST_SOCKET_STREAM_DISPATCHER_HOST_H_ |
| OLD | NEW |