| 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_P2P_SOCKET_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_DISPATCHER_HOST_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_DISPATCHER_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_DISPATCHER_HOST_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "content/common/p2p_sockets.h" | 10 #include "content/common/p2p_sockets.h" |
| 11 #include "content/public/browser/browser_message_filter.h" | 11 #include "content/public/browser/browser_message_filter.h" |
| 12 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
| 13 #include "net/base/ip_endpoint.h" | 13 #include "net/base/ip_endpoint.h" |
| 14 #include "net/base/network_change_notifier.h" | 14 #include "net/base/network_change_notifier.h" |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 | 17 |
| 18 class P2PSocketHost; | 18 class P2PSocketHost; |
| 19 class ResourceContext; | 19 class ResourceContext; |
| 20 | 20 |
| 21 class P2PSocketDispatcherHost | 21 class P2PSocketDispatcherHost |
| 22 : public content::BrowserMessageFilter, | 22 : public content::BrowserMessageFilter, |
| 23 public net::NetworkChangeNotifier::IPAddressObserver { | 23 public net::NetworkChangeNotifier::NetworkChangeObserver { |
| 24 public: | 24 public: |
| 25 P2PSocketDispatcherHost(content::ResourceContext* resource_context); | 25 P2PSocketDispatcherHost(content::ResourceContext* resource_context); |
| 26 | 26 |
| 27 // content::BrowserMessageFilter overrides. | 27 // content::BrowserMessageFilter overrides. |
| 28 virtual void OnChannelClosing() OVERRIDE; | 28 virtual void OnChannelClosing() OVERRIDE; |
| 29 virtual void OnDestruct() const OVERRIDE; | 29 virtual void OnDestruct() const OVERRIDE; |
| 30 virtual bool OnMessageReceived(const IPC::Message& message, | 30 virtual bool OnMessageReceived(const IPC::Message& message, |
| 31 bool* message_was_ok) OVERRIDE; | 31 bool* message_was_ok) OVERRIDE; |
| 32 | 32 |
| 33 // net::NetworkChangeNotifier::IPAddressObserver interface. | 33 // net::NetworkChangeNotifier::NetworkChangeObserver interface. |
| 34 virtual void OnIPAddressChanged() OVERRIDE; | 34 virtual void OnNetworkChanged( |
| 35 net::NetworkChangeNotifier::ConnectionType type) OVERRIDE; |
| 35 | 36 |
| 36 protected: | 37 protected: |
| 37 virtual ~P2PSocketDispatcherHost(); | 38 virtual ~P2PSocketDispatcherHost(); |
| 38 | 39 |
| 39 private: | 40 private: |
| 40 friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>; | 41 friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>; |
| 41 friend class base::DeleteHelper<P2PSocketDispatcherHost>; | 42 friend class base::DeleteHelper<P2PSocketDispatcherHost>; |
| 42 | 43 |
| 43 typedef std::map<int, P2PSocketHost*> SocketsMap; | 44 typedef std::map<int, P2PSocketHost*> SocketsMap; |
| 44 | 45 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 bool monitoring_networks_; | 79 bool monitoring_networks_; |
| 79 | 80 |
| 80 std::set<DnsRequest*> dns_requests_; | 81 std::set<DnsRequest*> dns_requests_; |
| 81 | 82 |
| 82 DISALLOW_COPY_AND_ASSIGN(P2PSocketDispatcherHost); | 83 DISALLOW_COPY_AND_ASSIGN(P2PSocketDispatcherHost); |
| 83 }; | 84 }; |
| 84 | 85 |
| 85 } // namespace content | 86 } // namespace content |
| 86 | 87 |
| 87 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_DISPATCHER_HOST_H_ | 88 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_DISPATCHER_HOST_H_ |
| OLD | NEW |